Index: src/image/SkImage_Raster.cpp |
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp |
index 24b971ad8491be40a909106a70895a138598c2b0..a06cca6e9bb4e86ce0b4b5a2b15414e000be3da8 100644 |
--- a/src/image/SkImage_Raster.cpp |
+++ b/src/image/SkImage_Raster.cpp |
@@ -131,12 +131,14 @@ SkShader* SkImage_Raster::onNewShader(SkShader::TileMode tileX, SkShader::TileMo |
} |
void SkImage_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const { |
- canvas->drawBitmap(fBitmap, x, y, paint); |
+ SkBitmap shallowCopy(fBitmap); |
+ canvas->drawBitmap(shallowCopy, x, y, paint); |
} |
void SkImage_Raster::onDrawRect(SkCanvas* canvas, const SkRect* src, const SkRect& dst, |
const SkPaint* paint) const { |
- canvas->drawBitmapRectToRect(fBitmap, src, dst, paint); |
+ SkBitmap shallowCopy(fBitmap); |
+ canvas->drawBitmapRectToRect(shallowCopy, src, dst, paint); |
} |
SkSurface* SkImage_Raster::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) const { |
@@ -145,7 +147,8 @@ SkSurface* SkImage_Raster::onNewSurface(const SkImageInfo& info, const SkSurface |
bool SkImage_Raster::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, |
int srcX, int srcY) const { |
- return fBitmap.readPixels(dstInfo, dstPixels, dstRowBytes, srcX, srcY); |
+ SkBitmap shallowCopy(fBitmap); |
+ return shallowCopy.readPixels(dstInfo, dstPixels, dstRowBytes, srcX, srcY); |
} |
const void* SkImage_Raster::onPeekPixels(SkImageInfo* infoPtr, size_t* rowBytesPtr) const { |