SkEncodedInfo: simplify
authorhalcanary <halcanary@google.com>
Tue, 31 May 2016 17:57:36 +0000 (10:57 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 31 May 2016 17:57:36 +0000 (10:57 -0700)
No public API change.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2025713003

Review-Url: https://codereview.chromium.org/2025713003

include/codec/SkEncodedInfo.h
src/codec/SkJpegCodec.cpp

index d35aa2bab4c2fbb928e67a791cd24805cb2dc88e..60ad588edd67c7e059e2ef50500669773b185329 100644 (file)
@@ -191,15 +191,9 @@ private:
         , fBitsPerComponent(bitsPerComponent)
     {}
 
-    void setColor(Color color) {
-        fColor = color;
-    }
-
     Color   fColor;
     Alpha   fAlpha;
     uint8_t fBitsPerComponent;
-
-    friend class SkJpegCodec;
 };
 
 #endif
index 5d24694708ad99fcc8284ee4b18351f2635023ad..85de356118ccda95e314c7b2ec7376100bb6684b 100644 (file)
@@ -526,11 +526,15 @@ void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options&
     switch (fDecoderMgr->dinfo()->out_color_space) {
         case JCS_RGB:
             preSwizzled = false;
-            swizzlerInfo.setColor(SkEncodedInfo::kRGB_Color);
+            swizzlerInfo = SkEncodedInfo::Make(SkEncodedInfo::kRGB_Color,
+                                               swizzlerInfo.alpha(),
+                                               swizzlerInfo.bitsPerComponent());
             break;
         case JCS_CMYK:
             preSwizzled = false;
-            swizzlerInfo.setColor(SkEncodedInfo::kInvertedCMYK_Color);
+            swizzlerInfo = SkEncodedInfo::Make(
+                    SkEncodedInfo::kInvertedCMYK_Color, swizzlerInfo.alpha(),
+                    swizzlerInfo.bitsPerComponent());
             break;
         default:
             break;