aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.h
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-01-05 10:41:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-05 10:41:27 -0800
commit17aa047066eaaa56637c4c2b93c8c4c374127dbf (patch)
treefd23a2418ee23597760f1906025eaa344a3ac020 /src/gpu/gl/GrGLGpu.h
parent7928ef613f11a3c97fd939090197b8ae2be44b7a (diff)
More framework support for TransferBuffers
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r--src/gpu/gl/GrGLGpu.h14
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);