Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 | |
|
bsalomon
2014/03/19 20:10:43
I'd add something about it counting against the Gr
| |
| 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 */ | |
| 86 static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int sampleCount = 0); | |
| 87 | |
| 76 int width() const { return fWidth; } | 88 int width() const { return fWidth; } |
| 77 int height() const { return fHeight; } | 89 int height() const { return fHeight; } |
| 78 | 90 |
| 79 /** | 91 /** |
| 80 * Returns a unique non-zero, unique value identifying the content of this | 92 * Returns a unique non-zero, unique value identifying the content of this |
| 81 * surface. Each time the content is changed changed, either by drawing | 93 * surface. Each time the content is changed changed, either by drawing |
| 82 * into this surface, or explicitly calling notifyContentChanged()) this | 94 * into this surface, or explicitly calling notifyContentChanged()) this |
| 83 * method will return a new value. | 95 * method will return a new value. |
| 84 * | 96 * |
| 85 * If this surface is empty (i.e. has a zero-dimention), this will return | 97 * 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 Loading... | |
| 171 | 183 |
| 172 private: | 184 private: |
| 173 const int fWidth; | 185 const int fWidth; |
| 174 const int fHeight; | 186 const int fHeight; |
| 175 uint32_t fGenerationID; | 187 uint32_t fGenerationID; |
| 176 | 188 |
| 177 typedef SkRefCnt INHERITED; | 189 typedef SkRefCnt INHERITED; |
| 178 }; | 190 }; |
| 179 | 191 |
| 180 #endif | 192 #endif |
| OLD | NEW |