Skip to content

Commit

Permalink
Redo a fix for cull rect calculation on TransformLayers with a perspe…
Browse files Browse the repository at this point in the history
…ctive transform (flutter#8528)

This was originally implemented in flutter@d217a95
but was not retained when cull rects were removed from the SceneBuilder.

Fixes flutter/flutter#30819
  • Loading branch information
jason-simmons authored Apr 10, 2019
1 parent 0b36d3e commit 36d2135
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flow/layers/transform_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {

SkRect previous_cull_rect = context->cull_rect;
SkMatrix inverse_transform_;
if (transform_.invert(&inverse_transform_)) {
// Perspective projections don't produce rectangles that are useful for
// culling for some reason.
if (!transform_.hasPerspective() && transform_.invert(&inverse_transform_)) {
inverse_transform_.mapRect(&context->cull_rect);
} else {
context->cull_rect = kGiantRect;
Expand Down

0 comments on commit 36d2135

Please sign in to comment.