Remove SkCodec::fSrcInfo
This object is now redundant with fEncodedInfo. It holds an
SkColorSpace, which is never used now that SkCodec uses skcms.
SkCodec::getInfo() no longer returns a reference, but creates an
SkImageInfo from the SkEncodedInfo the same way fSrcInfo was
previously created.
Add SkCodec::bounds() and ::dimensions() to replace calling these
methods on getInfo().
Remove srcInfo from SkMaskSwizzler::Create, which just wants to know
whether the src is opaque.
Remove the srcColorType from conversionSupported. Only the base class
version used it. Make it look at fEncodedInfo.color() instead.
Bug: skia:6839
Bug: chromium:887372
Change-Id: I2c0583cae76121211c1a6b49979972fa86daf077
Reviewed-on: https://skia-review.googlesource.com/c/157563
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/codec/SkMaskSwizzler.cpp b/src/codec/SkMaskSwizzler.cpp
index 81e3d6e..eeae007 100644
--- a/src/codec/SkMaskSwizzler.cpp
+++ b/src/codec/SkMaskSwizzler.cpp
@@ -385,7 +385,7 @@
*
*/
SkMaskSwizzler* SkMaskSwizzler::CreateMaskSwizzler(const SkImageInfo& dstInfo,
- const SkImageInfo& srcInfo, SkMasks* masks, uint32_t bitsPerPixel,
+ bool srcIsOpaque, SkMasks* masks, uint32_t bitsPerPixel,
const SkCodec::Options& options) {
// Choose the appropriate row procedure
@@ -394,7 +394,7 @@
case 16:
switch (dstInfo.colorType()) {
case kRGBA_8888_SkColorType:
- if (kOpaque_SkAlphaType == srcInfo.alphaType()) {
+ if (srcIsOpaque) {
proc = &swizzle_mask16_to_rgba_opaque;
} else {
switch (dstInfo.alphaType()) {
@@ -410,7 +410,7 @@
}
break;
case kBGRA_8888_SkColorType:
- if (kOpaque_SkAlphaType == srcInfo.alphaType()) {
+ if (srcIsOpaque) {
proc = &swizzle_mask16_to_bgra_opaque;
} else {
switch (dstInfo.alphaType()) {
@@ -435,7 +435,7 @@
case 24:
switch (dstInfo.colorType()) {
case kRGBA_8888_SkColorType:
- if (kOpaque_SkAlphaType == srcInfo.alphaType()) {
+ if (srcIsOpaque) {
proc = &swizzle_mask24_to_rgba_opaque;
} else {
switch (dstInfo.alphaType()) {
@@ -451,7 +451,7 @@
}
break;
case kBGRA_8888_SkColorType:
- if (kOpaque_SkAlphaType == srcInfo.alphaType()) {
+ if (srcIsOpaque) {
proc = &swizzle_mask24_to_bgra_opaque;
} else {
switch (dstInfo.alphaType()) {
@@ -476,7 +476,7 @@
case 32:
switch (dstInfo.colorType()) {
case kRGBA_8888_SkColorType:
- if (kOpaque_SkAlphaType == srcInfo.alphaType()) {
+ if (srcIsOpaque) {
proc = &swizzle_mask32_to_rgba_opaque;
} else {
switch (dstInfo.alphaType()) {
@@ -492,7 +492,7 @@
}
break;
case kBGRA_8888_SkColorType:
- if (kOpaque_SkAlphaType == srcInfo.alphaType()) {
+ if (srcIsOpaque) {
proc = &swizzle_mask32_to_bgra_opaque;
} else {
switch (dstInfo.alphaType()) {