Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: src/gpu/gl/GrGLGpu.h

Issue 1534123003: More framework support for TransferBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address more comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLBufferImpl.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.h
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 8c127f641908b856fb07004286f2f1951aee2c7b..532a864f0712a70a2a73065c062ea4698cee3aed 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);
« no previous file with comments | « src/gpu/gl/GrGLBufferImpl.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698