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

Side by Side Diff: ui/gl/gl_fence_arb.cc

Issue 2087403003: Add an Invalidate method to GLFence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_fence_arb.h ('k') | ui/gl/gl_fence_nv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_fence_arb.h" 5 #include "ui/gl/gl_fence_arb.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "ui/gl/gl_bindings.h" 8 #include "ui/gl/gl_bindings.h"
9 9
10 namespace gl { 10 namespace gl {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 LOG(FATAL) << "Failed to wait for GLFence. error code:" << GetGLErrors(); 54 LOG(FATAL) << "Failed to wait for GLFence. error code:" << GetGLErrors();
55 } 55 }
56 } 56 }
57 57
58 void GLFenceARB::ServerWait() { 58 void GLFenceARB::ServerWait() {
59 DCHECK_EQ(GL_TRUE, glIsSync(sync_)); 59 DCHECK_EQ(GL_TRUE, glIsSync(sync_));
60 glWaitSync(sync_, 0, GL_TIMEOUT_IGNORED); 60 glWaitSync(sync_, 0, GL_TIMEOUT_IGNORED);
61 } 61 }
62 62
63 GLFenceARB::~GLFenceARB() { 63 GLFenceARB::~GLFenceARB() {
64 DCHECK_EQ(GL_TRUE, glIsSync(sync_)); 64 if (sync_) {
65 glDeleteSync(sync_); 65 DCHECK_EQ(GL_TRUE, glIsSync(sync_));
66 glDeleteSync(sync_);
67 }
68 }
69
70 void GLFenceARB::Invalidate() {
71 sync_ = 0;
66 } 72 }
67 73
68 } // namespace gl 74 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_fence_arb.h ('k') | ui/gl/gl_fence_nv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698