| 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 | 8 |
| 9 #ifndef GrSurface_DEFINED | 9 #ifndef GrSurface_DEFINED |
| 10 #define GrSurface_DEFINED | 10 #define GrSurface_DEFINED |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 * Retrieves the pixel config specified when the surface was created. | 51 * Retrieves the pixel config specified when the surface was created. |
| 52 * For render targets this can be kUnknown_GrPixelConfig | 52 * For render targets this can be kUnknown_GrPixelConfig |
| 53 * if client asked us to render to a target that has a pixel | 53 * if client asked us to render to a target that has a pixel |
| 54 * config that isn't equivalent with one of our configs. | 54 * config that isn't equivalent with one of our configs. |
| 55 */ | 55 */ |
| 56 GrPixelConfig config() const { return fDesc.fConfig; } | 56 GrPixelConfig config() const { return fDesc.fConfig; } |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Return the descriptor describing the surface | 59 * Return the descriptor describing the surface |
| 60 */ | 60 */ |
| 61 const GrTextureDesc& desc() const { return fDesc; } | 61 const GrSurfaceDesc& desc() const { return fDesc; } |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * @return the texture associated with the surface, may be NULL. | 64 * @return the texture associated with the surface, may be NULL. |
| 65 */ | 65 */ |
| 66 virtual GrTexture* asTexture() = 0; | 66 virtual GrTexture* asTexture() = 0; |
| 67 virtual const GrTexture* asTexture() const = 0; | 67 virtual const GrTexture* asTexture() const = 0; |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * @return the render target underlying this surface, may be NULL. | 70 * @return the render target underlying this surface, may be NULL. |
| 71 */ | 71 */ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 SkImageInfo info() const; | 129 SkImageInfo info() const; |
| 130 bool savePixels(const char* filename); | 130 bool savePixels(const char* filename); |
| 131 bool hasPendingRead() const; | 131 bool hasPendingRead() const; |
| 132 bool hasPendingWrite() const; | 132 bool hasPendingWrite() const; |
| 133 bool hasPendingIO() const; | 133 bool hasPendingIO() const; |
| 134 bool isSameAs(const GrSurface* other) const; | 134 bool isSameAs(const GrSurface* other) const; |
| 135 | 135 |
| 136 // Provides access to methods that should be public within Skia code. | 136 // Provides access to methods that should be public within Skia code. |
| 137 friend class GrSurfacePriv; | 137 friend class GrSurfacePriv; |
| 138 | 138 |
| 139 GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) | 139 GrSurface(GrGpu* gpu, bool isWrapped, const GrSurfaceDesc& desc) |
| 140 : INHERITED(gpu, isWrapped) | 140 : INHERITED(gpu, isWrapped) |
| 141 , fDesc(desc) { | 141 , fDesc(desc) { |
| 142 } | 142 } |
| 143 | 143 |
| 144 GrTextureDesc fDesc; | 144 GrSurfaceDesc fDesc; |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 typedef GrGpuResource INHERITED; | 147 typedef GrGpuResource INHERITED; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 #endif | 150 #endif |
| OLD | NEW |