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

Unified Diff: src/codec/SkSwizzler.cpp

Issue 980903002: Option for SkCodec to treat dst as all zeroes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
« include/codec/SkCodec.h ('K') | « src/codec/SkSwizzler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSwizzler.cpp
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index 563933f13a03c16e880c2b8132c7df3657fc4868..87720c9beaae568da3323599e30128c9d753af8a 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -135,7 +135,7 @@ static bool swizzle_rgba_to_n32_unpremul_skipZ(void* SK_RESTRICT dstRow,
SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc, const SkPMColor* ctable,
const SkImageInfo& info, void* dst,
- size_t dstRowBytes, bool skipZeroes) {
+ size_t dstRowBytes, SkCodec::ZeroInitialized zeroInit) {
if (info.colorType() == kUnknown_SkColorType) {
return NULL;
}
@@ -151,7 +151,7 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc, const SkPMColor
switch (info.colorType()) {
case kN32_SkColorType:
// We assume the color premultiplied ctable (or not) as desired.
- if (skipZeroes) {
+ if (SkCodec::kYes_ZeroInitialized == zeroInit) {
proc = &swizzle_index_to_n32_skipZ;
} else {
proc = &swizzle_index_to_n32;
@@ -176,10 +176,10 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc, const SkPMColor
switch (info.colorType()) {
case kN32_SkColorType:
if (info.alphaType() == kUnpremul_SkAlphaType) {
- // Respect skipZeroes?
+ // Respect zeroInit?
proc = &swizzle_rgba_to_n32_unpremul;
} else {
- if (skipZeroes) {
+ if (SkCodec::kYes_ZeroInitialized == zeroInit) {
proc = &swizzle_rgba_to_n32_premul_skipZ;
} else {
proc = &swizzle_rgba_to_n32_premul;
« include/codec/SkCodec.h ('K') | « src/codec/SkSwizzler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698