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

Unified Diff: include/core/SkSurface.h

Issue 1709163003: Add wrapBackendTextureAsRenderTarget API (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix test Created 4 years, 10 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 | include/gpu/GrTextureProvider.h » ('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 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*);
« no previous file with comments | « no previous file | include/gpu/GrTextureProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698