Index: src/core/SkBitmap.cpp |
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp |
index a7615bd55c03debd259224faa1371f0080a0348e..f950e28cdccb2ca6b3a8a57ee9dc387621172f16 100644 |
--- a/src/core/SkBitmap.cpp |
+++ b/src/core/SkBitmap.cpp |
@@ -993,8 +993,8 @@ |
// did we get lucky and we can just return tmpSrc? |
if (tmpSrc.config() == dstConfig && NULL == alloc) { |
dst->swap(tmpSrc); |
- // If the result is an exact copy, clone the gen ID. |
- if (dst->pixelRef() && dst->pixelRef()->info() == fPixelRef->info()) { |
+ if (dst->pixelRef() && this->config() == dstConfig) { |
+ // TODO(scroggo): fix issue 1742 |
dst->pixelRef()->cloneGenID(*fPixelRef); |
} |
return true; |
@@ -1010,9 +1010,6 @@ |
if (!src->readyToDraw()) { |
return false; |
} |
- |
- // The only way to be readyToDraw is if fPixelRef is non NULL. |
- SkASSERT(fPixelRef != NULL); |
SkBitmap tmpDst; |
tmpDst.setConfig(dstConfig, src->width(), src->height(), 0, |
@@ -1031,25 +1028,14 @@ |
return false; |
} |
- // pixelRef must be non NULL or tmpDst.readyToDraw() would have |
- // returned false. |
- SkASSERT(tmpDst.pixelRef() != NULL); |
- |
/* do memcpy for the same configs cases, else use drawing |
*/ |
if (src->config() == dstConfig) { |
if (tmpDst.getSize() == src->getSize()) { |
memcpy(tmpDst.getPixels(), src->getPixels(), src->getSafeSize()); |
SkPixelRef* pixelRef = tmpDst.pixelRef(); |
- |
- // In order to reach this point, we know that the width, config and |
- // rowbytes of the SkPixelRefs are the same, but it is possible for |
- // the heights to differ, if this SkBitmap's height is a subset of |
- // fPixelRef. Only if the SkPixelRefs' heights match are we |
- // guaranteed that this is an exact copy, meaning we should clone |
- // the genID. |
- if (pixelRef->info().fHeight == fPixelRef->info().fHeight) { |
- SkASSERT(pixelRef->info() == fPixelRef->info()); |
+ if (NULL != pixelRef && NULL != fPixelRef) { |
+ // TODO(scroggo): fix issue 1742 |
pixelRef->cloneGenID(*fPixelRef); |
} |
} else { |
@@ -1104,9 +1090,7 @@ |
if (pixelRef) { |
uint32_t rowBytes; |
if (dstConfig == fConfig) { |
- // Since there is no subset to pass to deepCopy, and deepCopy |
- // succeeded, the new pixel ref must be identical. |
- SkASSERT(fPixelRef->info() == pixelRef->info()); |
+ // TODO(scroggo): fix issue 1742 |
pixelRef->cloneGenID(*fPixelRef); |
// Use the same rowBytes as the original. |
rowBytes = fRowBytes; |