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. | |
126 */ | 123 */ |
127 static SkSurface* NewRenderTarget( | 124 static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&,
int sampleCount, |
128 GrContext*, Budgeted, const SkImageInfo&, int sampleCount, const SkS
urfaceProps* = NULL, | 125 const SkSurfaceProps* = NULL); |
129 GrTextureStorageAllocator = GrTextureStorageAllocator()); | |
130 | 126 |
131 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn
fo& info) { | 127 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn
fo& info) { |
132 return NewRenderTarget(gr, b, info, 0); | 128 return NewRenderTarget(gr, b, info, 0, NULL); |
133 } | 129 } |
134 | 130 |
135 int width() const { return fWidth; } | 131 int width() const { return fWidth; } |
136 int height() const { return fHeight; } | 132 int height() const { return fHeight; } |
137 | 133 |
138 /** | 134 /** |
139 * Returns a unique non-zero, unique value identifying the content of this | 135 * Returns a unique non-zero, unique value identifying the content of this |
140 * surface. Each time the content is changed changed, either by drawing | 136 * surface. Each time the content is changed changed, either by drawing |
141 * into this surface, or explicitly calling notifyContentChanged()) this | 137 * into this surface, or explicitly calling notifyContentChanged()) this |
142 * method will return a new value. | 138 * method will return a new value. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 private: | 288 private: |
293 const SkSurfaceProps fProps; | 289 const SkSurfaceProps fProps; |
294 const int fWidth; | 290 const int fWidth; |
295 const int fHeight; | 291 const int fHeight; |
296 uint32_t fGenerationID; | 292 uint32_t fGenerationID; |
297 | 293 |
298 typedef SkRefCnt INHERITED; | 294 typedef SkRefCnt INHERITED; |
299 }; | 295 }; |
300 | 296 |
301 #endif | 297 #endif |
OLD | NEW |