Index: include/gpu/GrContext.h |
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
index 64f4f6ce30e6609b0d8ca3b1dd99cdde35739a86..a93c97cc8280b5f2e0030e25ce0a1bc2ba3776ac 100644 |
--- a/include/gpu/GrContext.h |
+++ b/include/gpu/GrContext.h |
@@ -16,7 +16,9 @@ |
#include "GrTextureProvider.h" |
#include "SkMatrix.h" |
#include "SkMutex.h" |
+#include "SkMipMapLevel.h" |
#include "SkPathEffect.h" |
+#include "SkTArray.h" |
#include "SkTypes.h" |
struct GrBatchAtlasConfig; |
@@ -257,15 +259,30 @@ public: |
* @param width width of rectangle to write in pixels. |
* @param height height of rectangle to write in pixels. |
* @param config the pixel config of the source buffer |
- * @param buffer memory to read pixels from |
- * @param rowBytes number of bytes between consecutive rows. Zero |
- * means rows are tightly packed. |
+ * @param texels array of mipmap levels containing texel data to load. |
+ * Begins with full-sized palette data for paletted textures. |
+ * For compressed formats it contains the compressed pixel data. |
+ * Otherwise, it contains width*height texels. If there is only one |
+ * element and it contains nullptr fTexels, texture data is |
+ * uninitialized. |
* @param pixelOpsFlags see PixelOpsFlags enum above. |
+ * |
* @return true if the write succeeded, false if not. The write can fail because of an |
* unsupported combination of surface and src configs. |
*/ |
bool writeSurfacePixels(GrSurface* surface, |
int left, int top, int width, int height, |
+ GrPixelConfig config, const SkTArray<SkMipMapLevel>& texels, |
+ uint32_t pixelOpsFlags = 0); |
+ |
+ /** |
+ * This function is a shim which creates a SkTArray<SkMipMapLevel> of size 1. |
+ * It then calls writeSurfacePixels() with that SkTArray. |
+ * This is so older code which currently uses this function signature will |
+ * continue to work. |
+ */ |
+ bool writeSurfacePixels(GrSurface* surface, |
+ int left, int top, int width, int height, |
GrPixelConfig config, const void* buffer, |
size_t rowBytes, |
uint32_t pixelOpsFlags = 0); |