OLD | NEW |
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 Loading... |
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 |
OLD | NEW |