Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5bb8824

Browse files
author
Jonah Williams
authored
Merge branch 'main' into image_filter_shader
2 parents 77e290b + e243b58 commit 5bb8824

23 files changed

+292
-31
lines changed

DEPS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vars = {
1414
'flutter_git': 'https://flutter.googlesource.com',
1515
'skia_git': 'https://skia.googlesource.com',
1616
'llvm_git': 'https://llvm.googlesource.com',
17-
'skia_revision': '4a27ce0f92d482d5ad4592a68535765d1ddc4f53',
17+
'skia_revision': '9edafde22cb33b0974727a7d62aeacaff81e4285',
1818

1919
# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
2020
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
@@ -56,7 +56,7 @@ vars = {
5656
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
5757
# You can use //tools/dart/create_updated_flutter_deps.py to produce
5858
# updated revision list of existing dependencies.
59-
'dart_revision': 'ffc8bb004a64f6357e3d5d1185e974e966f00931',
59+
'dart_revision': '1679aba20a032d26f337eb987bd5ae03bec099cb',
6060

6161
# WARNING: DO NOT EDIT MANUALLY
6262
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
@@ -66,7 +66,7 @@ vars = {
6666
'dart_browser_launcher_rev': '60126904a26b761d29b4f2d76292ff3c089160de',
6767
'dart_clock_rev': 'ad428ea8b75fa0d7ba629791552d40478745c54a',
6868
'dart_collection_rev': '9354f386de3c57f5486b01ab4dfa1a2f033307d9',
69-
'dart_devtools_rev': '70375f6c6d81faa8f3069aa6dcf2a98c69445455',
69+
'dart_devtools_rev': 'e77d6ce142b7bc737af3652f5727e449e84b7b03',
7070
'dart_libprotobuf_rev': '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb',
7171
'dart_perfetto_rev': '13ce0c9e13b0940d2476cd0cff2301708a9a2e2b',
7272
'dart_protobuf_gn_rev': 'ca669f79945418f6229e4fef89b666b2a88cbb10',
@@ -347,7 +347,7 @@ deps = {
347347
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git@654ee6e2504f11fb0e982a2cf276bafa750f694b',
348348

349349
'src/flutter/third_party/dart/third_party/devtools':
350-
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:70375f6c6d81faa8f3069aa6dcf2a98c69445455'}]},
350+
{'dep_type': 'cipd', 'packages': [{'package': 'dart/third_party/flutter/devtools', 'version': 'git_revision:e77d6ce142b7bc737af3652f5727e449e84b7b03'}]},
351351

352352
'src/flutter/third_party/dart/third_party/pkg/args':
353353
Var('dart_git') + '/args.git@6a5a2e6b1f0020b873c7ffbdd36a784c4f9ee300',
@@ -518,7 +518,7 @@ deps = {
518518
Var('dart_git') + '/yaml_edit.git' + '@' + Var('dart_yaml_edit_rev'),
519519

520520
'src/flutter/third_party/dart/tools/sdks/dart-sdk':
521-
{'dep_type': 'cipd', 'packages': [{'package': 'dart/dart-sdk/${{platform}}', 'version': 'version:3.5.0-278.0.dev'}]},
521+
{'dep_type': 'cipd', 'packages': [{'package': 'dart/dart-sdk/${{platform}}', 'version': 'git_revision:7e6469bd51d404916395a47b011d907d2c905121'}]},
522522

523523
# WARNING: end of dart dependencies list that is cleaned up automatically - see create_updated_flutter_deps.py.
524524

@@ -969,7 +969,7 @@ deps = {
969969
'packages': [
970970
{
971971
'package': 'fuchsia/sdk/core/linux-amd64',
972-
'version': 'unavXf_l4lhu23MGglxDwupxPwyrgQVVE08bwyPMBkgC'
972+
'version': 'yYs6rINJxWJ8J2vxosAok9uQjUiXQTReG2j-rKqacfIC'
973973
}
974974
],
975975
'condition': 'download_fuchsia_deps and not download_fuchsia_sdk',

ci/builders/local_engine.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,32 @@
711711
"targets": []
712712
}
713713
},
714+
{
715+
"cas_archive": false,
716+
"drone_dimensions": [
717+
"os=Windows-10",
718+
"device_type=none"
719+
],
720+
"gclient_variables": {
721+
"download_android_deps": false,
722+
"use_rbe": true
723+
},
724+
"gn": [
725+
"--runtime-mode",
726+
"debug",
727+
"--unoptimized",
728+
"--no-stripped",
729+
"--no-lto",
730+
"--rbe",
731+
"--no-goma"
732+
],
733+
"name": "windows/host_debug_unopt",
734+
"description": "Builds an unoptimized debug mode engine for a Windows host.",
735+
"ninja": {
736+
"config": "host_debug_unopt",
737+
"targets": []
738+
}
739+
},
714740
{
715741
"cas_archive": false,
716742
"drone_dimensions": [

ci/licenses_golden/licenses_dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 987cab3f3e3a6e4e7248b7606f819b61
1+
Signature: cdf0a0115b34b2592fab6d9570fce532
22

33
====================================================================================================
44
LIBRARY: dart
@@ -4086,7 +4086,10 @@ ORIGIN: ../../../flutter/third_party/dart/runtime/vm/compiler/backend/dart_calli
40864086
ORIGIN: ../../../flutter/third_party/dart/runtime/vm/heap/incremental_compactor.cc + ../../../flutter/third_party/dart/LICENSE
40874087
ORIGIN: ../../../flutter/third_party/dart/runtime/vm/heap/incremental_compactor.h + ../../../flutter/third_party/dart/LICENSE
40884088
ORIGIN: ../../../flutter/third_party/dart/runtime/vm/os.cc + ../../../flutter/third_party/dart/LICENSE
4089+
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/custom_hash_set.dart + ../../../flutter/third_party/dart/LICENSE
40894090
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_only.dart + ../../../flutter/third_party/dart/LICENSE
4091+
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/identity_hash_set.dart + ../../../flutter/third_party/dart/LICENSE
4092+
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart + ../../../flutter/third_party/dart/LICENSE
40904093
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_runtime/lib/dart2js_only.dart + ../../../flutter/third_party/dart/LICENSE
40914094
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/invocation_mirror_constants.dart + ../../../flutter/third_party/dart/LICENSE
40924095
ORIGIN: ../../../flutter/third_party/dart/sdk/lib/_internal/js_shared/lib/date_time_patch.dart + ../../../flutter/third_party/dart/LICENSE
@@ -4106,7 +4109,10 @@ FILE: ../../../flutter/third_party/dart/runtime/vm/compiler/backend/dart_calling
41064109
FILE: ../../../flutter/third_party/dart/runtime/vm/heap/incremental_compactor.cc
41074110
FILE: ../../../flutter/third_party/dart/runtime/vm/heap/incremental_compactor.h
41084111
FILE: ../../../flutter/third_party/dart/runtime/vm/os.cc
4112+
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/custom_hash_set.dart
41094113
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/ddc_only.dart
4114+
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/identity_hash_set.dart
4115+
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart
41104116
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_runtime/lib/dart2js_only.dart
41114117
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_runtime/lib/synced/invocation_mirror_constants.dart
41124118
FILE: ../../../flutter/third_party/dart/sdk/lib/_internal/js_shared/lib/date_time_patch.dart
@@ -4751,7 +4757,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
47514757
This Source Code Form is "Incompatible With Secondary Licenses", as
47524758
defined by the Mozilla Public License, v. 2.0.
47534759

4754-
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/ffc8bb004a64f6357e3d5d1185e974e966f00931
4760+
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/1679aba20a032d26f337eb987bd5ae03bec099cb
47554761
/third_party/fallback_root_certificates/
47564762

47574763
====================================================================================================

ci/licenses_golden/licenses_fuchsia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: d1d3cb5a31ba9ce41f999c152bc102d9
1+
Signature: e6b0e1c813bcd00e12784dd5a3663cbe
22

33
====================================================================================================
44
LIBRARY: fuchsia_sdk

ci/licenses_golden/licenses_skia

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 0e9545368d6d983a3791c52a159607a1
1+
Signature: 53ce944c3bbf1a9eca2f6cce5597795f
22

33
====================================================================================================
44
LIBRARY: etc1
@@ -6752,6 +6752,7 @@ ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/geometry/GrShape.cpp +
67526752
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/geometry/GrShape.h + ../../../flutter/third_party/skia/LICENSE
67536753
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/gl/webgl/GrGLMakeNativeInterface_webgl.cpp + ../../../flutter/third_party/skia/LICENSE
67546754
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/glsl/GrGLSLUniformHandler.cpp + ../../../flutter/third_party/skia/LICENSE
6755+
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/AtlasInstancedHelper.cpp + ../../../flutter/third_party/skia/LICENSE
67556756
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/vk/GrVkMSAALoadManager.cpp + ../../../flutter/third_party/skia/LICENSE
67566757
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/vk/GrVkMSAALoadManager.h + ../../../flutter/third_party/skia/LICENSE
67576758
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/vk/GrVkManagedResource.h + ../../../flutter/third_party/skia/LICENSE
@@ -6885,6 +6886,7 @@ FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/geometry/GrShape.cpp
68856886
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/geometry/GrShape.h
68866887
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/gl/webgl/GrGLMakeNativeInterface_webgl.cpp
68876888
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/glsl/GrGLSLUniformHandler.cpp
6889+
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/AtlasInstancedHelper.cpp
68886890
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/vk/GrVkMSAALoadManager.cpp
68896891
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/vk/GrVkMSAALoadManager.h
68906892
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/vk/GrVkManagedResource.h
@@ -6961,7 +6963,6 @@ ORIGIN: ../../../flutter/third_party/skia/gm/clear_swizzle.cpp + ../../../flutte
69616963
ORIGIN: ../../../flutter/third_party/skia/gm/gpu_blur_utils.cpp + ../../../flutter/third_party/skia/LICENSE
69626964
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/gl/GrGLFinishCallbacks.cpp + ../../../flutter/third_party/skia/LICENSE
69636965
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/gl/GrGLFinishCallbacks.h + ../../../flutter/third_party/skia/LICENSE
6964-
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/AtlasInstancedHelper.cpp + ../../../flutter/third_party/skia/LICENSE
69656966
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/StrokeTessellateOp.cpp + ../../../flutter/third_party/skia/LICENSE
69666967
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/StrokeTessellateOp.h + ../../../flutter/third_party/skia/LICENSE
69676968
ORIGIN: ../../../flutter/third_party/skia/src/gpu/ganesh/tessellate/GrStrokeTessellationShader.cpp + ../../../flutter/third_party/skia/LICENSE
@@ -6974,7 +6975,6 @@ FILE: ../../../flutter/third_party/skia/gm/clear_swizzle.cpp
69746975
FILE: ../../../flutter/third_party/skia/gm/gpu_blur_utils.cpp
69756976
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/gl/GrGLFinishCallbacks.cpp
69766977
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/gl/GrGLFinishCallbacks.h
6977-
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/AtlasInstancedHelper.cpp
69786978
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/StrokeTessellateOp.cpp
69796979
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/ops/StrokeTessellateOp.h
69806980
FILE: ../../../flutter/third_party/skia/src/gpu/ganesh/tessellate/GrStrokeTessellationShader.cpp

impeller/aiks/canvas.cc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,16 +1006,23 @@ void Canvas::DrawVertices(const std::shared_ptr<VerticesGeometry>& vertices,
10061006
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
10071007
vertices->GetTextureCoordinateCoverge().value_or(cvg.value());
10081008
}
1009-
src_contents =
1010-
src_paint.CreateContentsForGeometry(Geometry::MakeRect(src_coverage));
1009+
Rect translated_coverage = Rect::MakeSize(src_coverage.GetSize());
1010+
src_contents = src_paint.CreateContentsForGeometry(
1011+
Geometry::MakeRect(translated_coverage));
10111012

10121013
auto contents = std::make_shared<VerticesSimpleBlendContents>();
10131014
contents->SetBlendMode(blend_mode);
10141015
contents->SetAlpha(paint.color.alpha);
10151016
contents->SetGeometry(vertices);
1016-
contents->SetLazyTexture([src_contents](const ContentContext& renderer) {
1017-
return src_contents->RenderToSnapshot(renderer, {})->texture;
1018-
});
1017+
contents->SetLazyTextureCoverage(src_coverage);
1018+
contents->SetLazyTexture(
1019+
[src_contents, translated_coverage](const ContentContext& renderer) {
1020+
// Applying the src coverage as the coverage limit prevents the 1px
1021+
// coverage pad from adding a border that is picked up by developer
1022+
// specified UVs.
1023+
return src_contents->RenderToSnapshot(renderer, {}, translated_coverage)
1024+
->texture;
1025+
});
10191026
entity.SetContents(paint.WithFilters(std::move(contents)));
10201027
AddRenderEntityToCurrentPass(std::move(entity));
10211028
}

impeller/aiks/experimental_canvas.cc

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "impeller/aiks/canvas.h"
88
#include "impeller/aiks/paint_pass_delegate.h"
99
#include "impeller/base/validation.h"
10+
#include "impeller/core/formats.h"
1011
#include "impeller/entity/contents/framebuffer_blend_contents.h"
1112
#include "impeller/entity/contents/text_contents.h"
1213
#include "impeller/entity/entity.h"
@@ -594,11 +595,36 @@ void ExperimentalCanvas::DrawTextFrame(
594595

595596
void ExperimentalCanvas::AddRenderEntityToCurrentPass(Entity entity,
596597
bool reuse_depth) {
598+
entity.SetTransform(
599+
Matrix::MakeTranslation(Vector3(-GetGlobalPassPosition())) *
600+
entity.GetTransform());
597601
entity.SetInheritedOpacity(transform_stack_.back().distributed_opacity);
602+
if (entity.GetBlendMode() == BlendMode::kSourceOver &&
603+
entity.GetContents()->IsOpaque()) {
604+
entity.SetBlendMode(BlendMode::kSource);
605+
}
606+
607+
// If the entity covers the current render target and is a solid color, then
608+
// conditionally update the backdrop color to its solid color value blended
609+
// with the current backdrop.
610+
if (render_passes_.back().IsApplyingClearColor()) {
611+
std::optional<Color> maybe_color =
612+
entity.AsBackgroundColor(render_passes_.back()
613+
.entity_pass_target->GetRenderTarget()
614+
.GetRenderTargetSize());
615+
if (maybe_color.has_value()) {
616+
Color color = maybe_color.value();
617+
RenderTarget& render_target =
618+
render_passes_.back().entity_pass_target->GetRenderTarget();
619+
ColorAttachment attachment =
620+
render_target.GetColorAttachments().find(0u)->second;
621+
attachment.clear_color = attachment.clear_color.Unpremultiply()
622+
.Blend(color, entity.GetBlendMode())
623+
.Premultiply();
624+
render_target.SetColorAttachment(attachment, 0u);
625+
}
626+
}
598627

599-
auto transform = entity.GetTransform();
600-
entity.SetTransform(
601-
Matrix::MakeTranslation(Vector3(-GetGlobalPassPosition())) * transform);
602628
if (!reuse_depth) {
603629
++current_depth_;
604630
}

impeller/aiks/experimental_canvas.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct LazyRenderingConfig {
2222
std::unique_ptr<EntityPassTarget> entity_pass_target;
2323
std::unique_ptr<InlinePassContext> inline_pass_context;
2424

25+
/// Whether or not the clear color texture can still be updated.
26+
bool IsApplyingClearColor() const { return !inline_pass_context->IsActive(); }
27+
2528
LazyRenderingConfig(ContentContext& renderer,
2629
std::unique_ptr<EntityPassTarget> p_entity_pass_target)
2730
: entity_pass_target(std::move(p_entity_pass_target)) {

impeller/display_list/aiks_dl_vertices_unittests.cc

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,5 +354,95 @@ TEST_P(AiksTest, DrawVerticesPremultipliesColors) {
354354
ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
355355
}
356356

357+
// All four vertices should form a solid red rectangle with no gaps.
358+
// The blur rectangle drawn under them should not be visible.
359+
TEST_P(AiksTest, DrawVerticesTextureCoordinatesWithFragmentShader) {
360+
std::vector<SkPoint> positions_lt = {
361+
SkPoint::Make(0, 0), //
362+
SkPoint::Make(50, 0), //
363+
SkPoint::Make(0, 50), //
364+
SkPoint::Make(50, 50), //
365+
};
366+
367+
auto vertices_lt = flutter::DlVertices::Make(
368+
flutter::DlVertexMode::kTriangleStrip, positions_lt.size(),
369+
positions_lt.data(),
370+
/*texture_coordinates=*/positions_lt.data(), /*colors=*/nullptr,
371+
/*index_count=*/0,
372+
/*indices=*/nullptr);
373+
374+
std::vector<SkPoint> positions_rt = {
375+
SkPoint::Make(50, 0), //
376+
SkPoint::Make(100, 0), //
377+
SkPoint::Make(50, 50), //
378+
SkPoint::Make(100, 50), //
379+
};
380+
381+
auto vertices_rt = flutter::DlVertices::Make(
382+
flutter::DlVertexMode::kTriangleStrip, positions_rt.size(),
383+
positions_rt.data(),
384+
/*texture_coordinates=*/positions_rt.data(), /*colors=*/nullptr,
385+
/*index_count=*/0,
386+
/*indices=*/nullptr);
387+
388+
std::vector<SkPoint> positions_lb = {
389+
SkPoint::Make(0, 50), //
390+
SkPoint::Make(50, 50), //
391+
SkPoint::Make(0, 100), //
392+
SkPoint::Make(50, 100), //
393+
};
394+
395+
auto vertices_lb = flutter::DlVertices::Make(
396+
flutter::DlVertexMode::kTriangleStrip, positions_lb.size(),
397+
positions_lb.data(),
398+
/*texture_coordinates=*/positions_lb.data(), /*colors=*/nullptr,
399+
/*index_count=*/0,
400+
/*indices=*/nullptr);
401+
402+
std::vector<SkPoint> positions_rb = {
403+
SkPoint::Make(50, 50), //
404+
SkPoint::Make(100, 50), //
405+
SkPoint::Make(50, 100), //
406+
SkPoint::Make(100, 100), //
407+
};
408+
409+
auto vertices_rb = flutter::DlVertices::Make(
410+
flutter::DlVertexMode::kTriangleStrip, positions_rb.size(),
411+
positions_rb.data(),
412+
/*texture_coordinates=*/positions_rb.data(), /*colors=*/nullptr,
413+
/*index_count=*/0,
414+
/*indices=*/nullptr);
415+
416+
flutter::DisplayListBuilder builder;
417+
flutter::DlPaint paint;
418+
flutter::DlPaint rect_paint;
419+
rect_paint.setColor(DlColor::kBlue());
420+
421+
auto runtime_stages =
422+
OpenAssetAsRuntimeStage("runtime_stage_simple.frag.iplr");
423+
424+
auto runtime_stage =
425+
runtime_stages[PlaygroundBackendToRuntimeStageBackend(GetBackend())];
426+
ASSERT_TRUE(runtime_stage);
427+
428+
auto runtime_effect = DlRuntimeEffect::MakeImpeller(runtime_stage);
429+
auto uniform_data = std::make_shared<std::vector<uint8_t>>();
430+
auto color_source = flutter::DlColorSource::MakeRuntimeEffect(
431+
runtime_effect, {}, uniform_data);
432+
433+
paint.setColorSource(color_source);
434+
435+
builder.Scale(GetContentScale().x, GetContentScale().y);
436+
builder.Save();
437+
builder.DrawRect(SkRect::MakeLTRB(0, 0, 100, 100), rect_paint);
438+
builder.DrawVertices(vertices_lt, flutter::DlBlendMode::kSrcOver, paint);
439+
builder.DrawVertices(vertices_rt, flutter::DlBlendMode::kSrcOver, paint);
440+
builder.DrawVertices(vertices_lb, flutter::DlBlendMode::kSrcOver, paint);
441+
builder.DrawVertices(vertices_rb, flutter::DlBlendMode::kSrcOver, paint);
442+
builder.Restore();
443+
444+
ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
445+
}
446+
357447
} // namespace testing
358448
} // namespace impeller

impeller/entity/contents/vertices_contents.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ void VerticesSimpleBlendContents::SetLazyTexture(
8989
lazy_texture_ = lazy_texture;
9090
}
9191

92+
void VerticesSimpleBlendContents::SetLazyTextureCoverage(Rect rect) {
93+
lazy_texture_coverage_ = rect;
94+
}
95+
9296
bool VerticesSimpleBlendContents::Render(const ContentContext& renderer,
9397
const Entity& entity,
9498
RenderPass& pass) const {
@@ -123,8 +127,8 @@ bool VerticesSimpleBlendContents::Render(const ContentContext& renderer,
123127
dst_sampler_descriptor);
124128

125129
GeometryResult geometry_result = geometry_->GetPositionUVColorBuffer(
126-
(!!texture) ? Rect::MakeSize(texture->GetSize())
127-
: Rect::MakeSize(ISize{1, 1}),
130+
lazy_texture_coverage_.has_value() ? lazy_texture_coverage_.value()
131+
: Rect::MakeSize(texture->GetSize()),
128132
inverse_matrix_, renderer, entity, pass);
129133
if (geometry_result.vertex_buffer.vertex_count == 0) {
130134
return true;

0 commit comments

Comments
 (0)