Revert "Revert "Do not return Index8 from SkAndroidCodec::computeOutputColorType""
This reverts commit 81c83a7db4e524b19d33bf7c8a9b537b9d606c93.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Do not return Index8 from SkAndroidCodec::computeOutputColorType"
>
> This reverts commit b6f4767294261dca3beef6f280c4bac69df3f930.
>
> Reason for revert: This breaks CTS tests in Android. Doh.
>
> Original change's description:
> > Do not return Index8 from SkAndroidCodec::computeOutputColorType
> >
> > Given that this is the only known use of Index8 color type,
> > this is essentially an experimental delete.
> >
> > Bug: skia:6620
> > Change-Id: Ib363d237e0217f6e7f461a62e54d32892c428095
> > Reviewed-on: https://skia-review.googlesource.com/10586
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > Commit-Queue: Matt Sarett <msarett@google.com>
>
> TBR=msarett@google.com,scroggo@google.com,reed@google.com
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6620
>
> Change-Id: I2b44c695b8b95659520e9532901f636f56e01e2a
> Reviewed-on: https://skia-review.googlesource.com/19084
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
TBR=msarett@google.com,scroggo@google.com,reviews@skia.org,reed@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:6620
Change-Id: I7e4e3a5ec068102244ad3a0259aa6aded4f12f36
Reviewed-on: https://skia-review.googlesource.com/19802
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 4029524..28b81d2 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -173,6 +173,9 @@
return "Cannot decode (full) region.";
}
alpha8_to_gray8(&bitmap);
+
+ // Verify that we no longer support kIndex8 from this API.
+ SkASSERT(kIndex_8_SkColorType != bitmap.colorType());
canvas->drawBitmap(bitmap, 0, 0);
return "";
}
@@ -229,6 +232,7 @@
}
alpha8_to_gray8(&bitmap);
+ SkASSERT(kIndex_8_SkColorType != bitmap.colorType());
canvas->drawBitmapRect(bitmap,
SkRect::MakeXYWH((SkScalar) scaledBorder, (SkScalar) scaledBorder,
(SkScalar) (subsetWidth / fSampleSize),