Symptom: draw Index8 to RGB565 will using SkColorTable::lock16BitCache and return a null array.
Root Cause:lock16BitCache return null pointer because default type is kPremul_SkAlphaType
Solution: WBMP color table should be kOpaque_SkAlphaType
Reproduce steps: draw a WBMP with a matrix that apply rotate and transform
This patch was proposed by arthur_hung at htc.com to the AOSP project.
R=reed@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/
377443007
}
const SkPMColor colors[] = { SK_ColorBLACK, SK_ColorWHITE };
- SkColorTable* ct = SkNEW_ARGS(SkColorTable, (colors, 2));
+ SkColorTable* ct = SkNEW_ARGS(SkColorTable, (colors, 2, kOpaque_SkAlphaType));
SkAutoUnref aur(ct);
if (!this->allocPixelRef(decodedBitmap, ct)) {