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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/gpu/GrContext.h » ('j') | src/gpu/SkGpuDevice.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkSurface_DEFINED 8 #ifndef SkSurface_DEFINED
9 #define SkSurface_DEFINED 9 #define SkSurface_DEFINED
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 * Return a new surface using the specified render target. 66 * Return a new surface using the specified render target.
67 */ 67 */
68 static SkSurface* NewRenderTargetDirect(GrRenderTarget*); 68 static SkSurface* NewRenderTargetDirect(GrRenderTarget*);
69 69
70 /** 70 /**
71 * Return a new surface whose contents will be drawn to an offscreen 71 * Return a new surface whose contents will be drawn to an offscreen
72 * render target, allocated by the surface. 72 * render target, allocated by the surface.
73 */ 73 */
74 static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sample Count = 0); 74 static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sample Count = 0);
75 75
76 /**
77 * Return a new surface whose contents will be drawn to an offscreen
78 * render target, allocated by the surface from the scratch texture pool
79 * managed by the GrContext. The scratch texture pool serves the purpose
80 * of retaining textures after they are no longer in use in order to
81 * re-use them later without having to re-allocate. Scratch textures
82 * should be used in cases where high turnover is expected. This allows,
83 * for example, the copy on write to recycle a texture from a recently
84 * released SkImage snapshot of the surface.
85 * Note: Scratch textures count against the GrContext's cached resource
86 * budget.
87 */
88 static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int sampleCount = 0);
89
76 int width() const { return fWidth; } 90 int width() const { return fWidth; }
77 int height() const { return fHeight; } 91 int height() const { return fHeight; }
78 92
79 /** 93 /**
80 * Returns a unique non-zero, unique value identifying the content of this 94 * Returns a unique non-zero, unique value identifying the content of this
81 * surface. Each time the content is changed changed, either by drawing 95 * surface. Each time the content is changed changed, either by drawing
82 * into this surface, or explicitly calling notifyContentChanged()) this 96 * into this surface, or explicitly calling notifyContentChanged()) this
83 * method will return a new value. 97 * method will return a new value.
84 * 98 *
85 * If this surface is empty (i.e. has a zero-dimention), this will return 99 * If this surface is empty (i.e. has a zero-dimention), this will return
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 185
172 private: 186 private:
173 const int fWidth; 187 const int fWidth;
174 const int fHeight; 188 const int fHeight;
175 uint32_t fGenerationID; 189 uint32_t fGenerationID;
176 190
177 typedef SkRefCnt INHERITED; 191 typedef SkRefCnt INHERITED;
178 }; 192 };
179 193
180 #endif 194 #endif
OLDNEW
« 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