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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user