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/images/SkScaledBitmapSampler.cpp

Issue 657863005: Allow index sources to be unpremul. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix test Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkScaledBitmapSampler.cpp
diff --git a/src/images/SkScaledBitmapSampler.cpp b/src/images/SkScaledBitmapSampler.cpp
index fe425d58b1cab09ac744114a18b8d0184049391a..8bb1bde7c41928d6eeaaff1b534c08624b5e779c 100644
--- a/src/images/SkScaledBitmapSampler.cpp
+++ b/src/images/SkScaledBitmapSampler.cpp
@@ -396,10 +396,9 @@ static bool Sample_Index_D8888_SkipZ(void* SK_RESTRICT dstRow,
static SkScaledBitmapSampler::RowProc
get_index_to_8888_proc(const SkScaledBitmapSampler::Options& opts) {
- if (!opts.fPremultiplyAlpha) {
- // Unpremultiplied is not supported for an index source.
- return NULL;
- }
+ // The caller is expected to have created the source colortable
+ // properly with respect to opts.fPremultiplyAlpha, so premul makes
+ // no difference here.
// Dither makes no difference
if (opts.fSkipZeros) {
return Sample_Index_D8888_SkipZ;
@@ -803,7 +802,7 @@ SkScaledBitmapSampler::RowProc gTestProcs[] = {
Sample_Index_DI, Sample_Index_DI, NULL, NULL, // to Index8
Sample_Index_D565, Sample_Index_D565_D, Sample_Index_D565, Sample_Index_D565_D, // to 565
Sample_Index_D4444, Sample_Index_D4444_D, NULL, NULL, // to 4444
- Sample_Index_D8888, Sample_Index_D8888, NULL, NULL, // to 8888
+ Sample_Index_D8888, Sample_Index_D8888, Sample_Index_D8888, Sample_Index_D8888, // to 8888
// RGB
NULL, NULL, NULL, NULL, // to A8
NULL, NULL, NULL, NULL, // to Index8
« 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