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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "SkScaledBitmapSampler.h" 9 #include "SkScaledBitmapSampler.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (c != 0) { 389 if (c != 0) {
390 dst[x] = c; 390 dst[x] = c;
391 } 391 }
392 src += deltaSrc; 392 src += deltaSrc;
393 } 393 }
394 return cc != A32_MASK_IN_PLACE; 394 return cc != A32_MASK_IN_PLACE;
395 } 395 }
396 396
397 static SkScaledBitmapSampler::RowProc 397 static SkScaledBitmapSampler::RowProc
398 get_index_to_8888_proc(const SkScaledBitmapSampler::Options& opts) { 398 get_index_to_8888_proc(const SkScaledBitmapSampler::Options& opts) {
399 if (!opts.fPremultiplyAlpha) { 399 // The caller is expected to have created the source colortable
400 // Unpremultiplied is not supported for an index source. 400 // properly with respect to premultiplication, so premul makes
reed1 2014/10/24 14:28:54 s/premultiplication/opts.fPremultiplyAlpha
scroggo 2014/10/27 15:07:21 Done.
401 return NULL; 401 // no difference here.
402 }
403 // Dither makes no difference 402 // Dither makes no difference
404 if (opts.fSkipZeros) { 403 if (opts.fSkipZeros) {
405 return Sample_Index_D8888_SkipZ; 404 return Sample_Index_D8888_SkipZ;
406 } 405 }
407 return Sample_Index_D8888; 406 return Sample_Index_D8888;
408 } 407 }
409 408
410 static bool Sample_Index_D565(void* SK_RESTRICT dstRow, 409 static bool Sample_Index_D565(void* SK_RESTRICT dstRow,
411 const uint8_t* SK_RESTRICT src, 410 const uint8_t* SK_RESTRICT src,
412 int width, int deltaSrc, int, const SkPMColor ctable[]) { 411 int width, int deltaSrc, int, const SkPMColor ctable[]) {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 SkScaledBitmapSampler::RowProc actual = RowProcTester::getRo wProc(sampler); 866 SkScaledBitmapSampler::RowProc actual = RowProcTester::getRo wProc(sampler);
868 SkASSERT(expected == actual); 867 SkASSERT(expected == actual);
869 procCounter++; 868 procCounter++;
870 } 869 }
871 } 870 }
872 } 871 }
873 } 872 }
874 SkASSERT(SK_ARRAY_COUNT(gTestProcs) == procCounter); 873 SkASSERT(SK_ARRAY_COUNT(gTestProcs) == procCounter);
875 } 874 }
876 #endif // SK_DEBUG 875 #endif // SK_DEBUG
OLDNEW
« 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