aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/android/SkBitmapRegionCanvas.h
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-12-11 07:38:50 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-11 07:38:50 -0800
commit9a0e3467da2a61ec81f676c147c21c77de91fccf (patch)
tree34f92186cea75a2af48dc76d3cb0bdf8905d2317 /src/android/SkBitmapRegionCanvas.h
parente804292e805917002cc3d7baa7f967fb20d2c7cb (diff)
Make BitmapRegionDecoder succeed on invalid requests
If the client requests a color type or alpha type that is not supported, we should decode to the default/appropriate color and alpha types to match existing behavior in Android. BUG=skia: Review URL: https://codereview.chromium.org/1513023002
Diffstat (limited to 'src/android/SkBitmapRegionCanvas.h')
-rw-r--r--src/android/SkBitmapRegionCanvas.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/android/SkBitmapRegionCanvas.h b/src/android/SkBitmapRegionCanvas.h
index 2edbf1ff3b..c01f96be3c 100644
--- a/src/android/SkBitmapRegionCanvas.h
+++ b/src/android/SkBitmapRegionCanvas.h
@@ -14,8 +14,16 @@
* an SkCanvas. It uses the scanline decoder to subset the height. It then
* will subset the width and scale by drawing to an SkCanvas.
*/
-// FIXME (msarett): This implementation does not support WEBP, because WEBP
-// does not have a scanline decoder.
+// FIXME: This class works well as a performance/quality comparison for
+// SkBitmapRegionCodec, but it lacks several capabilities that are
+// required by BitmapRegionDecoder in Android.
+// (1) WEBP decodes - because SkWebpCodec does not have a scanline
+// decoder.
+// (2) Decodes to kGray8 and kIndex8.
+// (3) Decodes to kUnpremul.
+// (4) Correcting an invalid dstColorType. For example, if the
+// client requests kRGB_565 for a non-opaque image, rather than
+// fail, we need to go ahead and decode to kN32.
class SkBitmapRegionCanvas : public SkBitmapRegionDecoder {
public: