OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "android_webview/browser/scoped_app_gl_state_restore.h" | 5 #include "android_webview/browser/scoped_app_gl_state_restore.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 i, GL_VERTEX_ATTRIB_ARRAY_POINTER, &vertex_attrib_[i].pointer); | 290 i, GL_VERTEX_ATTRIB_ARRAY_POINTER, &vertex_attrib_[i].pointer); |
291 glGetVertexAttribPointerv( | 291 glGetVertexAttribPointerv( |
292 i, GL_VERTEX_ATTRIB_ARRAY_POINTER, &vertex_attrib_[i].pointer); | 292 i, GL_VERTEX_ATTRIB_ARRAY_POINTER, &vertex_attrib_[i].pointer); |
293 glGetVertexAttribiv(i, | 293 glGetVertexAttribiv(i, |
294 GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, | 294 GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, |
295 &vertex_attrib_[i].vertex_attrib_array_buffer_binding); | 295 &vertex_attrib_[i].vertex_attrib_array_buffer_binding); |
296 glGetVertexAttribfv( | 296 glGetVertexAttribfv( |
297 i, GL_CURRENT_VERTEX_ATTRIB, vertex_attrib_[i].current_vertex_attrib); | 297 i, GL_CURRENT_VERTEX_ATTRIB, vertex_attrib_[i].current_vertex_attrib); |
298 } | 298 } |
299 | 299 |
300 // Android 5.0.0 specific qualcomm workaround. See crbug.com/434570. | 300 if (mode_ == ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT) { |
301 glBindRenderbufferEXT(GL_RENDERBUFFER, 0); | 301 // Android 5.0.0 specific qualcomm workaround. See crbug.com/434570. |
| 302 glBindRenderbufferEXT(GL_RENDERBUFFER, 0); |
| 303 } |
| 304 |
302 DCHECK(ClearGLErrors(false, NULL)); | 305 DCHECK(ClearGLErrors(false, NULL)); |
303 } | 306 } |
304 | 307 |
305 ScopedAppGLStateRestoreImpl::~ScopedAppGLStateRestoreImpl() { | 308 ScopedAppGLStateRestoreImpl::~ScopedAppGLStateRestoreImpl() { |
306 TRACE_EVENT0("android_webview", "AppGLStateRestore"); | 309 TRACE_EVENT0("android_webview", "AppGLStateRestore"); |
307 MakeAppContextCurrent(); | 310 MakeAppContextCurrent(); |
308 | 311 |
309 DCHECK(ClearGLErrors(false, NULL)); | 312 DCHECK(ClearGLErrors(false, NULL)); |
310 | 313 |
311 glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer_binding_ext_); | 314 glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer_binding_ext_); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 ScopedAppGLStateRestore::~ScopedAppGLStateRestore() {} | 432 ScopedAppGLStateRestore::~ScopedAppGLStateRestore() {} |
430 | 433 |
431 bool ScopedAppGLStateRestore::stencil_enabled() const { | 434 bool ScopedAppGLStateRestore::stencil_enabled() const { |
432 return impl_->stencil_enabled(); | 435 return impl_->stencil_enabled(); |
433 } | 436 } |
434 int ScopedAppGLStateRestore::framebuffer_binding_ext() const { | 437 int ScopedAppGLStateRestore::framebuffer_binding_ext() const { |
435 return impl_->framebuffer_binding_ext(); | 438 return impl_->framebuffer_binding_ext(); |
436 } | 439 } |
437 | 440 |
438 } // namespace android_webview | 441 } // namespace android_webview |
OLD | NEW |