aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaintPriv.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-06 12:02:22 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-06 12:02:22 +0000
commit0205aba7d5e8802d2a3ef55d999f5aa41db3adc9 (patch)
treee2abb80e1e6b847a48818ebb995a3b4f4aad2dbb /src/core/SkPaintPriv.cpp
parentc9c5c42bbbe7574f7758f7cb0a4f5666f0253061 (diff)
Infrastructure changes to support pull-saveLayers-forward task
This is split out of (First pass at pre-rendering saveLayers for GPU - https://codereview.chromium.org/261663003/). It mainly: Moves NeedsDeepCopy to somewhere more accessible (so GrPictureUtils.cpp can use it) Moves ComputeAccelDataKey somewhere more accessible (so GPUPicture test can use it) Adds unit test for picture saveLayer analysis (done in EXPERIMENTAL_optimize) Adds new fields to SaveLayerInfo that are needed to pull forward layers Committed: http://code.google.com/p/skia/source/detail?r=14571 R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/266203003 git-svn-id: http://skia.googlecode.com/svn/trunk@14586 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPaintPriv.cpp')
-rw-r--r--src/core/SkPaintPriv.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/SkPaintPriv.cpp b/src/core/SkPaintPriv.cpp
index ce05389019..65fd0e7555 100644
--- a/src/core/SkPaintPriv.cpp
+++ b/src/core/SkPaintPriv.cpp
@@ -76,3 +76,24 @@ bool isPaintOpaque(const SkPaint* paint,
}
return false;
}
+
+bool NeedsDeepCopy(const SkPaint& paint) {
+ /*
+ * These fields are known to be immutable, and so can be shallow-copied
+ *
+ * getTypeface()
+ * getAnnotation()
+ * paint.getColorFilter()
+ * getXfermode()
+ * getPathEffect()
+ * getMaskFilter()
+ */
+
+ return paint.getShader() ||
+#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
+ paint.getRasterizer() ||
+#endif
+ paint.getLooper() || // needs to hide its addLayer...
+ paint.getImageFilter();
+}
+