Commit 9d901327 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Do not call saveLayer for physical model layers whose bounds are simple rectangles (#11324)

This is similar to an optimization done in PhysicalModelLayer::Paint in the engine
parent 48427cb7
......@@ -1364,7 +1364,11 @@ class RenderPhysicalModel extends _RenderCustomClip<RRect> {
);
}
canvas.drawRRect(offsetClipRRect, new Paint()..color = color);
canvas.saveLayer(offsetBounds, _defaultPaint);
if (offsetClipRRect.isRect) {
canvas.save();
} else {
canvas.saveLayer(offsetBounds, _defaultPaint);
}
canvas.clipRRect(offsetClipRRect);
super.paint(context, offset);
canvas.restore();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment