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 |
11 | 11 |
12 #include "GrTypes.h" | 12 #include "GrTypes.h" |
13 #include "GrGpuResource.h" | 13 #include "GrGpuResource.h" |
14 #include "SkImageInfo.h" | 14 #include "SkImageInfo.h" |
| 15 #include "SkMipMapLevel.h" |
15 #include "SkRect.h" | 16 #include "SkRect.h" |
| 17 #include "SkTArray.h" |
16 | 18 |
17 class GrRenderTarget; | 19 class GrRenderTarget; |
18 class GrSurfacePriv; | 20 class GrSurfacePriv; |
19 class GrTexture; | 21 class GrTexture; |
20 | 22 |
21 class SK_API GrSurface : public GrGpuResource { | 23 class SK_API GrSurface : public GrGpuResource { |
22 public: | 24 public: |
23 /** | 25 /** |
24 * Retrieves the width of the surface. | 26 * Retrieves the width of the surface. |
25 */ | 27 */ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 * @param left left edge of the rectangle to write (inclusive) | 95 * @param left left edge of the rectangle to write (inclusive) |
94 * @param top top edge of the rectangle to write (inclusive) | 96 * @param top top edge of the rectangle to write (inclusive) |
95 * @param width width of rectangle to write in pixels. | 97 * @param width width of rectangle to write in pixels. |
96 * @param height height of rectangle to write in pixels. | 98 * @param height height of rectangle to write in pixels. |
97 * @param config the pixel config of the source buffer | 99 * @param config the pixel config of the source buffer |
98 * @param buffer memory to read the rectangle from. | 100 * @param buffer memory to read the rectangle from. |
99 * @param rowBytes number of bytes between consecutive rows. Zero means
rows are tightly | 101 * @param rowBytes number of bytes between consecutive rows. Zero means
rows are tightly |
100 * packed. | 102 * packed. |
101 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. | 103 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. |
102 * | 104 * |
103 * @return true if the read succeeded, false if not. The read can fail becau
se of an unsupported | 105 * @return true if the read succeeded, false if not. The read can fail becau
se of an |
104 * pixel config. | 106 * unsupported pixel config. |
105 */ | 107 */ |
106 bool writePixels(int left, int top, int width, int height, | 108 bool writePixels(int left, int top, int width, int height, GrPixelConfig con
fig, |
107 GrPixelConfig config, | 109 const void* buffer, size_t rowBytes = 0, uint32_t pixelOpsF
lags = 0); |
108 const void* buffer, | |
109 size_t rowBytes = 0, | |
110 uint32_t pixelOpsFlags = 0); | |
111 | 110 |
112 /** | 111 /** |
113 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. | 112 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. |
114 */ | 113 */ |
115 void flushWrites(); | 114 void flushWrites(); |
116 | 115 |
117 | 116 |
118 /** | 117 /** |
119 * After this returns any pending surface IO will be issued to the backend 3
D API and | 118 * After this returns any pending surface IO will be issued to the backend 3
D API and |
120 * if the surface has MSAA it will be resolved. | 119 * if the surface has MSAA it will be resolved. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 170 } |
172 } | 171 } |
173 | 172 |
174 ReleaseProc fReleaseProc; | 173 ReleaseProc fReleaseProc; |
175 ReleaseCtx fReleaseCtx; | 174 ReleaseCtx fReleaseCtx; |
176 | 175 |
177 typedef GrGpuResource INHERITED; | 176 typedef GrGpuResource INHERITED; |
178 }; | 177 }; |
179 | 178 |
180 #endif | 179 #endif |
OLD | NEW |