aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkSurface.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-01-30 10:01:06 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-30 10:01:06 -0800
commit9cd016e9b63f3827580d5b19a187dbf26b8e1436 (patch)
treea3e33dbff8b8f3197d167505a34b6da1b5e31bf3 /include/core/SkSurface.h
parentae658e15477df86d1a864feb48d0274af2784f40 (diff)
allow the caller to specified raster-surface rowbytes.
along the way, simplify how we copy the surface's bitmap BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643873002 Review URL: https://codereview.chromium.org/1643873002
Diffstat (limited to 'include/core/SkSurface.h')
-rw-r--r--include/core/SkSurface.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 57527ed33a..52097be66e 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -61,12 +61,19 @@ public:
void* context, const SkSurfaceProps* = NULL);
/**
- * Return a new surface, with the memory for the pixels automatically
- * allocated.
+ * Return a new surface, with the memory for the pixels automatically allocated, but respecting
+ * the specified rowBytes. If rowBytes==0, then a default value will be chosen. If a non-zero
+ * rowBytes is specified, then any images snapped off of this surface (via newImageSnapshot())
+ * are guaranteed to have the same rowBytes.
*
* If the requested surface cannot be created, or the request is not a
* supported configuration, NULL will be returned.
*/
+ static SkSurface* NewRaster(const SkImageInfo&, size_t rowBytes, const SkSurfaceProps*);
+
+ /**
+ * Allocate a new surface, automatically computing the rowBytes.
+ */
static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL);
/**