| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 GrPixelConfig config, | 109 GrPixelConfig config, |
| 110 const void* buffer, | 110 const void* buffer, |
| 111 size_t rowBytes = 0, | 111 size_t rowBytes = 0, |
| 112 uint32_t pixelOpsFlags = 0); | 112 uint32_t pixelOpsFlags = 0); |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. | 115 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. |
| 116 */ | 116 */ |
| 117 void flushWrites(); | 117 void flushWrites(); |
| 118 | 118 |
| 119 |
| 120 /** |
| 121 * After this returns any pending writes to the surface will be issued to th
e backend 3D API and |
| 122 * if the surface has MSAA it will be resolved. |
| 123 */ |
| 124 void prepareForExternalRead(); |
| 125 |
| 119 /** Access methods that are only to be used within Skia code. */ | 126 /** Access methods that are only to be used within Skia code. */ |
| 120 inline GrSurfacePriv surfacePriv(); | 127 inline GrSurfacePriv surfacePriv(); |
| 121 inline const GrSurfacePriv surfacePriv() const; | 128 inline const GrSurfacePriv surfacePriv() const; |
| 122 | 129 |
| 123 protected: | 130 protected: |
| 124 // Methods made available via GrSurfacePriv | 131 // Methods made available via GrSurfacePriv |
| 125 SkImageInfo info() const; | 132 SkImageInfo info() const; |
| 126 bool savePixels(const char* filename); | 133 bool savePixels(const char* filename); |
| 127 bool hasPendingRead() const; | 134 bool hasPendingRead() const; |
| 128 bool hasPendingWrite() const; | 135 bool hasPendingWrite() const; |
| 129 bool hasPendingIO() const; | 136 bool hasPendingIO() const; |
| 130 bool isSameAs(const GrSurface* other) const; | 137 bool isSameAs(const GrSurface* other) const; |
| 131 | 138 |
| 132 // Provides access to methods that should be public within Skia code. | 139 // Provides access to methods that should be public within Skia code. |
| 133 friend class GrSurfacePriv; | 140 friend class GrSurfacePriv; |
| 134 | 141 |
| 135 GrSurface(GrGpu* gpu, bool isWrapped, const GrSurfaceDesc& desc) | 142 GrSurface(GrGpu* gpu, bool isWrapped, const GrSurfaceDesc& desc) |
| 136 : INHERITED(gpu, isWrapped) | 143 : INHERITED(gpu, isWrapped) |
| 137 , fDesc(desc) { | 144 , fDesc(desc) { |
| 138 } | 145 } |
| 139 | 146 |
| 140 GrSurfaceDesc fDesc; | 147 GrSurfaceDesc fDesc; |
| 141 | 148 |
| 142 private: | 149 private: |
| 143 typedef GrGpuResource INHERITED; | 150 typedef GrGpuResource INHERITED; |
| 144 }; | 151 }; |
| 145 | 152 |
| 146 #endif | 153 #endif |
| OLD | NEW |