Index: src/android/SkBitmapRegionCanvas.cpp |
diff --git a/src/android/SkBitmapRegionCanvas.cpp b/src/android/SkBitmapRegionCanvas.cpp |
index bac5dc1ffc7995fa57cb954f5db2987cf99a71c1..295a2462c764e77edd6397251f54825c53f1f16c 100644 |
--- a/src/android/SkBitmapRegionCanvas.cpp |
+++ b/src/android/SkBitmapRegionCanvas.cpp |
@@ -18,6 +18,15 @@ SkBitmapRegionCanvas::SkBitmapRegionCanvas(SkCodec* decoder) |
bool SkBitmapRegionCanvas::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocator, |
const SkIRect& desiredSubset, int sampleSize, SkColorType dstColorType, |
bool requireUnpremul) { |
+ // FIXME: This class works well as a performance/quality comparison for |
scroggo
2015/12/09 20:57:31
Maybe this should be in the header?
msarett
2015/12/10 15:19:26
Done.
|
+ // SkBitmapRegionCodec, but it lacks several capabilities that are |
+ // required by BitmapRegionDecoder in Android. |
+ // (1) Decodes to kGray8 and kIndex8. |
+ // (2) Decodes to kUnpremul. |
+ // (3) 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. |
+ |
// Reject color types not supported by this method |
if (kIndex_8_SkColorType == dstColorType || kGray_8_SkColorType == dstColorType) { |
SkCodecPrintf("Error: Color type not supported.\n"); |
@@ -34,8 +43,6 @@ bool SkBitmapRegionCanvas::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* alloca |
dstAlphaType = kPremul_SkAlphaType; |
} |
- // FIXME: Can we add checks and support kIndex8 or unpremultiplied alpha in special cases? |
- |
// Fix the input sampleSize if necessary. |
if (sampleSize < 1) { |
sampleSize = 1; |