diff options
author | 2015-06-30 12:04:40 -0700 | |
---|---|---|
committer | 2015-06-30 12:04:40 -0700 | |
commit | d3e259a16cf85454f629f5fe75b60b9863c1e138 (patch) | |
tree | 7a2af8cd25d321c375274addef9adf9b89006683 /include | |
parent | c49e8682ab0614e1b6816dadd00f65d770ab6999 (diff) |
Add SkSurface factory for wrapping an FBO in SkSurface
Review URL: https://codereview.chromium.org/1221853003
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkSurface.h | 24 |
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 |