| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
| 6 #include "gpu/command_buffer/service/buffer_manager.h" | 6 #include "gpu/command_buffer/service/buffer_manager.h" |
| 7 #include "gpu/command_buffer/service/framebuffer_manager.h" | 7 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 8 #include "gpu/command_buffer/service/id_manager.h" | |
| 9 #include "gpu/command_buffer/service/program_manager.h" | 8 #include "gpu/command_buffer/service/program_manager.h" |
| 10 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 9 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 11 #include "gpu/command_buffer/service/shader_manager.h" | 10 #include "gpu/command_buffer/service/shader_manager.h" |
| 12 #include "gpu/command_buffer/service/texture_manager.h" | 11 #include "gpu/command_buffer/service/texture_manager.h" |
| 13 | 12 |
| 14 namespace gpu { | 13 namespace gpu { |
| 15 namespace gles2 { | 14 namespace gles2 { |
| 16 | 15 |
| 17 ContextGroup::ContextGroup() | 16 ContextGroup::ContextGroup() |
| 18 : initialized_(false), | 17 : initialized_(false), |
| 19 max_vertex_attribs_(0u), | 18 max_vertex_attribs_(0u), |
| 20 max_texture_units_(0u) { | 19 max_texture_units_(0u) { |
| 21 } | 20 } |
| 22 | 21 |
| 23 ContextGroup::~ContextGroup() { | 22 ContextGroup::~ContextGroup() { |
| 24 } | 23 } |
| 25 | 24 |
| 26 bool ContextGroup::Initialize() { | 25 bool ContextGroup::Initialize() { |
| 27 if (initialized_) { | 26 if (initialized_) { |
| 28 return true; | 27 return true; |
| 29 } | 28 } |
| 30 | 29 |
| 31 id_manager_.reset(new IdManager()); | |
| 32 buffer_manager_.reset(new BufferManager()); | 30 buffer_manager_.reset(new BufferManager()); |
| 33 framebuffer_manager_.reset(new FramebufferManager()); | 31 framebuffer_manager_.reset(new FramebufferManager()); |
| 34 renderbuffer_manager_.reset(new RenderbufferManager()); | 32 renderbuffer_manager_.reset(new RenderbufferManager()); |
| 35 shader_manager_.reset(new ShaderManager()); | 33 shader_manager_.reset(new ShaderManager()); |
| 36 program_manager_.reset(new ProgramManager()); | 34 program_manager_.reset(new ProgramManager()); |
| 37 | 35 |
| 38 // Lookup GL things we need to know. | 36 // Lookup GL things we need to know. |
| 39 GLint value; | 37 GLint value; |
| 40 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value); | 38 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value); |
| 41 max_vertex_attribs_ = value; | 39 max_vertex_attribs_ = value; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 54 texture_manager_.reset(new TextureManager(max_texture_size, | 52 texture_manager_.reset(new TextureManager(max_texture_size, |
| 55 max_cube_map_texture_size)); | 53 max_cube_map_texture_size)); |
| 56 initialized_ = true; | 54 initialized_ = true; |
| 57 return true; | 55 return true; |
| 58 } | 56 } |
| 59 | 57 |
| 60 } // namespace gles2 | 58 } // namespace gles2 |
| 61 } // namespace gpu | 59 } // namespace gpu |
| 62 | 60 |
| 63 | 61 |
| OLD | NEW |