Index: include/core/SkSurface.h |
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h |
index 45262d78e63d3d30351c43ccd22ae3c2442ad0a3..5c3ef209745641b47cb36244f7cea186b6995140 100644 |
--- a/include/core/SkSurface.h |
+++ b/include/core/SkSurface.h |
@@ -108,7 +108,6 @@ public: |
return NewFromBackendTexture(ctx, desc, props); |
} |
- |
/** |
* Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia will not assume |
* ownership of the render target and the client must ensure the render target is valid for the |
@@ -118,6 +117,17 @@ public: |
const SkSurfaceProps*); |
/** |
+ * Used to wrap a pre-existing 3D API texture as a SkSurface. Skia will treat the texture as |
+ * a rendering target only, but unlike NewFromBackendRenderTarget, Skia will manage and own |
+ * the associated render target objects (but not the provided texture). The kRenderTarget flag |
+ * must be set on GrBackendTextureDesc for this to succeed. Skia will not assume ownership |
+ * of the texture and the client must ensure the texture is valid for the lifetime of the |
+ * SkSurface. |
+ */ |
+ static SkSurface* NewFromBackendTextureAsRenderTarget( |
+ GrContext*, const GrBackendTextureDesc&, const SkSurfaceProps*); |
+ |
+ /** |
* Return a new surface whose contents will be drawn to an offscreen |
* render target, allocated by the surface. |
* |
@@ -280,6 +290,11 @@ public: |
const SkSurfaceProps& props() const { return fProps; } |
+ /** |
+ * Issue any pending surface IO to the current backend 3D API and resolve any surface MSAA. |
+ */ |
+ void prepareForExternalIO(); |
+ |
protected: |
SkSurface(int width, int height, const SkSurfaceProps*); |
SkSurface(const SkImageInfo&, const SkSurfaceProps*); |