| 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 "android_webview/browser/gl_surface_factory.h" |
| 7 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 8 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 9 #include "ui/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
| 10 #include "ui/gl/gl_surface_stub.h" | 11 #include "ui/gl/gl_surface_stub.h" |
| 11 | 12 |
| 12 namespace android_webview { | 13 namespace android_webview { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 // "App" context is a bit of a stretch. Basically we use this context while | 17 // "App" context is a bit of a stretch. Basically we use this context while |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 glGetBooleanv(GL_DITHER, &enable_dither_); | 126 glGetBooleanv(GL_DITHER, &enable_dither_); |
| 126 glGetBooleanv(GL_POLYGON_OFFSET_FILL, &enable_polygon_offset_fill_); | 127 glGetBooleanv(GL_POLYGON_OFFSET_FILL, &enable_polygon_offset_fill_); |
| 127 glGetBooleanv(GL_SAMPLE_ALPHA_TO_COVERAGE, &enable_sample_alpha_to_coverage_); | 128 glGetBooleanv(GL_SAMPLE_ALPHA_TO_COVERAGE, &enable_sample_alpha_to_coverage_); |
| 128 glGetBooleanv(GL_SAMPLE_COVERAGE, &enable_sample_coverage_); | 129 glGetBooleanv(GL_SAMPLE_COVERAGE, &enable_sample_coverage_); |
| 129 | 130 |
| 130 glGetBooleanv(GL_STENCIL_TEST, &stencil_test_); | 131 glGetBooleanv(GL_STENCIL_TEST, &stencil_test_); |
| 131 glGetIntegerv(GL_STENCIL_FUNC, &stencil_func_); | 132 glGetIntegerv(GL_STENCIL_FUNC, &stencil_func_); |
| 132 glGetIntegerv(GL_STENCIL_VALUE_MASK, &stencil_mask_); | 133 glGetIntegerv(GL_STENCIL_VALUE_MASK, &stencil_mask_); |
| 133 glGetIntegerv(GL_STENCIL_REF, &stencil_ref_); | 134 glGetIntegerv(GL_STENCIL_REF, &stencil_ref_); |
| 134 | 135 |
| 136 glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &framebuffer_binding_ext_); |
| 137 GLSurfaceFactory::SetCurrentFBO(framebuffer_binding_ext_); |
| 135 | 138 |
| 136 if (!g_gl_max_texture_units) { | 139 if (!g_gl_max_texture_units) { |
| 137 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &g_gl_max_texture_units); | 140 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &g_gl_max_texture_units); |
| 138 DCHECK_GT(g_gl_max_texture_units, 0); | 141 DCHECK_GT(g_gl_max_texture_units, 0); |
| 139 } | 142 } |
| 140 | 143 |
| 141 glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture_); | 144 glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture_); |
| 142 | 145 |
| 143 texture_bindings_.resize(g_gl_max_texture_units); | 146 texture_bindings_.resize(g_gl_max_texture_units); |
| 144 for (int ii = 0; ii < g_gl_max_texture_units; ++ii) { | 147 for (int ii = 0; ii < g_gl_max_texture_units; ++ii) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 227 |
| 225 glScissor( | 228 glScissor( |
| 226 scissor_box_[0], scissor_box_[1], scissor_box_[2], scissor_box_[3]); | 229 scissor_box_[0], scissor_box_[1], scissor_box_[2], scissor_box_[3]); |
| 227 } | 230 } |
| 228 | 231 |
| 229 GLEnableDisable(GL_STENCIL_TEST, stencil_test_); | 232 GLEnableDisable(GL_STENCIL_TEST, stencil_test_); |
| 230 glStencilFunc(stencil_func_, stencil_mask_, stencil_ref_); | 233 glStencilFunc(stencil_func_, stencil_mask_, stencil_ref_); |
| 231 } | 234 } |
| 232 | 235 |
| 233 } // namespace android_webview | 236 } // namespace android_webview |
| OLD | NEW |