Skip to content

Commit

Permalink
Remove cullRect calculation on TransformLayers with a perspective tra…
Browse files Browse the repository at this point in the history
…nsform. (flutter#5693)
  • Loading branch information
jonahwilliams authored Jul 9, 2018
1 parent 13d801a commit d217a95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions flow/layers/default_layer_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ DefaultLayerBuilder::~DefaultLayerBuilder() = default;
void DefaultLayerBuilder::PushTransform(const SkMatrix& sk_matrix) {
SkMatrix inverse_sk_matrix;
SkRect cullRect;
if (sk_matrix.invert(&inverse_sk_matrix)) {
// Perspective projections don't produce rectangles that are useful for
// culling for some reason.
if (!sk_matrix.hasPerspective() && sk_matrix.invert(&inverse_sk_matrix)) {
inverse_sk_matrix.mapRect(&cullRect, cull_rects_.top());
} else {
cullRect = kGiantRect;
}

auto layer = std::make_unique<flow::TransformLayer>();
layer->set_transform(sk_matrix);
PushLayer(std::move(layer), cullRect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ - (void)application:(UIApplication*)application

- (BOOL)application:(UIApplication*)application
continueUserActivity:(NSUserActivity*)userActivity
restorationHandler:(void (^)(NSArray*))restorationHandler {
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>>*))restorationHandler {
return [_lifeCycleDelegate application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
Expand Down

0 comments on commit d217a95

Please sign in to comment.