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 #include "ui/gl/gl_context.h" | 9 #include "ui/gl/gl_context.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 void GLFenceARB::Invalidate() { | 72 void GLFenceARB::Invalidate() { |
73 sync_ = 0; | 73 sync_ = 0; |
74 } | 74 } |
75 | 75 |
76 void GLFenceARB::HandleClientWaitFailure() { | 76 void GLFenceARB::HandleClientWaitFailure() { |
77 DCHECK(GLContext::GetCurrent()); | 77 DCHECK(GLContext::GetCurrent()); |
78 if (GLContext::GetCurrent()->WasAllocatedUsingRobustnessExtension()) { | 78 if (GLContext::GetCurrent()->WasAllocatedUsingRobustnessExtension()) { |
79 // This function pointer is only set if one of the robustness | 79 // This function pointer is only set if one of the robustness |
80 // extensions was available. | 80 // extensions was available. |
81 DCHECK(g_driver_gl.fn.glGetGraphicsResetStatusARBFn); | 81 DCHECK(g_current_gl_driver && |
82 DCHECK(g_driver_gl.fn.glGetGraphicsResetStatusARBFn() != GL_NO_ERROR); | 82 g_current_gl_driver->fn.glGetGraphicsResetStatusARBFn); |
| 83 DCHECK(g_current_gl_driver->fn.glGetGraphicsResetStatusARBFn() != |
| 84 GL_NO_ERROR); |
83 LOG(ERROR) << "Failed to wait for GLFence; context was lost. Error code: " | 85 LOG(ERROR) << "Failed to wait for GLFence; context was lost. Error code: " |
84 << GetGLErrors(); | 86 << GetGLErrors(); |
85 } else { | 87 } else { |
86 // There's no provision for reporting these failures higher up the | 88 // There's no provision for reporting these failures higher up the |
87 // stack and thereby losing the context (or exiting the GPU | 89 // stack and thereby losing the context (or exiting the GPU |
88 // process) more cooperatively. Some of this code is called from | 90 // process) more cooperatively. Some of this code is called from |
89 // deep call stacks. Report the wait failure and crash with a log | 91 // deep call stacks. Report the wait failure and crash with a log |
90 // message. | 92 // message. |
91 LOG(FATAL) << "Failed to wait for GLFence. Error code: " << GetGLErrors(); | 93 LOG(FATAL) << "Failed to wait for GLFence. Error code: " << GetGLErrors(); |
92 } | 94 } |
93 } | 95 } |
94 | 96 |
95 } // namespace gl | 97 } // namespace gl |
OLD | NEW |