Index: include/core/SkSurface.h |
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h |
index a71327735801507e86f7746ab9b89c1a1b060314..663cea08755758d4a9dd2f8e7d5100749084b7b7 100644 |
--- a/include/core/SkSurface.h |
+++ b/include/core/SkSurface.h |
@@ -47,6 +47,18 @@ public: |
static SkSurface* NewRaster(const SkImage::Info&); |
/** |
+ * Helper version of NewRaster. It creates a SkImage::Info with the |
+ * specified width and height, and populates the rest of info to match |
+ * pixels in SkPMColor format. |
+ */ |
+ static SkSurface* NewRasterPMColor(int width, int height) { |
+ SkImage::Info info = { |
+ width, height, SkImage::kPMColor_ColorType, SkImage::kPremul_AlphaType |
+ }; |
+ return NewRaster(info); |
+ } |
+ |
+ /** |
* Return a new surface whose contents will be recorded into a picture. |
* When this surface is drawn into another canvas, its contents will be |
* "replayed" into that canvas. |