-
Notifications
You must be signed in to change notification settings - Fork 6k
Move layer clip culling to Paint() method to fix child caching #22336
Changes from 1 commit
f68b19d
c1e1049
19a6e6b
fc39170
e9f9c83
54ebbe3
c0b7c3b
5d7faf2
4b6bee8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ | |
| namespace flutter { | ||
|
|
||
| static constexpr SkRect kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F); | ||
| static constexpr SkRect kUnvisitedRect = SkRect::MakeLTRB(-1E9F, -1E9F, -1E9F, -1E9F); | ||
|
|
||
| // This should be an exact copy of the Clip enum in painting.dart. | ||
| enum Clip { none, hardEdge, antiAlias, antiAliasWithSaveLayer }; | ||
|
|
@@ -122,6 +123,10 @@ class Layer { | |
| const RasterCache* raster_cache; | ||
| const bool checkerboard_offscreen_layers; | ||
| const float frame_device_pixel_ratio; | ||
|
|
||
| bool needs_painting(const SkRect& paint_bounds) { | ||
| return !internal_nodes_canvas->quickReject(paint_bounds); | ||
|
||
| } | ||
| }; | ||
|
|
||
| // Calls SkCanvas::saveLayer and restores the layer upon destruction. Also | ||
|
|
@@ -171,7 +176,7 @@ class Layer { | |
| paint_bounds_ = paint_bounds; | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's take this opportunity to add some documentations to As it's context-independent, I wonder if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've been discussing these issues over on the issue page linked above. I think we are pretty much good to go on pre-computing the bounds at scene construction time, but there is still the issue of the shadow bounds depending on device pixel ratio which I think might be a bug. I briefly played with pre-computing the bounds as a variation of this PR, but decided we can do that in a separate operation - the main objective here is to get rid of the pre-mature culling while not breaking anything else. I'll add some comments to paint_bounds().
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated the comments in the recent commit. |
||
| bool needs_painting() const { return !paint_bounds_.isEmpty(); } | ||
| bool needs_painting() const { FML_DCHECK(false); return false; } | ||
flar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| uint64_t unique_id() const { return unique_id_; } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.