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
This commit is contained in:
Jason Simmons 2017-07-20 17:06:57 -07:00 committed by GitHub
parent 48427cb77a
commit 9d901327a4

View File

@ -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();