Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: src/gpu/GrGpu.cpp

Issue 2384463003: Add fence support for TransferBuffers (Closed)
Patch Set: Add test code Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/gl/GrGLAssembleInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e14e8929b04bbc84de2fa52f14298befac2733c2..0de9fedb8c6d4f8bc0d9c1613134dfd354c1d69a 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -402,8 +402,9 @@ bool GrGpu::writePixels(GrSurface* surface,
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);
this->handleDirtyContext();
if (this->onTransferPixels(surface, left, top, width, height, config,
@@ -411,6 +412,12 @@ bool GrGpu::transferPixels(GrSurface* surface,
SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
this->didWriteToSurface(surface, &rect);
fStats.incTransfersToTexture();
+
+ if (*fence) {
+ this->deleteFence(*fence);
+ }
+ *fence = this->insertFence();
+
return true;
}
return false;
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/gl/GrGLAssembleInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698