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

Unified Diff: include/images/SkImageDecoder.h

Issue 14567011: Test region decoding in skimage, plus fixes. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Small comment fix. Created 7 years, 8 months 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 | « no previous file | src/images/SkImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/images/SkImageDecoder.h
diff --git a/include/images/SkImageDecoder.h b/include/images/SkImageDecoder.h
index 54176bd9b98261eb191cab19b63baec96c08172a..f6f64e15b3f4a7b657b61e342d0da341f95c2542 100644
--- a/include/images/SkImageDecoder.h
+++ b/include/images/SkImageDecoder.h
@@ -216,13 +216,21 @@ public:
bool buildTileIndex(SkStream*, int *width, int *height);
/**
- * Decode a rectangle region in the image specified by rect.
+ * Decode a rectangle subset in the image.
* The method can only be called after buildTileIndex().
*
* Return true for success.
* Return false if the index is never built or failing in decoding.
*/
- bool decodeRegion(SkBitmap* bitmap, const SkIRect& rect, SkBitmap::Config pref);
+ bool decodeSubset(SkBitmap* bm, const SkIRect& subset, SkBitmap::Config pref);
+
+ /**
+ * @Deprecated
+ * Use decodeSubset instead.
+ */
+ bool decodeRegion(SkBitmap* bitmap, const SkIRect& rect, SkBitmap::Config pref) {
+ return this->decodeSubset(bitmap, rect, pref);
+ }
/** Given a stream, this will try to find an appropriate decoder object.
If none is found, the method returns NULL.
@@ -344,7 +352,7 @@ protected:
// If the decoder wants to support tiled based decoding,
// this method must be overridden. This guy is called by decodeRegion(...)
- virtual bool onDecodeRegion(SkBitmap* bitmap, const SkIRect& rect) {
+ virtual bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) {
return false;
}
@@ -359,10 +367,11 @@ protected:
* @param (dstX, dstY) the upper-left point of the dest bitmap in terms of
* the coordinate in the original bitmap.
* @param (width, height) the width and height of the unsampled dst.
- * @param (srcX, srcY) the upper-left point of the src bitimap in terms of
+ * @param (srcX, srcY) the upper-left point of the src bitmap in terms of
* the coordinate in the original bitmap.
+ * @return bool Whether or not it succeeded.
*/
- void cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize,
+ bool cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize,
int dstX, int dstY, int width, int height,
int srcX, int srcY);
« no previous file with comments | « no previous file | src/images/SkImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698