diff options
author | 2016-01-05 10:41:27 -0800 | |
---|---|---|
committer | 2016-01-05 10:41:27 -0800 | |
commit | 17aa047066eaaa56637c4c2b93c8c4c374127dbf (patch) | |
tree | fd23a2418ee23597760f1906025eaa344a3ac020 /src/gpu/gl/GrGLGpu.h | |
parent | 7928ef613f11a3c97fd939090197b8ae2be44b7a (diff) |
More framework support for TransferBuffers
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1534123003
Review URL: https://codereview.chromium.org/1534123003
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 8c127f6419..532a864f07 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -172,6 +172,11 @@ private: GrPixelConfig config, const void* buffer, size_t rowBytes) override; + bool onTransferPixels(GrSurface*, + int left, int top, int width, int height, + GrPixelConfig config, GrTransferBuffer* buffer, + size_t offset, size_t rowBytes) override; + void onResolveRenderTarget(GrRenderTarget* target) override; void onDraw(const DrawArgs&, const GrNonInstancedVertices&) override; @@ -284,9 +289,14 @@ private: void flushHWAAState(GrRenderTarget* rt, bool useHWAA); // helper for onCreateTexture and writeTexturePixels + enum UploadType { + kNewTexture_UploadType, // we are creating a new texture + kWrite_UploadType, // we are using TexSubImage2D to copy data to an existing texture + kTransfer_UploadType, // we are using a transfer buffer to copy data + }; bool uploadTexData(const GrSurfaceDesc& desc, GrGLenum target, - bool isNewTexture, + UploadType uploadType, int left, int top, int width, int height, GrPixelConfig dataConfig, const void* data, @@ -301,7 +311,7 @@ private: bool uploadCompressedTexData(const GrSurfaceDesc& desc, GrGLenum target, const void* data, - bool isNewTexture = true, + UploadType uploadType = kNewTexture_UploadType, int left = 0, int top = 0, int width = -1, int height = -1); |