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" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 } // anonymous namespace. | 81 } // anonymous namespace. |
82 | 82 |
83 TextureUnit::TextureUnit() | 83 TextureUnit::TextureUnit() |
84 : bind_target(GL_TEXTURE_2D) { | 84 : bind_target(GL_TEXTURE_2D) { |
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, Logger* logger) |
91 ErrorStateClient* error_state_client, | |
92 Logger* logger) | |
93 : active_texture_unit(0), | 91 : active_texture_unit(0), |
94 pack_reverse_row_order(false), | 92 pack_reverse_row_order(false), |
95 fbo_binding_for_scissor_workaround_dirty_(false), | 93 fbo_binding_for_scissor_workaround_dirty_(false), |
96 feature_info_(feature_info), | 94 feature_info_(feature_info), |
97 error_state_(ErrorState::Create(error_state_client, logger)) { | 95 error_state_(ErrorState::Create(logger)) { |
98 Initialize(); | 96 Initialize(); |
99 } | 97 } |
100 | 98 |
101 ContextState::~ContextState() { | 99 ContextState::~ContextState() { |
102 } | 100 } |
103 | 101 |
104 void ContextState::RestoreTextureUnitBindings( | 102 void ContextState::RestoreTextureUnitBindings( |
105 GLuint unit, const ContextState* prev_state) const { | 103 GLuint unit, const ContextState* prev_state) const { |
106 DCHECK_LT(unit, texture_units.size()); | 104 DCHECK_LT(unit, texture_units.size()); |
107 const TextureUnit& texture_unit = texture_units[unit]; | 105 const TextureUnit& texture_unit = texture_units[unit]; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 242 |
245 // Include the auto-generated part of this file. We split this because it means | 243 // Include the auto-generated part of this file. We split this because it means |
246 // we can easily edit the non-auto generated parts right here in this file | 244 // we can easily edit the non-auto generated parts right here in this file |
247 // instead of having to edit some template or the code generator. | 245 // instead of having to edit some template or the code generator. |
248 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 246 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
249 | 247 |
250 } // namespace gles2 | 248 } // namespace gles2 |
251 } // namespace gpu | 249 } // namespace gpu |
252 | 250 |
253 | 251 |
OLD | NEW |