| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/context_state.h" | 5 #include "gpu/command_buffer/service/context_state.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 8 #include "gpu/command_buffer/service/buffer_manager.h" | 8 #include "gpu/command_buffer/service/buffer_manager.h" |
| 9 #include "gpu/command_buffer/service/error_state.h" | 9 #include "gpu/command_buffer/service/error_state.h" |
| 10 #include "gpu/command_buffer/service/framebuffer_manager.h" | 10 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 11 #include "gpu/command_buffer/service/program_manager.h" | 11 #include "gpu/command_buffer/service/program_manager.h" |
| 12 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 12 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 13 #include "ui/gl/gl_bindings.h" | 13 #include "ui/gl/gl_bindings.h" |
| 14 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 15 | 15 |
| 16 namespace gpu { | 16 namespace gpu { |
| 17 namespace gles2 { | 17 namespace gles2 { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 static void EnableDisable(GLenum pname, bool enable) { | 21 void EnableDisable(GLenum pname, bool enable) { |
| 22 if (enable) { | 22 if (enable) { |
| 23 glEnable(pname); | 23 glEnable(pname); |
| 24 } else { | 24 } else { |
| 25 glDisable(pname); | 25 glDisable(pname); |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| 29 GLuint Get2dServiceId(const TextureUnit& unit) { | 29 GLuint Get2dServiceId(const TextureUnit& unit) { |
| 30 return unit.bound_texture_2d.get() | 30 return unit.bound_texture_2d.get() |
| 31 ? unit.bound_texture_2d->service_id() : 0; | 31 ? unit.bound_texture_2d->service_id() : 0; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 TextureUnit::~TextureUnit() { | 87 TextureUnit::~TextureUnit() { |
| 88 } | 88 } |
| 89 | 89 |
| 90 ContextState::ContextState(FeatureInfo* feature_info, | 90 ContextState::ContextState(FeatureInfo* feature_info, |
| 91 ErrorStateClient* error_state_client, | 91 ErrorStateClient* error_state_client, |
| 92 Logger* logger) | 92 Logger* logger) |
| 93 : active_texture_unit(0), | 93 : active_texture_unit(0), |
| 94 pack_reverse_row_order(false), | 94 pack_reverse_row_order(false), |
| 95 ignore_cached_state(false), | |
| 96 fbo_binding_for_scissor_workaround_dirty_(false), | 95 fbo_binding_for_scissor_workaround_dirty_(false), |
| 97 feature_info_(feature_info), | 96 feature_info_(feature_info), |
| 98 error_state_(ErrorState::Create(error_state_client, logger)) { | 97 error_state_(ErrorState::Create(error_state_client, logger)) { |
| 99 Initialize(); | 98 Initialize(); |
| 100 } | 99 } |
| 101 | 100 |
| 102 ContextState::~ContextState() { | 101 ContextState::~ContextState() { |
| 103 } | 102 } |
| 104 | 103 |
| 105 void ContextState::RestoreTextureUnitBindings( | 104 void ContextState::RestoreTextureUnitBindings( |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 291 |
| 293 // Include the auto-generated part of this file. We split this because it means | 292 // Include the auto-generated part of this file. We split this because it means |
| 294 // we can easily edit the non-auto generated parts right here in this file | 293 // we can easily edit the non-auto generated parts right here in this file |
| 295 // instead of having to edit some template or the code generator. | 294 // instead of having to edit some template or the code generator. |
| 296 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 295 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
| 297 | 296 |
| 298 } // namespace gles2 | 297 } // namespace gles2 |
| 299 } // namespace gpu | 298 } // namespace gpu |
| 300 | 299 |
| 301 | 300 |
| OLD | NEW |