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

Unified Diff: trunk/src/ui/gl/gl_fence.cc

Issue 209853004: Revert 258122 "gpu: Allow fences to check whether a flush has oc..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 | « trunk/src/ui/gl/gl_fence.h ('k') | trunk/src/ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/gl/gl_fence.cc
===================================================================
--- trunk/src/ui/gl/gl_fence.cc (revision 258964)
+++ trunk/src/ui/gl/gl_fence.cc (working copy)
@@ -25,11 +25,8 @@
// We will arbitrarily return TRUE for consistency.
glGenFencesNV(1, &fence_);
glSetFenceNV(fence_, GL_ALL_COMPLETED_NV);
- if (flush) {
+ if (flush)
glFlush();
- } else {
- flush_event_ = gfx::GLContext::GetCurrent()->SignalFlush();
- }
}
virtual bool HasCompleted() OVERRIDE {
@@ -37,15 +34,11 @@
}
virtual void ClientWait() OVERRIDE {
- if (!flush_event_ || flush_event_->IsSignaled()) {
- glFinishFenceNV(fence_);
- } else {
- LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping...";
- }
+ glFinishFenceNV(fence_);
}
virtual void ServerWait() OVERRIDE {
- ClientWait();
+ glFinishFenceNV(fence_);
}
private:
@@ -54,18 +47,14 @@
}
GLuint fence_;
- scoped_refptr<gfx::GLContext::FlushEvent> flush_event_;
};
class GLFenceARBSync: public gfx::GLFence {
public:
GLFenceARBSync(bool flush) {
sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
- if (flush) {
+ if (flush)
glFlush();
- } else {
- flush_event_ = gfx::GLContext::GetCurrent()->SignalFlush();
- }
}
virtual bool HasCompleted() OVERRIDE {
@@ -80,19 +69,11 @@
}
virtual void ClientWait() OVERRIDE {
- if (!flush_event_ || flush_event_->IsSignaled()) {
- glClientWaitSync(sync_, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
- } else {
- LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping...";
- }
+ glClientWaitSync(sync_, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
}
virtual void ServerWait() OVERRIDE {
- if (!flush_event_ || flush_event_->IsSignaled()) {
- glWaitSync(sync_, 0, GL_TIMEOUT_IGNORED);
- } else {
- LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping...";
- }
+ glWaitSync(sync_, 0, GL_TIMEOUT_IGNORED);
}
private:
@@ -101,7 +82,6 @@
}
GLsync sync_;
- scoped_refptr<gfx::GLContext::FlushEvent> flush_event_;
};
#if !defined(OS_MACOSX)
@@ -110,11 +90,8 @@
EGLFenceSync(bool flush) {
display_ = eglGetCurrentDisplay();
sync_ = eglCreateSyncKHR(display_, EGL_SYNC_FENCE_KHR, NULL);
- if (flush) {
+ if (flush)
glFlush();
- } else {
- flush_event_ = gfx::GLContext::GetCurrent()->SignalFlush();
- }
}
virtual bool HasCompleted() OVERRIDE {
@@ -125,22 +102,14 @@
}
virtual void ClientWait() OVERRIDE {
- if (!flush_event_ || flush_event_->IsSignaled()) {
- EGLint flags = 0;
- EGLTimeKHR time = EGL_FOREVER_KHR;
- eglClientWaitSyncKHR(display_, sync_, flags, time);
- } else {
- LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping...";
- }
+ EGLint flags = 0;
+ EGLTimeKHR time = EGL_FOREVER_KHR;
+ eglClientWaitSyncKHR(display_, sync_, flags, time);
}
virtual void ServerWait() OVERRIDE {
- if (!flush_event_ || flush_event_->IsSignaled()) {
- EGLint flags = 0;
- eglWaitSyncKHR(display_, sync_, flags);
- } else {
- LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping...";
- }
+ EGLint flags = 0;
+ eglWaitSyncKHR(display_, sync_, flags);
}
@@ -151,15 +120,11 @@
EGLSyncKHR sync_;
EGLDisplay display_;
- scoped_refptr<gfx::GLContext::FlushEvent> flush_event_;
};
#endif // !OS_MACOSX
// static
gfx::GLFence* CreateFence(bool flush) {
- DCHECK(gfx::GLContext::GetCurrent())
- << "Trying to create fence with no context";
-
#if !defined(OS_MACOSX)
if (gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync)
return new EGLFenceSync(flush);
« no previous file with comments | « trunk/src/ui/gl/gl_fence.h ('k') | trunk/src/ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698