| 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 gfx { | 10 namespace gl { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 std::string GetGLErrors() { | 14 std::string GetGLErrors() { |
| 15 // Clears and logs all current gl errors. | 15 // Clears and logs all current gl errors. |
| 16 std::string accumulated_errors; | 16 std::string accumulated_errors; |
| 17 GLenum error; | 17 GLenum error; |
| 18 while ((error = glGetError()) != GL_NO_ERROR) { | 18 while ((error = glGetError()) != GL_NO_ERROR) { |
| 19 accumulated_errors += base::StringPrintf("0x%x ", error); | 19 accumulated_errors += base::StringPrintf("0x%x ", error); |
| 20 } | 20 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DCHECK_EQ(GL_TRUE, glIsSync(sync_)); |
| 65 glDeleteSync(sync_); | 65 glDeleteSync(sync_); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace gfx | 68 } // namespace gl |
| OLD | NEW |