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

Commit 3899c58

Browse files
author
jonahwilliams
committed
++
1 parent 02b7834 commit 3899c58

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

impeller/aiks/canvas.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ void Canvas::SaveLayer(const Paint& paint,
807807
const std::shared_ptr<ImageFilter>& backdrop_filter,
808808
ContentBoundsPromise bounds_promise,
809809
uint32_t total_content_depth,
810-
bool can_distribute_opacity) {
810+
bool can_distribute_opacity,
811+
bool bounds_from_caller) {
811812
if (can_distribute_opacity && !backdrop_filter &&
812813
Paint::CanApplyOpacityPeephole(paint) &&
813814
bounds_promise != ContentBoundsPromise::kMayClipContents) {

impeller/aiks/canvas.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class Canvas {
7777
const std::shared_ptr<ImageFilter>& backdrop_filter = nullptr,
7878
ContentBoundsPromise bounds_promise = ContentBoundsPromise::kUnknown,
7979
uint32_t total_content_depth = kMaxDepth,
80-
bool can_distribute_opacity = false);
80+
bool can_distribute_opacity = false,
81+
bool bounds_from_caller = false);
8182

8283
virtual bool Restore();
8384

impeller/aiks/experimental_canvas.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ void ExperimentalCanvas::SaveLayer(
306306
const std::shared_ptr<ImageFilter>& backdrop_filter,
307307
ContentBoundsPromise bounds_promise,
308308
uint32_t total_content_depth,
309-
bool can_distribute_opacity) {
309+
bool can_distribute_opacity,
310+
bool bounds_from_caller) {
310311
TRACE_EVENT0("flutter", "Canvas::saveLayer");
311312

312313
if (bounds.has_value() && bounds->IsEmpty()) {
@@ -404,7 +405,7 @@ void ExperimentalCanvas::SaveLayer(
404405
FML_CHECK(clip_coverage_stack_.HasCoverage());
405406
subpass_coverage = coverage_limit;
406407
// Clip tight bounds, even if clip is flooded.
407-
if (bounds.has_value()) {
408+
if (bounds.has_value() && bounds_from_caller) {
408409
subpass_coverage =
409410
coverage_limit.Intersection(bounds.value()).value_or(bounds.value());
410411
}

impeller/aiks/experimental_canvas.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class ExperimentalCanvas : public Canvas {
7171
const std::shared_ptr<ImageFilter>& backdrop_filter,
7272
ContentBoundsPromise bounds_promise,
7373
uint32_t total_content_depth,
74-
bool can_distribute_opacity) override;
74+
bool can_distribute_opacity,
75+
bool bounds_from_caller) override;
7576

7677
bool Restore() override;
7778

impeller/display_list/dl_dispatcher.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,8 @@ void DlDispatcherBase::saveLayer(const SkRect& bounds,
614614

615615
GetCanvas().SaveLayer(paint, impeller_bounds, ToImageFilter(backdrop),
616616
promise, total_content_depth,
617-
options.can_distribute_opacity());
617+
options.can_distribute_opacity(),
618+
options.bounds_from_caller());
618619
}
619620

620621
// |flutter::DlOpReceiver|

0 commit comments

Comments
 (0)