Index: src/core/SkPicture.cpp |
=================================================================== |
--- src/core/SkPicture.cpp (revision 14349) |
+++ src/core/SkPicture.cpp (working copy) |
@@ -122,17 +122,19 @@ |
/////////////////////////////////////////////////////////////////////////////// |
-SkPicture::SkPicture() { |
+SkPicture::SkPicture() |
+ : fAccelData(NULL) |
+ , fContentFlags(0) { |
this->needsNewGenID(); |
fRecord = NULL; |
fPlayback = NULL; |
fWidth = fHeight = 0; |
- fAccelData = NULL; |
} |
SkPicture::SkPicture(const SkPicture& src) |
: INHERITED() |
- , fAccelData(NULL) { |
+ , fAccelData(NULL) |
+ , fContentFlags(src.fContentFlags) { |
this->needsNewGenID(); |
fWidth = src.fWidth; |
fHeight = src.fHeight; |
@@ -207,6 +209,7 @@ |
SkTSwap(fWidth, other.fWidth); |
SkTSwap(fHeight, other.fHeight); |
fPathHeap.swap(&other.fPathHeap); |
+ SkTSwap(fContentFlags, other.fContentFlags); |
} |
SkPicture* SkPicture::clone() const { |
@@ -228,6 +231,7 @@ |
clone->fHeight = fHeight; |
SkSafeSetNull(clone->fRecord); |
SkDELETE(clone->fPlayback); |
+ clone->fContentFlags = fContentFlags; |
/* We want to copy the src's playback. However, if that hasn't been built |
yet, we need to fake a call to endRecording() without actually calling |
@@ -271,6 +275,7 @@ |
} |
SkSafeUnref(fAccelData); |
SkSafeSetNull(fRecord); |
+ fContentFlags = 0; |
this->needsNewGenID(); |
@@ -305,6 +310,7 @@ |
SkSafeUnref(fAccelData); |
SkSafeSetNull(fRecord); |
SkASSERT(NULL == fPathHeap); |
+ fContentFlags = 0; |
this->needsNewGenID(); |
@@ -452,7 +458,8 @@ |
, fRecord(NULL) |
, fWidth(width) |
, fHeight(height) |
- , fAccelData(NULL) { |
+ , fAccelData(NULL) |
+ , fContentFlags(0) { |
this->needsNewGenID(); |
} |
@@ -465,6 +472,8 @@ |
SkPicture* newPict = SkNEW_ARGS(SkPicture, (NULL, info.fWidth, info.fHeight)); |
+ newPict->fContentFlags = info.fFlags & ~SkPictInfo::kAll_Mask; |
+ |
// Check to see if there is a playback to recreate. |
if (stream->readBool()) { |
SkPicturePlayback* playback = SkPicturePlayback::CreateFromStream(newPict, stream, |
@@ -488,6 +497,8 @@ |
SkPicture* newPict = SkNEW_ARGS(SkPicture, (NULL, info.fWidth, info.fHeight)); |
+ newPict->fContentFlags = info.fFlags & ~SkPictInfo::kAll_Mask; |
+ |
// Check to see if there is a playback to recreate. |
if (buffer.readBool()) { |
SkPicturePlayback* playback = SkPicturePlayback::CreateFromBuffer(newPict, buffer, info); |
@@ -511,7 +522,9 @@ |
info->fVersion = CURRENT_PICTURE_VERSION; |
info->fWidth = fWidth; |
info->fHeight = fHeight; |
- info->fFlags = SkPictInfo::kCrossProcess_Flag; |
+ SkASSERT((fContentFlags & SkPictInfo::kAll_Mask) == 0); |
+ |
+ info->fFlags = fContentFlags | SkPictInfo::kCrossProcess_Flag; |
// TODO: remove this flag, since we're always float (now) |
info->fFlags |= SkPictInfo::kScalarIsFloat_Flag; |
@@ -602,8 +615,7 @@ |
#if SK_SUPPORT_GPU |
bool SkPicture::suitableForGpuRasterization(GrContext* context) const { |
- // Stub for now; never veto GPu rasterization. |
- return true; |
+ return !this->getHasPathEffects(); |
} |
#endif |