Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: include/core/SkSurface.h

Issue 1221853003: Add SkSurface factory for wrapping an FBO in SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix comment Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/image/SkSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkSurface.h
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 5d08ee67d30e6302e4a21e365b38ca8e96a366f3..5860cf22792ba4f6953b96ff841f2884512efaca 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
« no previous file with comments | « no previous file | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698