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

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

Issue 7633060: Add option to not generate resources on bind in OpenGL ES (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nacl fix Created 9 years, 4 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
« no previous file with comments | « gpu/command_buffer/common/id_allocator.h ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 18 matching lines...) Expand all
29 class ShaderManager; 29 class ShaderManager;
30 class TextureManager; 30 class TextureManager;
31 struct DisallowedExtensions; 31 struct DisallowedExtensions;
32 32
33 // A Context Group helps manage multiple GLES2Decoders that share 33 // A Context Group helps manage multiple GLES2Decoders that share
34 // resources. 34 // resources.
35 class ContextGroup : public base::RefCounted<ContextGroup> { 35 class ContextGroup : public base::RefCounted<ContextGroup> {
36 public: 36 public:
37 typedef scoped_refptr<ContextGroup> Ref; 37 typedef scoped_refptr<ContextGroup> Ref;
38 38
39 ContextGroup(); 39 explicit ContextGroup(bool bind_generates_resource);
40 ~ContextGroup(); 40 ~ContextGroup();
41 41
42 // This should only be called by GLES2Decoder. 42 // This should only be called by GLES2Decoder.
43 bool Initialize(const DisallowedExtensions& disallowed_extensions, 43 bool Initialize(const DisallowedExtensions& disallowed_extensions,
44 const char* allowed_features); 44 const char* allowed_features);
45 45
46 // Sets the ContextGroup has having a lost context. 46 // Sets the ContextGroup has having a lost context.
47 void set_have_context(bool have_context) { 47 void set_have_context(bool have_context) {
48 have_context_ = have_context; 48 have_context_ = have_context;
49 } 49 }
50 50
51 bool bind_generates_resource() {
52 return bind_generates_resource_;
53 }
54
51 uint32 max_vertex_attribs() const { 55 uint32 max_vertex_attribs() const {
52 return max_vertex_attribs_; 56 return max_vertex_attribs_;
53 } 57 }
54 58
55 uint32 max_texture_units() const { 59 uint32 max_texture_units() const {
56 return max_texture_units_; 60 return max_texture_units_;
57 } 61 }
58 62
59 uint32 max_texture_image_units() const { 63 uint32 max_texture_image_units() const {
60 return max_texture_image_units_; 64 return max_texture_image_units_;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 110
107 IdAllocatorInterface* GetIdAllocator(unsigned namespace_id); 111 IdAllocatorInterface* GetIdAllocator(unsigned namespace_id);
108 112
109 private: 113 private:
110 // Destroys all the resources. 114 // Destroys all the resources.
111 void Destroy(); 115 void Destroy();
112 116
113 // Whether or not this context is initialized. 117 // Whether or not this context is initialized.
114 bool initialized_; 118 bool initialized_;
115 bool have_context_; 119 bool have_context_;
120 bool bind_generates_resource_;
116 121
117 uint32 max_vertex_attribs_; 122 uint32 max_vertex_attribs_;
118 uint32 max_texture_units_; 123 uint32 max_texture_units_;
119 uint32 max_texture_image_units_; 124 uint32 max_texture_image_units_;
120 uint32 max_vertex_texture_image_units_; 125 uint32 max_vertex_texture_image_units_;
121 uint32 max_fragment_uniform_vectors_; 126 uint32 max_fragment_uniform_vectors_;
122 uint32 max_varying_vectors_; 127 uint32 max_varying_vectors_;
123 uint32 max_vertex_uniform_vectors_; 128 uint32 max_vertex_uniform_vectors_;
124 129
125 scoped_ptr<BufferManager> buffer_manager_; 130 scoped_ptr<BufferManager> buffer_manager_;
(...skipping 15 matching lines...) Expand all
141 146
142 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 147 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
143 }; 148 };
144 149
145 } // namespace gles2 150 } // namespace gles2
146 } // namespace gpu 151 } // namespace gpu
147 152
148 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 153 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
149 154
150 155
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/id_allocator.h ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698