| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 uint32_t pixelOpsFlags = 0); | 90 uint32_t pixelOpsFlags = 0); |
| 89 | 91 |
| 90 /** | 92 /** |
| 91 * Copy the src pixels [buffer, rowbytes, pixelconfig] into the surface at t
he specified | 93 * Copy the src pixels [buffer, rowbytes, pixelconfig] into the surface at t
he specified |
| 92 * rectangle. | 94 * rectangle. |
| 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 Pointer to the pixel values (optional). |
| 99 * @param rowBytes number of bytes between consecutive rows. Zero means
rows are tightly | 101 * @param rowBytes The number of bytes between rows of the texture. Zer
o |
| 100 * packed. | 102 * implies tightly packed rows. For compressed pixel co
nfigs, this |
| 103 * field is ignored. |
| 101 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. | 104 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. |
| 102 * | 105 * |
| 103 * @return true if the read succeeded, false if not. The read can fail becau
se of an unsupported | 106 * @return true if the read succeeded, false if not. The read can fail becau
se of an |
| 104 * pixel config. | 107 * unsupported pixel config. |
| 105 */ | 108 */ |
| 106 bool writePixels(int left, int top, int width, int height, | 109 bool writePixels(int left, int top, int width, int height, GrPixelConfig con
fig, |
| 107 GrPixelConfig config, | 110 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 | 111 |
| 112 /** | 112 /** |
| 113 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. | 113 * After this returns any pending writes to the surface will be issued to th
e backend 3D API. |
| 114 */ | 114 */ |
| 115 void flushWrites(); | 115 void flushWrites(); |
| 116 | 116 |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * After this returns any pending surface IO will be issued to the backend 3
D API and | 119 * 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. | 120 * if the surface has MSAA it will be resolved. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 ReleaseProc fReleaseProc; | 174 ReleaseProc fReleaseProc; |
| 175 ReleaseCtx fReleaseCtx; | 175 ReleaseCtx fReleaseCtx; |
| 176 | 176 |
| 177 typedef GrGpuResource INHERITED; | 177 typedef GrGpuResource INHERITED; |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 #endif | 180 #endif |
| OLD | NEW |