Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/core/SkBitmap.cpp

Issue 26734003: Proactive SkPixelRef invalidation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: drop the check Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkMessageBus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 05f5208a69bfd62fba985d9f2e54e59d4853bb0d..ef14227ab3d0398d6f32e8beab3e96d457d05021 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -1056,7 +1056,8 @@ bool SkBitmap::copyTo(SkBitmap* dst, Config dstConfig, Allocator* alloc) const {
if (tmpSrc.config() == dstConfig && NULL == alloc) {
dst->swap(tmpSrc);
if (dst->pixelRef() && this->config() == dstConfig) {
- dst->pixelRef()->fGenerationID = fPixelRef->getGenerationID();
+ // TODO(scroggo): fix issue 1742
+ dst->pixelRef()->cloneGenID(*fPixelRef);
}
return true;
}
@@ -1096,8 +1097,9 @@ bool SkBitmap::copyTo(SkBitmap* dst, Config dstConfig, Allocator* alloc) const {
if (tmpDst.getSize() == src->getSize()) {
memcpy(tmpDst.getPixels(), src->getPixels(), src->getSafeSize());
SkPixelRef* pixelRef = tmpDst.pixelRef();
- if (pixelRef != NULL) {
- pixelRef->fGenerationID = this->getGenerationID();
+ if (NULL != pixelRef && NULL != fPixelRef) {
+ // TODO(scroggo): fix issue 1742
+ pixelRef->cloneGenID(*fPixelRef);
}
} else {
const char* srcP = reinterpret_cast<const char*>(src->getPixels());
@@ -1151,7 +1153,8 @@ bool SkBitmap::deepCopyTo(SkBitmap* dst, Config dstConfig) const {
if (pixelRef) {
uint32_t rowBytes;
if (dstConfig == fConfig) {
- pixelRef->fGenerationID = fPixelRef->getGenerationID();
+ // TODO(scroggo): fix issue 1742
+ pixelRef->cloneGenID(*fPixelRef);
// Use the same rowBytes as the original.
rowBytes = fRowBytes;
} else {
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkMessageBus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698