Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: gpu/command_buffer/service/context_group.cc

Issue 10441140: Make context groups share a TextureBufferManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "gpu/command_buffer/common/id_allocator.h" 11 #include "gpu/command_buffer/common/id_allocator.h"
12 #include "gpu/command_buffer/service/buffer_manager.h" 12 #include "gpu/command_buffer/service/buffer_manager.h"
13 #include "gpu/command_buffer/service/framebuffer_manager.h" 13 #include "gpu/command_buffer/service/framebuffer_manager.h"
14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
15 #include "gpu/command_buffer/service/gpu_switches.h" 15 #include "gpu/command_buffer/service/gpu_switches.h"
16 #include "gpu/command_buffer/service/mailbox_manager.h" 16 #include "gpu/command_buffer/service/mailbox_manager.h"
17 #include "gpu/command_buffer/service/program_manager.h" 17 #include "gpu/command_buffer/service/program_manager.h"
18 #include "gpu/command_buffer/service/renderbuffer_manager.h" 18 #include "gpu/command_buffer/service/renderbuffer_manager.h"
19 #include "gpu/command_buffer/service/shader_manager.h" 19 #include "gpu/command_buffer/service/shader_manager.h"
20 #include "gpu/command_buffer/service/texture_manager.h" 20 #include "gpu/command_buffer/service/texture_manager.h"
21 #include "gpu/command_buffer/service/transfer_buffer_manager.h"
21 #include "ui/gl/gl_implementation.h" 22 #include "ui/gl/gl_implementation.h"
22 23
23 namespace gpu { 24 namespace gpu {
24 namespace gles2 { 25 namespace gles2 {
25 26
26 ContextGroup::ContextGroup(MailboxManager* mailbox_manager, 27 ContextGroup::ContextGroup(
27 bool bind_generates_resource) 28 MailboxManager* mailbox_manager,
29 bool bind_generates_resource)
28 : mailbox_manager_(mailbox_manager ? mailbox_manager : new MailboxManager), 30 : mailbox_manager_(mailbox_manager ? mailbox_manager : new MailboxManager),
29 num_contexts_(0), 31 num_contexts_(0),
30 enforce_gl_minimums_(CommandLine::ForCurrentProcess()->HasSwitch( 32 enforce_gl_minimums_(CommandLine::ForCurrentProcess()->HasSwitch(
31 switches::kEnforceGLMinimums)), 33 switches::kEnforceGLMinimums)),
32 bind_generates_resource_(bind_generates_resource), 34 bind_generates_resource_(bind_generates_resource),
33 max_vertex_attribs_(0u), 35 max_vertex_attribs_(0u),
34 max_texture_units_(0u), 36 max_texture_units_(0u),
35 max_texture_image_units_(0u), 37 max_texture_image_units_(0u),
36 max_vertex_texture_image_units_(0u), 38 max_vertex_texture_image_units_(0u),
37 max_fragment_uniform_vectors_(0u), 39 max_fragment_uniform_vectors_(0u),
38 max_varying_vectors_(0u), 40 max_varying_vectors_(0u),
39 max_vertex_uniform_vectors_(0u), 41 max_vertex_uniform_vectors_(0u),
40 feature_info_(new FeatureInfo()) { 42 feature_info_(new FeatureInfo()) {
43 {
44 TransferBufferManager* manager = new TransferBufferManager();
45 transfer_buffer_manager_.reset(manager);
46 manager->Initialize();
47 }
48
41 id_namespaces_[id_namespaces::kBuffers].reset(new IdAllocator); 49 id_namespaces_[id_namespaces::kBuffers].reset(new IdAllocator);
42 id_namespaces_[id_namespaces::kFramebuffers].reset(new IdAllocator); 50 id_namespaces_[id_namespaces::kFramebuffers].reset(new IdAllocator);
43 id_namespaces_[id_namespaces::kProgramsAndShaders].reset( 51 id_namespaces_[id_namespaces::kProgramsAndShaders].reset(
44 new NonReusedIdAllocator); 52 new NonReusedIdAllocator);
45 id_namespaces_[id_namespaces::kRenderbuffers].reset(new IdAllocator); 53 id_namespaces_[id_namespaces::kRenderbuffers].reset(new IdAllocator);
46 id_namespaces_[id_namespaces::kTextures].reset(new IdAllocator); 54 id_namespaces_[id_namespaces::kTextures].reset(new IdAllocator);
47 id_namespaces_[id_namespaces::kQueries].reset(new IdAllocator); 55 id_namespaces_[id_namespaces::kQueries].reset(new IdAllocator);
48 } 56 }
49 57
50 static void GetIntegerv(GLenum pname, uint32* var) { 58 static void GetIntegerv(GLenum pname, uint32* var) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 GetIntegerv(pname, &value); 275 GetIntegerv(pname, &value);
268 bool result = CheckGLFeatureU(min_required, &value); 276 bool result = CheckGLFeatureU(min_required, &value);
269 *v = value; 277 *v = value;
270 return result; 278 return result;
271 } 279 }
272 280
273 } // namespace gles2 281 } // namespace gles2
274 } // namespace gpu 282 } // namespace gpu
275 283
276 284
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698