Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: src/core/SkRecordOpts.cpp

Issue 560163002: Fix a bug in Save-Restore no-op optimization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: d Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkRecordPattern.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> >
« no previous file with comments | « no previous file | src/core/SkRecordPattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698