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
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e2457ce..2815f61 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -334,7 +334,7 @@
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 @@
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();