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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 * @param rowBytes number of bytes between consecutive rows. Zero means
rows are tightly | 105 * @param rowBytes number of bytes between consecutive rows. Zero means
rows are tightly |
106 * packed. | 106 * packed. |
107 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. | 107 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. |
108 */ | 108 */ |
109 virtual void writePixels(int left, int top, int width, int height, | 109 virtual void writePixels(int left, int top, int width, int height, |
110 GrPixelConfig config, | 110 GrPixelConfig config, |
111 const void* buffer, | 111 const void* buffer, |
112 size_t rowBytes = 0, | 112 size_t rowBytes = 0, |
113 uint32_t pixelOpsFlags = 0) = 0; | 113 uint32_t pixelOpsFlags = 0) = 0; |
114 | 114 |
115 /** | |
116 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. | |
117 */ | |
118 void flushWrites(); | |
119 | |
120 /** Access methods that are only to be used within Skia code. */ | 115 /** Access methods that are only to be used within Skia code. */ |
121 inline GrSurfacePriv surfacePriv(); | 116 inline GrSurfacePriv surfacePriv(); |
122 inline const GrSurfacePriv surfacePriv() const; | 117 inline const GrSurfacePriv surfacePriv() const; |
123 | 118 |
124 protected: | 119 protected: |
125 // Methods made available via GrSurfacePriv | 120 // Methods made available via GrSurfacePriv |
126 SkImageInfo info() const; | 121 SkImageInfo info() const; |
127 bool savePixels(const char* filename); | 122 bool savePixels(const char* filename); |
128 bool hasPendingRead() const; | 123 bool hasPendingRead() const; |
129 bool hasPendingWrite() const; | 124 bool hasPendingWrite() const; |
130 bool hasPendingIO() const; | 125 bool hasPendingIO() const; |
131 bool isSameAs(const GrSurface* other) const; | 126 bool isSameAs(const GrSurface* other) const; |
132 | 127 |
133 // Provides access to methods that should be public within Skia code. | 128 // Provides access to methods that should be public within Skia code. |
134 friend class GrSurfacePriv; | 129 friend class GrSurfacePriv; |
135 | 130 |
136 GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) | 131 GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) |
137 : INHERITED(gpu, isWrapped) | 132 : INHERITED(gpu, isWrapped) |
138 , fDesc(desc) { | 133 , fDesc(desc) { |
139 } | 134 } |
140 | 135 |
141 GrTextureDesc fDesc; | 136 GrTextureDesc fDesc; |
142 | 137 |
143 private: | 138 private: |
144 typedef GrGpuResource INHERITED; | 139 typedef GrGpuResource INHERITED; |
145 }; | 140 }; |
146 | 141 |
147 #endif | 142 #endif |
OLD | NEW |