aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-06-21 15:50:46 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-21 15:50:51 +0000
commitce57552e11776c8f93798c3a2244fa378604b4af (patch)
treece812560eec646ab8335f25d57dfec1df7db5c4e /src/gpu/GrGpu.cpp
parentf7037d003c936f59e4d02244821e223c2e7af8e8 (diff)
Revert "Clean up onTransferPixels"
This reverts commit f7037d003c936f59e4d02244821e223c2e7af8e8. Reason for revert: Issues on test bots. Original change's description: > Clean up onTransferPixels > > Bug: skia:5126 > Change-Id: I323c50e7854744302007b4ae7bd25e5742c14cbc > Reviewed-on: https://skia-review.googlesource.com/19055 > Commit-Queue: Jim Van Verth <jvanverth@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com Change-Id: I923fda4d5cd8c2896fb347f9b2695b7f83d9137b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:5126 Reviewed-on: https://skia-review.googlesource.com/20444 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e0766a730f..262f155c24 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -389,24 +389,30 @@ bool GrGpu::writePixels(GrSurface* surface,
return this->writePixels(surface, left, top, width, height, config, texels);
}
-bool GrGpu::transferPixels(GrTexture* texture,
+bool GrGpu::transferPixels(GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, GrBuffer* transferBuffer,
- size_t offset, size_t rowBytes) {
+ size_t offset, size_t rowBytes, GrFence* fence) {
SkASSERT(transferBuffer);
+ SkASSERT(fence);
// We don't allow conversion between integer configs and float/fixed configs.
- if (GrPixelConfigIsSint(texture->config()) != GrPixelConfigIsSint(config)) {
+ if (GrPixelConfigIsSint(surface->config()) != GrPixelConfigIsSint(config)) {
return false;
}
this->handleDirtyContext();
- if (this->onTransferPixels(texture, left, top, width, height, config,
+ if (this->onTransferPixels(surface, left, top, width, height, config,
transferBuffer, offset, rowBytes)) {
SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
- this->didWriteToSurface(texture, &rect);
+ this->didWriteToSurface(surface, &rect);
fStats.incTransfersToTexture();
+ if (*fence) {
+ this->deleteFence(*fence);
+ }
+ *fence = this->insertFence();
+
return true;
}
return false;