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

Unified Diff: include/core/SkSurface.h

Issue 201153023: Adding a new SkSurface factory for generating surfaces from the scratch texture pool. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: build/typo fix Created 6 years, 9 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/GrContext.h » ('j') | src/gpu/SkGpuDevice.cpp » ('J')
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 8e430d8f47d2d0cfa6e626678d1b29b55cfa8a5b..f5052ca10c41d3343451990fce6c60864f02e587 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -73,6 +73,20 @@ public:
*/
static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sampleCount = 0);
+ /**
+ * Return a new surface whose contents will be drawn to an offscreen
+ * render target, allocated by the surface from the scratch texture pool
+ * managed by the GrContext. The scratch texture pool serves the purpose
+ * of retaining textures after they are no longer in use in order to
+ * re-use them later without having to re-allocate. Scratch textures
+ * should be used in cases where high turnover is expected. This allows,
+ * for example, the copy on write to recycle a texture from a recently
+ * released SkImage snapshot of the surface.
+ * Note: Scratch textures count against the GrContext's cached resource
+ * budget.
+ */
+ static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int sampleCount = 0);
+
int width() const { return fWidth; }
int height() const { return fHeight; }
« no previous file with comments | « no previous file | include/gpu/GrContext.h » ('j') | src/gpu/SkGpuDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698