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

Unified Diff: src/core/SkBitmap.cpp

Issue 26572006: Revert "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 128726cb63d9198477afd698e377c6ee02cef6ed..561f747b772336b1e4013dbe94ccc5ef3dc12fd2 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -536,16 +536,12 @@ bool SkBitmap::isOpaque() const {
return (fFlags & kImageIsOpaque_Flag) != 0;
case kIndex8_Config: {
- uint32_t flags = 0;
+ bool isOpaque;
this->lockPixels();
- // if lockPixels failed, we may not have a ctable ptr
- if (fColorTable) {
- flags = fColorTable->getFlags();
- }
+ isOpaque = fColorTable && fColorTable->isOpaque();
this->unlockPixels();
-
- return (flags & SkColorTable::kColorsAreOpaque_Flag) != 0;
+ return isOpaque;
}
case kRGB_565_Config:
@@ -1494,7 +1490,7 @@ static bool GetBitmapAlpha(const SkBitmap& src, uint8_t* SK_RESTRICT alpha,
s += rb;
alpha += alphaRowBytes;
}
- ct->unlockColors(false);
+ ct->unlockColors();
}
} 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