Index: include/core/SkSurface.h |
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h |
index 68d4702cb51d6f9bfdf8b73d01e1f2d5d3221094..cb5133ae003e4d89de0f2f376b749977aee715f4 100644 |
--- a/include/core/SkSurface.h |
+++ b/include/core/SkSurface.h |
@@ -77,18 +77,29 @@ public: |
kDistanceField_TextRenderMode, |
}; |
+ enum RenderTargetFlags { |
+ kNone_RenderTargetFlag = 0x0, |
+ /* |
+ * By default a RenderTarget-based surface will be cleared on creation. |
+ * Pass in this flag to prevent the clear from happening. |
+ */ |
+ kDontClear_RenderTargetFlag = 0x01, |
+ }; |
+ |
/** |
* Return a new surface using the specified render target. |
*/ |
static SkSurface* NewRenderTargetDirect(GrRenderTarget*, |
- TextRenderMode trm = kStandard_TextRenderMode); |
+ TextRenderMode trm = kStandard_TextRenderMode, |
+ RenderTargetFlags flags = kNone_RenderTargetFlag); |
/** |
* Return a new surface whose contents will be drawn to an offscreen |
* render target, allocated by the surface. |
*/ |
static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sampleCount = 0, |
- TextRenderMode trm = kStandard_TextRenderMode); |
+ TextRenderMode trm = kStandard_TextRenderMode, |
+ RenderTargetFlags flags = kNone_RenderTargetFlag); |
/** |
* Return a new surface whose contents will be drawn to an offscreen |
@@ -103,7 +114,8 @@ public: |
* budget. |
*/ |
static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int sampleCount = 0, |
- TextRenderMode trm = kStandard_TextRenderMode); |
+ TextRenderMode trm = kStandard_TextRenderMode, |
+ RenderTargetFlags flags = kNone_RenderTargetFlag); |
int width() const { return fWidth; } |
int height() const { return fHeight; } |