summaryrefslogtreecommitdiff
path: root/core/SkPicture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/SkPicture.cpp')
-rw-r--r--core/SkPicture.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/core/SkPicture.cpp b/core/SkPicture.cpp
index 3b04906e..68434303 100644
--- a/core/SkPicture.cpp
+++ b/core/SkPicture.cpp
@@ -15,6 +15,7 @@
#include "SkBitmapDevice.h"
#include "SkCanvas.h"
#include "SkChunkAlloc.h"
+#include "SkPaintPriv.h"
#include "SkPicture.h"
#include "SkRegion.h"
#include "SkStream.h"
@@ -217,26 +218,6 @@ SkPicture* SkPicture::clone() const {
return clonedPicture;
}
-static bool needs_deep_copy(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();
-}
-
void SkPicture::clone(SkPicture* pictures, int count) const {
SkPictCopyInfo copyInfo;
SkPictInfo info;
@@ -282,7 +263,7 @@ void SkPicture::clone(SkPicture* pictures, int count) const {
SkDEBUGCODE(int heapSize = SafeCount(fPlayback->fBitmapHeap.get());)
for (int i = 0; i < paintCount; i++) {
- if (needs_deep_copy(fPlayback->fPaints->at(i))) {
+ if (NeedsDeepCopy(fPlayback->fPaints->at(i))) {
copyInfo.paintData[i] =
SkFlatData::Create<SkPaint::FlatteningTraits>(&copyInfo.controller,
fPlayback->fPaints->at(i), 0);