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

Unified Diff: src/core/SkBitmap.cpp

Issue 26709002: Revert "change SkColorTable to be immutable" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months 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 | « samplecode/SampleTinyBitmap.cpp ('k') | src/core/SkBitmapProcState_procs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 561f747b772336b1e4013dbe94ccc5ef3dc12fd2..128726cb63d9198477afd698e377c6ee02cef6ed 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -536,12 +536,16 @@ bool SkBitmap::isOpaque() const {
return (fFlags & kImageIsOpaque_Flag) != 0;
case kIndex8_Config: {
- bool isOpaque;
+ uint32_t flags = 0;
this->lockPixels();
- isOpaque = fColorTable && fColorTable->isOpaque();
+ // if lockPixels failed, we may not have a ctable ptr
+ if (fColorTable) {
+ flags = fColorTable->getFlags();
+ }
this->unlockPixels();
- return isOpaque;
+
+ return (flags & SkColorTable::kColorsAreOpaque_Flag) != 0;
}
case kRGB_565_Config:
@@ -1490,7 +1494,7 @@ static bool GetBitmapAlpha(const SkBitmap& src, uint8_t* SK_RESTRICT alpha,
s += rb;
alpha += alphaRowBytes;
}
- ct->unlockColors();
+ ct->unlockColors(false);
}
} else { // src is opaque, so just fill alpha[] with 0xFF
memset(alpha, 0xFF, h * alphaRowBytes);
« no previous file with comments | « samplecode/SampleTinyBitmap.cpp ('k') | src/core/SkBitmapProcState_procs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698