| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia
will not assume | 113 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia
will not assume |
| 114 * ownership of the render target and the client must ensure the render tar
get is valid for the | 114 * ownership of the render target and the client must ensure the render tar
get is valid for the |
| 115 * lifetime of the SkSurface. | 115 * lifetime of the SkSurface. |
| 116 */ | 116 */ |
| 117 static SkSurface* NewFromBackendRenderTarget(GrContext*, const GrBackendRend
erTargetDesc&, | 117 static SkSurface* NewFromBackendRenderTarget(GrContext*, const GrBackendRend
erTargetDesc&, |
| 118 const SkSurfaceProps*); | 118 const SkSurfaceProps*); |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * Return a new surface whose contents will be drawn to an offscreen | 121 * Return a new surface whose contents will be drawn to an offscreen |
| 122 * render target, allocated by the surface. | 122 * render target, allocated by the surface. |
| 123 * |
| 124 * The GrTextureStorageAllocator will be reused if SkImage snapshots create |
| 125 * additional textures. |
| 123 */ | 126 */ |
| 124 static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&,
int sampleCount, | 127 static SkSurface* NewRenderTarget( |
| 125 const SkSurfaceProps* = NULL); | 128 GrContext*, Budgeted, const SkImageInfo&, int sampleCount, const SkS
urfaceProps* = NULL, |
| 129 GrTextureStorageAllocator = GrTextureStorageAllocator()); |
| 126 | 130 |
| 127 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn
fo& info) { | 131 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn
fo& info) { |
| 128 return NewRenderTarget(gr, b, info, 0, NULL); | 132 return NewRenderTarget(gr, b, info, 0); |
| 129 } | 133 } |
| 130 | 134 |
| 131 int width() const { return fWidth; } | 135 int width() const { return fWidth; } |
| 132 int height() const { return fHeight; } | 136 int height() const { return fHeight; } |
| 133 | 137 |
| 134 /** | 138 /** |
| 135 * Returns a unique non-zero, unique value identifying the content of this | 139 * Returns a unique non-zero, unique value identifying the content of this |
| 136 * surface. Each time the content is changed changed, either by drawing | 140 * surface. Each time the content is changed changed, either by drawing |
| 137 * into this surface, or explicitly calling notifyContentChanged()) this | 141 * into this surface, or explicitly calling notifyContentChanged()) this |
| 138 * method will return a new value. | 142 * method will return a new value. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 private: | 292 private: |
| 289 const SkSurfaceProps fProps; | 293 const SkSurfaceProps fProps; |
| 290 const int fWidth; | 294 const int fWidth; |
| 291 const int fHeight; | 295 const int fHeight; |
| 292 uint32_t fGenerationID; | 296 uint32_t fGenerationID; |
| 293 | 297 |
| 294 typedef SkRefCnt INHERITED; | 298 typedef SkRefCnt INHERITED; |
| 295 }; | 299 }; |
| 296 | 300 |
| 297 #endif | 301 #endif |
| OLD | NEW |