Index: src/core/SkRecordOpts.cpp |
diff --git a/src/core/SkRecordOpts.cpp b/src/core/SkRecordOpts.cpp |
index 3302d0cb4d8dab2d44bc6f574658660d8e6aa590..47718e102c85ea1c4e5e8bb627eb288c0a5ddab1 100644 |
--- a/src/core/SkRecordOpts.cpp |
+++ b/src/core/SkRecordOpts.cpp |
@@ -55,8 +55,10 @@ struct SaveOnlyDrawsRestoreNooper { |
// Turns logical no-op Save-[non-drawing command]*-Restore patterns into actual no-ops. |
struct SaveNoDrawsRestoreNooper { |
// Star matches greedily, so we also have to exclude Save and Restore. |
+ // Nested SaveLayers need to be excluded, or we'll match their Restore! |
typedef Pattern3<Is<Save>, |
- Star<Not<Or3<Is<Save>, |
+ Star<Not<Or4<Is<Save>, |
+ Is<SaveLayer>, |
Is<Restore>, |
IsDraw> > >, |
Is<Restore> > |