diff options
author | djsollen <djsollen@google.com> | 2014-09-29 08:57:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-29 08:57:50 -0700 |
commit | 47c548a6706cca821f1d0d6489f401bd00e61ab3 (patch) | |
tree | a5619d1a9cdb822f062f6bd66f9bdacdf6b9f5e6 /src | |
parent | b7bac3d015cd1c85343d6c49316bfd942efa3f9f (diff) |
Temp fix for crash when generating 16-bit cache for colorTables.
BUG=skia:2795
R=reed@google.com
Author: djsollen@google.com
Review URL: https://codereview.chromium.org/617443002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkColorTable.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp index 4d0a7950b2..2607f9ae0f 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); } |