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

Unified Diff: src/gpu/gl/SkGLContext.cpp

Issue 1610183002: add wait on fence without flush (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « include/private/SkGpuFenceSync.h ('k') | src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/SkGLContext.cpp
diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp
index ad119aee6a30fa99ee2c8a31767bff0c62d6e320..9f373d6d474f15852bbfba6219afdd5162271a20 100644
--- a/src/gpu/gl/SkGLContext.cpp
+++ b/src/gpu/gl/SkGLContext.cpp
@@ -14,7 +14,7 @@ public:
static GLFenceSync* CreateIfSupported(const SkGLContext*);
SkPlatformGpuFence SK_WARN_UNUSED_RESULT insertFence() const override;
- bool flushAndWaitFence(SkPlatformGpuFence fence) const override;
+ bool waitFence(SkPlatformGpuFence fence, bool flush) const override;
void deleteFence(SkPlatformGpuFence fence) const override;
private:
@@ -85,7 +85,7 @@ void SkGLContext::swapBuffers() {
}
if (fFrameFences[fCurrentFenceIdx]) {
- if (!fFenceSync->flushAndWaitFence(fFrameFences[fCurrentFenceIdx])) {
+ if (!fFenceSync->waitFence(fFrameFences[fCurrentFenceIdx], true)) {
SkDebugf("WARNING: Wait failed for fence sync. Timings might not be accurate.\n");
}
fFenceSync->deleteFence(fFrameFences[fCurrentFenceIdx]);
@@ -143,9 +143,9 @@ SkPlatformGpuFence SkGLContext::GLFenceSync::insertFence() const {
return fGLFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
}
-bool SkGLContext::GLFenceSync::flushAndWaitFence(SkPlatformGpuFence fence) const {
+bool SkGLContext::GLFenceSync::waitFence(SkPlatformGpuFence fence, bool flush) const {
GLsync glsync = static_cast<GLsync>(fence);
- return GL_WAIT_FAILED != fGLClientWaitSync(glsync, GL_SYNC_FLUSH_COMMANDS_BIT, -1);
+ return GL_WAIT_FAILED != fGLClientWaitSync(glsync, flush ? GL_SYNC_FLUSH_COMMANDS_BIT : 0, -1);
}
void SkGLContext::GLFenceSync::deleteFence(SkPlatformGpuFence fence) const {
« no previous file with comments | « include/private/SkGpuFenceSync.h ('k') | src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698