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

Unified Diff: src/images/SkImageDecoder_libpng.cpp

Issue 719213008: SkColorTable locking serves no purpose anymore. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: oops Created 6 years 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 | « src/images/SkImageDecoder_libjpeg.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/images/SkImageDecoder_libjpeg.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698