| 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_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 draw_buffer_ = GL_BACK; | 121 draw_buffer_ = GL_BACK; |
| 122 } | 122 } |
| 123 | 123 |
| 124 buffer_manager_.reset( | 124 buffer_manager_.reset( |
| 125 new BufferManager(memory_tracker_.get(), feature_info_.get())); | 125 new BufferManager(memory_tracker_.get(), feature_info_.get())); |
| 126 framebuffer_manager_.reset( | 126 framebuffer_manager_.reset( |
| 127 new FramebufferManager(max_draw_buffers_, max_color_attachments_)); | 127 new FramebufferManager(max_draw_buffers_, max_color_attachments_)); |
| 128 renderbuffer_manager_.reset(new RenderbufferManager( | 128 renderbuffer_manager_.reset(new RenderbufferManager( |
| 129 memory_tracker_.get(), max_renderbuffer_size, max_samples)); | 129 memory_tracker_.get(), max_renderbuffer_size, max_samples)); |
| 130 shader_manager_.reset(new ShaderManager()); | 130 shader_manager_.reset(new ShaderManager()); |
| 131 program_manager_.reset(new ProgramManager(program_cache_)); | |
| 132 | 131 |
| 133 // Lookup GL things we need to know. | 132 // Lookup GL things we need to know. |
| 134 const GLint kGLES2RequiredMinimumVertexAttribs = 8u; | 133 const GLint kGLES2RequiredMinimumVertexAttribs = 8u; |
| 135 if (!QueryGLFeatureU( | 134 if (!QueryGLFeatureU( |
| 136 GL_MAX_VERTEX_ATTRIBS, kGLES2RequiredMinimumVertexAttribs, | 135 GL_MAX_VERTEX_ATTRIBS, kGLES2RequiredMinimumVertexAttribs, |
| 137 &max_vertex_attribs_)) { | 136 &max_vertex_attribs_)) { |
| 138 LOG(ERROR) << "ContextGroup::Initialize failed because too few " | 137 LOG(ERROR) << "ContextGroup::Initialize failed because too few " |
| 139 << "vertex attributes supported."; | 138 << "vertex attributes supported."; |
| 140 return false; | 139 return false; |
| 141 } | 140 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 std::min(static_cast<uint32>(kMinFragmentUniformVectors * 2), | 227 std::min(static_cast<uint32>(kMinFragmentUniformVectors * 2), |
| 229 max_fragment_uniform_vectors_); | 228 max_fragment_uniform_vectors_); |
| 230 max_varying_vectors_ = | 229 max_varying_vectors_ = |
| 231 std::min(static_cast<uint32>(kMinVaryingVectors * 2), | 230 std::min(static_cast<uint32>(kMinVaryingVectors * 2), |
| 232 max_varying_vectors_); | 231 max_varying_vectors_); |
| 233 max_vertex_uniform_vectors_ = | 232 max_vertex_uniform_vectors_ = |
| 234 std::min(static_cast<uint32>(kMinVertexUniformVectors * 2), | 233 std::min(static_cast<uint32>(kMinVertexUniformVectors * 2), |
| 235 max_vertex_uniform_vectors_); | 234 max_vertex_uniform_vectors_); |
| 236 } | 235 } |
| 237 | 236 |
| 237 program_manager_.reset(new ProgramManager( |
| 238 program_cache_, max_varying_vectors_)); |
| 239 |
| 238 if (!texture_manager_->Initialize()) { | 240 if (!texture_manager_->Initialize()) { |
| 239 LOG(ERROR) << "Context::Group::Initialize failed because texture manager " | 241 LOG(ERROR) << "Context::Group::Initialize failed because texture manager " |
| 240 << "failed to initialize."; | 242 << "failed to initialize."; |
| 241 return false; | 243 return false; |
| 242 } | 244 } |
| 243 | 245 |
| 244 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); | 246 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); |
| 245 return true; | 247 return true; |
| 246 } | 248 } |
| 247 | 249 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 GLenum pname, GLint min_required, uint32* v) { | 379 GLenum pname, GLint min_required, uint32* v) { |
| 378 uint32 value = 0; | 380 uint32 value = 0; |
| 379 GetIntegerv(pname, &value); | 381 GetIntegerv(pname, &value); |
| 380 bool result = CheckGLFeatureU(min_required, &value); | 382 bool result = CheckGLFeatureU(min_required, &value); |
| 381 *v = value; | 383 *v = value; |
| 382 return result; | 384 return result; |
| 383 } | 385 } |
| 384 | 386 |
| 385 } // namespace gles2 | 387 } // namespace gles2 |
| 386 } // namespace gpu | 388 } // namespace gpu |
| OLD | NEW |