| Index: src/gpu/GrGpu.h
|
| diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
|
| index 9365d8927f650d4da1e75635c6359207b99974a0..9905a4cf616266acf98c8b85dc2ba70a7596c728 100644
|
| --- a/src/gpu/GrGpu.h
|
| +++ b/src/gpu/GrGpu.h
|
| @@ -13,7 +13,9 @@
|
| #include "GrStencil.h"
|
| #include "GrTraceMarker.h"
|
| #include "GrXferProcessor.h"
|
| +#include "SkMipMapLevel.h"
|
| #include "SkPath.h"
|
| +#include "SkTArray.h"
|
|
|
| class GrBatchTracker;
|
| class GrContext;
|
| @@ -80,18 +82,25 @@ public:
|
| *
|
| * @param desc describes the texture to be created.
|
| * @param budgeted does this texture count against the resource cache budget?
|
| - * @param srcData texel data to load texture. 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 NULL texture data
|
| - * is uninitialized.
|
| - * @param rowBytes the number of bytes between consecutive rows. Zero
|
| - * means rows are tightly packed. This field is ignored
|
| - * for compressed formats.
|
| + * @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 NULL fTexels, texture data is
|
| + * uninitialized.
|
| *
|
| * @return The texture object if successful, otherwise NULL.
|
| */
|
| GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted,
|
| + SkTArray<SkMipMapLevel>& texels);
|
| +
|
| + /*
|
| + * This function is a shim which creates a SkTArray<SkMipMapLevel> of size 1.
|
| + * It then calls createTexture() with that SkTArray.
|
| + * This is so older code which currently uses this function signature will
|
| + * continue to work.
|
| + */
|
| + GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted,
|
| const void* srcData, size_t rowBytes);
|
|
|
| /**
|
| @@ -214,9 +223,18 @@ 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 texture data
|
| + */
|
| + bool writeTexturePixels(GrTexture* texture,
|
| + int left, int top, int width, int height,
|
| + GrPixelConfig config,
|
| + SkTArray<SkMipMapLevel>& texels);
|
| +
|
| + /*
|
| + * This function is a shim which creates a SkTArray<SkMipMapLEvel> of size 1.
|
| + * It then calls writeTexturePixels() with that SkTArray.
|
| + * This is so older code which currently uses this function signature will
|
| + * continue to work.
|
| */
|
| bool writeTexturePixels(GrTexture* texture,
|
| int left, int top, int width, int height,
|
| @@ -228,7 +246,8 @@ public:
|
| * rect is NULL, otherwise just the rect. If canIgnoreRect is set then the entire render target
|
| * can be optionally cleared.
|
| */
|
| - void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect,GrRenderTarget* renderTarget);
|
| + void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect,
|
| + GrRenderTarget* renderTarget);
|
|
|
|
|
| void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* renderTarget);
|
| @@ -404,10 +423,11 @@ private:
|
| // onCreateTexture/CompressedTexture are called.
|
| virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc,
|
| GrGpuResource::LifeCycle lifeCycle,
|
| - const void* srcData, size_t rowBytes) = 0;
|
| + SkTArray<SkMipMapLevel>& texels) = 0;
|
| virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc,
|
| GrGpuResource::LifeCycle lifeCycle,
|
| - const void* srcData) = 0;
|
| + SkTArray<SkMipMapLevel>& texels) = 0;
|
| +
|
| virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership) = 0;
|
| virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
|
| GrWrapOwnership) = 0;
|
| @@ -435,8 +455,8 @@ private:
|
| // overridden by backend-specific derived class to perform the texture update
|
| virtual bool onWriteTexturePixels(GrTexture* texture,
|
| int left, int top, int width, int height,
|
| - GrPixelConfig config, const void* buffer,
|
| - size_t rowBytes) = 0;
|
| + GrPixelConfig config,
|
| + SkTArray<SkMipMapLevel>& texel) = 0;
|
|
|
| // overridden by backend-specific derived class to perform the resolve
|
| virtual void onResolveRenderTarget(GrRenderTarget* target) = 0;
|
|
|