-
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
…bounds
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,6 @@ | |
| 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 }; | ||
|
|
@@ -176,7 +175,14 @@ 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 { FML_DCHECK(false); return false; } | ||
| // This can be removed once we wean the unit tests off of calling it... | ||
| // Unit tests currently fail anyway because the mock PaintContext objects | ||
| // don't have a valid clip set to support the new needs_painting() | ||
| // mechanism, so more work is required... | ||
| bool needs_painting() const { | ||
| FML_LOG(ERROR) << "!!!!! Layer::needs_painting() CALLED !!!!!"; | ||
| return !paint_bounds_.isEmpty(); | ||
| } | ||
|
|
||
| uint64_t unique_id() const { return unique_id_; } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.