Chromium Code Reviews| Index: include/gpu/GrContext.h |
| diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
| index 17751664196ce850022382e7d9b809744e953b7c..9f8b5c4ede30174a4a892ae9ac9a63d04c41e5ff 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; |
| @@ -258,15 +260,33 @@ 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 |
|
bsalomon
2015/09/30 18:01:29
Why one element and not just a 0 element array?
cblume
2015/10/08 09:27:56
Oh. That...is a much better idea. I'll go through
|
| + * 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. |
| + * |
| + * @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 writeSurfacePixels(GrSurface* surface, |
| + int left, int top, int width, int height, |
| GrPixelConfig config, const void* buffer, |
| size_t rowBytes, |
| uint32_t pixelOpsFlags = 0); |