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

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: Update SkBmpCodec to use new ZeroInitialized API. Created 5 years, 9 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 | « src/codec/SkSwizzler.h ('k') | src/core/SkImageGenerator.cpp » ('j') | 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 0668db6db9e45a25091189fa0dff0946f1c64df4..1aa3793f156cd94f0761690280ccdaff2eefe9e3 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -199,7 +199,8 @@ 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,
+ SkImageGenerator::ZeroInitialized zeroInit) {
if (kUnknown_SkColorType == info.colorType()) {
return NULL;
}
@@ -226,7 +227,8 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc,
case kIndex:
switch (info.colorType()) {
case kN32_SkColorType:
- if (skipZeroes) {
+ // We assume the color premultiplied ctable (or not) as desired.
+ if (SkImageGenerator::kYes_ZeroInitialized == zeroInit) {
proc = &swizzle_index_to_n32_skipZ;
} else {
proc = &swizzle_index_to_n32;
@@ -269,10 +271,10 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc,
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 (SkImageGenerator::kYes_ZeroInitialized == zeroInit) {
proc = &swizzle_rgba_to_n32_premul_skipZ;
} else {
proc = &swizzle_rgba_to_n32_premul;
« no previous file with comments | « src/codec/SkSwizzler.h ('k') | src/core/SkImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698