aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
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;