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

Unified Diff: src/core/SkRecordOpts.cpp

Issue 1567063002: Revert[2] of "add backdrop option to SaveLayerRec" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add test and fix for svg-savelayer optimization Created 4 years, 11 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 | « src/core/SkRecordDraw.cpp ('k') | src/core/SkRecorder.cpp » ('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 d1520adf561cdc0066e72bae863bc42a343e7dd4..0121ea54fccfbf0c7ffea83d5fe06dea687e1641 100644
--- a/src/core/SkRecordOpts.cpp
+++ b/src/core/SkRecordOpts.cpp
@@ -177,6 +177,11 @@ struct SaveLayerDrawRestoreNooper {
typedef Pattern<Is<SaveLayer>, IsDraw, Is<Restore>> Match;
bool onMatch(SkRecord* record, Match* match, int begin, int end) {
+ if (match->first<SaveLayer>()->backdrop) {
+ // can't throw away the layer if we have a backdrop
+ return false;
+ }
+
// A SaveLayer's bounds field is just a hint, so we should be free to ignore it.
SkPaint* layerPaint = match->first<SaveLayer>()->paint;
if (nullptr == layerPaint) {
@@ -224,6 +229,11 @@ struct SvgOpacityAndFilterLayerMergePass {
Is<Restore>, Is<Restore>, Is<Restore>> Match;
bool onMatch(SkRecord* record, Match* match, int begin, int end) {
+ if (match->first<SaveLayer>()->backdrop) {
+ // can't throw away the layer if we have a backdrop
+ return false;
+ }
+
SkPaint* opacityPaint = match->first<SaveLayer>()->paint;
if (nullptr == opacityPaint) {
// There wasn't really any point to this SaveLayer at all.
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698