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

Unified Diff: src/utils/SkBitmapTransformer.h

Issue 14265010: Make SkSHA1 and SkM5 use common SkDigestHash result type (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: sync_to_r8826 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 | « src/utils/SkBitmapHasher.cpp ('k') | src/utils/SkBitmapTransformer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkBitmapTransformer.h
===================================================================
--- src/utils/SkBitmapTransformer.h (revision 8826)
+++ src/utils/SkBitmapTransformer.h (working copy)
@@ -62,6 +62,13 @@
bool isValid(bool logReason=false) const;
/**
+ * Returns the number of rows in the bitmap.
+ */
+ int numRows() const {
+ return fBitmap.height();
+ }
+
+ /**
* Returns the number of bytes needed to store a single row of the
* bitmap's pixels if converted to pixelFormat.
*/
@@ -96,6 +103,22 @@
*/
bool copyBitmapToPixelBuffer (void *dstBuffer, size_t dstBufferSize) const;
+ /**
+ * Writes a single row of the bitmap into dstBuffer, using the
+ * already-specified pixelFormat. Returns true if successful.
+ *
+ * row is the 0-indexed row number within the bitmap; if the row
+ * specified is outside of the range [0, numRows()-1], then this method
+ * will fail.
+ *
+ * dstBufferSize is the maximum allowable bytes to write into dstBuffer;
+ * if that is not large enough to hold the row, then this
+ * will fail immediately and return false.
+ * We force the caller to pass this in to avoid buffer overruns in
+ * unanticipated cases.
+ */
+ bool copyRowToPixelBuffer (int row, void *dstBuffer, size_t dstBufferSize) const;
+
private:
const SkBitmap& fBitmap;
const PixelFormat fPixelFormat;
« no previous file with comments | « src/utils/SkBitmapHasher.cpp ('k') | src/utils/SkBitmapTransformer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698