Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: src/android/SkBitmapRegionCanvas.cpp

Issue 1513023002: Make BitmapRegionDecoder succeed on invalid requests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/android/SkBitmapRegionCanvas.h ('k') | src/android/SkBitmapRegionCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/android/SkBitmapRegionCanvas.cpp
diff --git a/src/android/SkBitmapRegionCanvas.cpp b/src/android/SkBitmapRegionCanvas.cpp
index bac5dc1ffc7995fa57cb954f5db2987cf99a71c1..c7c42bd9a25c0bfa759178e9c3b04e6dad0bfff8 100644
--- a/src/android/SkBitmapRegionCanvas.cpp
+++ b/src/android/SkBitmapRegionCanvas.cpp
@@ -18,6 +18,7 @@ SkBitmapRegionCanvas::SkBitmapRegionCanvas(SkCodec* decoder)
bool SkBitmapRegionCanvas::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocator,
const SkIRect& desiredSubset, int sampleSize, SkColorType dstColorType,
bool requireUnpremul) {
+
// 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 +35,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;
« no previous file with comments | « src/android/SkBitmapRegionCanvas.h ('k') | src/android/SkBitmapRegionCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698