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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia will not assume | 106 * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia will not assume |
| 107 * ownership of the render target and the client must ensure the render tar get is valid for the | 107 * ownership of the render target and the client must ensure the render tar get is valid for the |
| 108 * lifetime of the SkSurface. | 108 * lifetime of the SkSurface. |
| 109 */ | 109 */ |
| 110 static SkSurface* NewFromBackendRenderTarget(GrContext*, const GrBackendRend erTargetDesc&, | 110 static SkSurface* NewFromBackendRenderTarget(GrContext*, const GrBackendRend erTargetDesc&, |
| 111 const SkSurfaceProps*); | 111 const SkSurfaceProps*); |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * Return a new surface whose contents will be drawn to an offscreen | 114 * Return a new surface whose contents will be drawn to an offscreen |
| 115 * render target, allocated by the surface. | 115 * render target, allocated by the surface. |
| 116 * | |
| 117 * |customAllocator|, if present, must be an instance of TextureStorageAllo cator. | |
| 116 */ | 118 */ |
| 117 static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int sampleCount, | 119 static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int sampleCount, |
| 118 const SkSurfaceProps* = NULL); | 120 const SkSurfaceProps* = NULL, void* custom Allocator = NULL); |
|
erikchen
2016/01/26 18:36:16
I wasn't sure what type of interface you wanted. I
bsalomon
2016/01/26 22:20:54
Why not just pass GrTextureStorageAllocator* here?
erikchen
2016/01/27 21:55:14
Oops, fixed.
| |
| 119 | 121 |
| 120 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn fo& info) { | 122 static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageIn fo& info) { |
| 121 return NewRenderTarget(gr, b, info, 0, NULL); | 123 return NewRenderTarget(gr, b, info, 0, NULL, NULL); |
| 122 } | 124 } |
| 123 | 125 |
| 124 int width() const { return fWidth; } | 126 int width() const { return fWidth; } |
| 125 int height() const { return fHeight; } | 127 int height() const { return fHeight; } |
| 126 | 128 |
| 127 /** | 129 /** |
| 128 * Returns a unique non-zero, unique value identifying the content of this | 130 * Returns a unique non-zero, unique value identifying the content of this |
| 129 * surface. Each time the content is changed changed, either by drawing | 131 * surface. Each time the content is changed changed, either by drawing |
| 130 * into this surface, or explicitly calling notifyContentChanged()) this | 132 * into this surface, or explicitly calling notifyContentChanged()) this |
| 131 * method will return a new value. | 133 * method will return a new value. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 private: | 283 private: |
| 282 const SkSurfaceProps fProps; | 284 const SkSurfaceProps fProps; |
| 283 const int fWidth; | 285 const int fWidth; |
| 284 const int fHeight; | 286 const int fHeight; |
| 285 uint32_t fGenerationID; | 287 uint32_t fGenerationID; |
| 286 | 288 |
| 287 typedef SkRefCnt INHERITED; | 289 typedef SkRefCnt INHERITED; |
| 288 }; | 290 }; |
| 289 | 291 |
| 290 #endif | 292 #endif |
| OLD | NEW |