Index: tools/SkBitmapRegionCodec.cpp |
diff --git a/tools/SkBitmapRegionCodec.cpp b/tools/SkBitmapRegionCodec.cpp |
index cac99452e0d37bcffdf762063bf9e17c7c0515c5..fe1744fc87ed468eb89dcf41bf3226509e09a9ad 100644 |
--- a/tools/SkBitmapRegionCodec.cpp |
+++ b/tools/SkBitmapRegionCodec.cpp |
@@ -9,6 +9,7 @@ |
#include "SkAndroidCodec.h" |
#include "SkCodecPriv.h" |
#include "SkCodecTools.h" |
+#include "SkPixelRef.h" |
SkBitmapRegionCodec::SkBitmapRegionCodec(SkAndroidCodec* codec) |
: INHERITED(codec->getInfo().width(), codec->getInfo().height()) |
@@ -119,7 +120,9 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBitmap::Allocator* al |
options.fColorPtr = colorPtr; |
options.fColorCount = colorCountPtr; |
void* dst = bitmap->getAddr(scaledOutX, scaledOutY); |
- size_t rowBytes = bitmap->rowBytes(); |
+ // It is important that we use the rowBytes on the pixelRef. |
+ // skbug.com/4538 |
+ size_t rowBytes = bitmap->pixelRef()->rowBytes(); |
scroggo
2015/11/05 20:20:48
Should we update the bitmap so that it matches?
T
msarett
2015/11/05 22:34:59
Done.
Yeah we are fine without this change, but I
|
SkCodec::Result result = fCodec->getAndroidPixels(decodeInfo, dst, rowBytes, &options); |
if (SkCodec::kSuccess != result && SkCodec::kIncompleteInput != result) { |
SkCodecPrintf("Error: Could not get pixels.\n"); |