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
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 4a5aff2..36b0763 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -427,7 +427,7 @@
     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 a0bce23..75f7c62 100644
--- a/src/record/SkRecordOpts.cpp
+++ b/src/record/SkRecordOpts.cpp
@@ -131,7 +131,8 @@
 
         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;