Index: src/gpu/GrGpu.cpp |
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp |
index e14e8929b04bbc84de2fa52f14298befac2733c2..85e6babba39d169fd275718ef4ae2eb5c1075ab1 100644 |
--- a/src/gpu/GrGpu.cpp |
+++ b/src/gpu/GrGpu.cpp |
@@ -399,18 +399,24 @@ bool GrGpu::writePixels(GrSurface* surface, |
return this->writePixels(surface, left, top, width, height, config, texels); |
} |
-bool GrGpu::transferPixels(GrSurface* surface, |
+bool GrGpu::transferPixels(GrTexture* texture, |
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); |
this->handleDirtyContext(); |
- if (this->onTransferPixels(surface, left, top, width, height, config, |
+ if (this->onTransferPixels(texture, left, top, width, height, config, |
transferBuffer, offset, rowBytes)) { |
SkIRect rect = SkIRect::MakeXYWH(left, top, width, height); |
- this->didWriteToSurface(surface, &rect); |
+ this->didWriteToSurface(texture, &rect); |
fStats.incTransfersToTexture(); |
+ |
+ if (*fence) { |
+ this->deleteFence(*fence); |
+ } |
+ *fence = this->insertFence(); |
+ |
return true; |
} |
return false; |