aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkSurface.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-06-30 12:04:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-30 12:04:40 -0700
commitd3e259a16cf85454f629f5fe75b60b9863c1e138 (patch)
tree7a2af8cd25d321c375274addef9adf9b89006683 /include/core/SkSurface.h
parentc49e8682ab0614e1b6816dadd00f65d770ab6999 (diff)
Add SkSurface factory for wrapping an FBO in SkSurface
Diffstat (limited to 'include/core/SkSurface.h')
-rw-r--r--include/core/SkSurface.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 5d08ee67d3..5860cf2279 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -88,11 +88,27 @@ public:
}
/**
- * Used to wrap a pre-existing backend 3D API texture in a SkSurface. The kRenderTarget flag
- * must be set on GrBackendTextureDesc for this to succeed.
+ * Used to wrap a pre-existing backend 3D API texture as a SkSurface. 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* NewWrappedRenderTarget(GrContext*, GrBackendTextureDesc,
- const SkSurfaceProps*);
+ static SkSurface* NewFromBackendTexture(GrContext*, const GrBackendTextureDesc&,
+ const SkSurfaceProps*);
+ // Legacy alias
+ static SkSurface* NewWrappedRenderTarget(GrContext* ctx, const GrBackendTextureDesc& desc,
+ const SkSurfaceProps* props) {
+ 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
+ * lifetime of the SkSurface.
+ */
+ static SkSurface* NewFromBackendRenderTarget(GrContext*, const GrBackendRenderTargetDesc&,
+ const SkSurfaceProps*);
/**
* Return a new surface whose contents will be drawn to an offscreen