aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-14 20:27:56 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-14 20:27:56 +0000
commitee7e23d13f5400716715c1823ad6e41d9a5904ca (patch)
tree5737db228a342ec9afdc7c57e267b3615a0de1aa
parentd6dcacd4fe0ef668e3c7f07b4a3709249efd3585 (diff)
Effects on the paint also prevent layer merge optimization.
BUG=skia: R=robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/287953002 git-svn-id: http://skia.googlecode.com/svn/trunk@14743 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/core/SkPictureRecord.cpp2
-rw-r--r--src/record/SkRecordOpts.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 4a5aff2d72..36b0763e9f 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -427,7 +427,7 @@ static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer,
SkColor layerColor = saveLayerPaint->getColor() | 0xFF000000; // force opaque
SkAutoTDelete<SkPaint> dbmPaint(paintDict->unflatten(dbmPaintId));
- if (NULL == dbmPaint.get() || dbmPaint->getColor() != layerColor) {
+ if (NULL == dbmPaint.get() || dbmPaint->getColor() != layerColor || !is_simple(*dbmPaint)) {
return false;
}
diff --git a/src/record/SkRecordOpts.cpp b/src/record/SkRecordOpts.cpp
index a0bce2356a..75f7c62605 100644
--- a/src/record/SkRecordOpts.cpp
+++ b/src/record/SkRecordOpts.cpp
@@ -131,7 +131,8 @@ struct SaveLayerDrawRestoreNooper {
const uint32_t layerColor = layerPaint->getColor();
const uint32_t drawColor = drawPaint->getColor();
- if (!IsOnlyAlpha(layerColor) || !IsOpaque(drawColor) || HasAnyEffect(*layerPaint)) {
+ if (!IsOnlyAlpha(layerColor) || !IsOpaque(drawColor) ||
+ HasAnyEffect(*layerPaint) || HasAnyEffect(*drawPaint)) {
// Too fancy for us. Actually, as long as layerColor is just an alpha
// we can blend it into drawColor's alpha; drawColor doesn't strictly have to be opaque.
return false;