Index: src/images/SkImageDecoder_libpng.cpp |
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp |
index 0890eaacaffacf8e4af3af71d38726c493294ba4..8a3e40ea19633b639448d1af73efabcdbd69ec54 100644 |
--- a/src/images/SkImageDecoder_libpng.cpp |
+++ b/src/images/SkImageDecoder_libpng.cpp |
@@ -413,8 +413,8 @@ SkImageDecoder::Result SkPNGImageDecoder::onDecode(SkStream* sk_stream, SkBitmap |
even if our decodedBitmap doesn't, due to the request that we |
upscale png's palette to a direct model |
*/ |
- SkAutoLockColors ctLock(colorTable); |
- if (!sampler.begin(decodedBitmap, sc, *this, ctLock.colors())) { |
+ const SkPMColor* colors = colorTable ? colorTable->readColors() : NULL; |
+ if (!sampler.begin(decodedBitmap, sc, *this, colors)) { |
return kFailure; |
} |
const int height = decodedBitmap->height(); |
@@ -894,8 +894,8 @@ bool SkPNGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) { |
even if our decodedBitmap doesn't, due to the request that we |
upscale png's palette to a direct model |
*/ |
- SkAutoLockColors ctLock(colorTable); |
- if (!sampler.begin(&decodedBitmap, sc, *this, ctLock.colors())) { |
+ const SkPMColor* colors = colorTable ? colorTable->readColors() : NULL; |
+ if (!sampler.begin(&decodedBitmap, sc, *this, colors)) { |
return false; |
} |
const int height = decodedBitmap.height(); |
@@ -1047,8 +1047,7 @@ static int computeBitDepth(int colorCount) { |
static inline int pack_palette(SkColorTable* ctable, |
png_color* SK_RESTRICT palette, |
png_byte* SK_RESTRICT trans, bool hasAlpha) { |
- SkAutoLockColors alc(ctable); |
- const SkPMColor* SK_RESTRICT colors = alc.colors(); |
+ const SkPMColor* SK_RESTRICT colors = ctable ? ctable->readColors() : NULL; |
const int ctCount = ctable->count(); |
int i, num_trans = 0; |