aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
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/GrGpu.cpp
parent7928ef613f11a3c97fd939090197b8ae2be44b7a (diff)
More framework support for TransferBuffers
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e2457ce31e..2815f612d6 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -334,7 +334,7 @@ bool GrGpu::writePixels(GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t rowBytes) {
- if (!buffer) {
+ if (!buffer || !surface) {
return false;
}
@@ -346,6 +346,21 @@ bool GrGpu::writePixels(GrSurface* surface,
return false;
}
+bool GrGpu::transferPixels(GrSurface* surface,
+ int left, int top, int width, int height,
+ GrPixelConfig config, GrTransferBuffer* buffer,
+ size_t offset, size_t rowBytes) {
+ SkASSERT(buffer);
+
+ this->handleDirtyContext();
+ if (this->onTransferPixels(surface, left, top, width, height, config,
+ buffer, offset, rowBytes)) {
+ fStats.incTransfersToTexture();
+ return true;
+ }
+ return false;
+}
+
void GrGpu::resolveRenderTarget(GrRenderTarget* target) {
SkASSERT(target);
this->handleDirtyContext();