diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-05 18:06:14 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-05 18:06:14 +0000 |
commit | 6b392b6111fad269437517494b14be484cd762f6 (patch) | |
tree | 2b39dd25e8f4de4fc7a2be66651f60b7fd6595ff /src/core/SkPaintPriv.cpp | |
parent | 7066bf3fbff7a54d3692414ec11ca419f3fd0ad5 (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
R=bsalomon@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/266203003
git-svn-id: http://skia.googlecode.com/svn/trunk@14571 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPaintPriv.cpp')
-rw-r--r-- | src/core/SkPaintPriv.cpp | 21 |
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(); +} + |