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

Side by Side Diff: src/record/SkRecordOpts.cpp

Issue 287953002: Effects on the paint also prevent layer merge optimization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkRecordOpts.h" 8 #include "SkRecordOpts.h"
9 9
10 #include "SkRecordPattern.h" 10 #include "SkRecordPattern.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 SkPaint* drawPaint = pattern->second<SkPaint>(); 125 SkPaint* drawPaint = pattern->second<SkPaint>();
126 if (drawPaint == NULL) { 126 if (drawPaint == NULL) {
127 // We can just give the draw the SaveLayer's paint. 127 // We can just give the draw the SaveLayer's paint.
128 // TODO(mtklein): figure out how to do this clearly 128 // TODO(mtklein): figure out how to do this clearly
129 return false; 129 return false;
130 } 130 }
131 131
132 const uint32_t layerColor = layerPaint->getColor(); 132 const uint32_t layerColor = layerPaint->getColor();
133 const uint32_t drawColor = drawPaint->getColor(); 133 const uint32_t drawColor = drawPaint->getColor();
134 if (!IsOnlyAlpha(layerColor) || !IsOpaque(drawColor) || HasAnyEffect(*la yerPaint)) { 134 if (!IsOnlyAlpha(layerColor) || !IsOpaque(drawColor) ||
135 HasAnyEffect(*layerPaint) || HasAnyEffect(*drawPaint)) {
135 // Too fancy for us. Actually, as long as layerColor is just an alp ha 136 // Too fancy for us. Actually, as long as layerColor is just an alp ha
136 // we can blend it into drawColor's alpha; drawColor doesn't strictl y have to be opaque. 137 // we can blend it into drawColor's alpha; drawColor doesn't strictl y have to be opaque.
137 return false; 138 return false;
138 } 139 }
139 140
140 drawPaint->setColor(SkColorSetA(drawColor, SkColorGetA(layerColor))); 141 drawPaint->setColor(SkColorSetA(drawColor, SkColorGetA(layerColor)));
141 return KillSaveLayerAndRestore(record, begin); 142 return KillSaveLayerAndRestore(record, begin);
142 } 143 }
143 144
144 static bool KillSaveLayerAndRestore(SkRecord* record, unsigned saveLayerInde x) { 145 static bool KillSaveLayerAndRestore(SkRecord* record, unsigned saveLayerInde x) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 }; 294 };
294 295
295 SkTDArray<Pair> fPushStack; 296 SkTDArray<Pair> fPushStack;
296 SkRecord* fRecord; 297 SkRecord* fRecord;
297 unsigned fIndex; 298 unsigned fIndex;
298 }; 299 };
299 void SkRecordAnnotateCullingPairs(SkRecord* record) { 300 void SkRecordAnnotateCullingPairs(SkRecord* record) {
300 CullAnnotator pass; 301 CullAnnotator pass;
301 pass.apply(record); 302 pass.apply(record);
302 } 303 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698