| Index: include/gpu/GrSurface.h
|
| diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
|
| index 28935009ce8caee78187405c3b50616d7d2e9aed..ef49a0a4a39ebb957c00c6b1dcca70155b45e7bb 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,19 +97,31 @@ 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
|
| - * pixel config.
|
| + * @return true if the read succeeded, false if not. The read can fail because of an
|
| + * unsupported pixel config.
|
| + */
|
| + 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.
|
| + *
|
| + * @param buffer Pointer to the pixel values (optional).
|
| + * @param rowBytes The number of bytes between rows of the texture. Zero
|
| + * implies tightly packed rows. For compressed pixel configs, this
|
| + * field is ignored.
|
| */
|
| - bool writePixels(int left, int top, int width, int height,
|
| - GrPixelConfig config,
|
| - const void* buffer,
|
| - size_t rowBytes = 0,
|
| - uint32_t pixelOpsFlags = 0);
|
| + bool writePixels(int left, int top, int width, int height, GrPixelConfig config,
|
| + const void* buffer, size_t rowBytes = 0, uint32_t pixelOpsFlags = 0);
|
|
|
| /**
|
| * After this returns any pending writes to the surface will be issued to the backend 3D API.
|
|
|