Index: include/gpu/GrSurface.h |
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h |
index 28935009ce8caee78187405c3b50616d7d2e9aed..2f414c952bdc490255e2991199d9872cc4c86ff2 100644 |
--- a/include/gpu/GrSurface.h |
+++ b/include/gpu/GrSurface.h |
@@ -12,7 +12,9 @@ |
#include "GrTypes.h" |
#include "GrGpuResource.h" |
#include "SkImageInfo.h" |
+#include "SkMipMapLevel.h" |
#include "SkRect.h" |
+#include "SkTArray.h" |
class GrRenderTarget; |
class GrSurfacePriv; |
@@ -95,9 +97,12 @@ 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 the rectangle 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-size 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 the GrContext::PixelOpsFlags enum. |
* |
* @return true if the read succeeded, false if not. The read can fail because of an unsupported |
@@ -105,6 +110,17 @@ public: |
*/ |
bool writePixels(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 writePixels() with that SkTArray. |
+ * This is so older code which currently uses this function signature will |
bsalomon
2015/09/15 13:14:10
I'd take off the thing about older code. I expect
cblume
2015/09/16 18:40:46
I've updated all the shim comments. :)
|
+ * continue to work. |
+ */ |
+ bool writePixels(int left, int top, int width, int height, |
+ GrPixelConfig config, |
const void* buffer, |
size_t rowBytes = 0, |
uint32_t pixelOpsFlags = 0); |