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

Unified Diff: src/core/SkColorTable.cpp

Issue 617443002: Temp fix for crash when generating 16-bit cache for colorTables. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorTable.cpp
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp
index 4d0a7950b294886f10cca13f95a8eaedca7650cd..2607f9ae0f537105966f42e88f9f6bc59bf3fef0 100644
--- a/src/core/SkColorTable.cpp
+++ b/src/core/SkColorTable.cpp
@@ -73,7 +73,10 @@ static inline void build_16bitcache(uint16_t dst[], const SkPMColor src[],
}
const uint16_t* SkColorTable::lock16BitCache() {
- if (this->isOpaque() && NULL == f16BitCache) {
+ // Assert that we're opaque, since our 16-bit cache will be sort of useless
+ // if there is alpha (which we're throwing away)
+ SkASSERT(this->isOpaque());
+ if (NULL == f16BitCache) {
f16BitCache = (uint16_t*)sk_malloc_throw(fCount * sizeof(uint16_t));
build_16bitcache(f16BitCache, fColors, fCount);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698