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

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

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
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 #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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void LoseContexts(GLenum reset_status); 170 void LoseContexts(GLenum reset_status);
171 171
172 // EXT_draw_buffer related states for backbuffer. 172 // EXT_draw_buffer related states for backbuffer.
173 GLenum draw_buffer() const { 173 GLenum draw_buffer() const {
174 return draw_buffer_; 174 return draw_buffer_;
175 } 175 }
176 void set_draw_buffer(GLenum buf) { 176 void set_draw_buffer(GLenum buf) {
177 draw_buffer_ = buf; 177 draw_buffer_ = buf;
178 } 178 }
179 179
180 void AddBufferId(GLuint client_id, GLuint service_id) {
181 buffers_id_map_[client_id] = service_id;
182 }
183
184 bool GetBufferServiceId(GLuint client_id, GLuint* service_id) const {
185 std::map<GLuint, GLuint>::const_iterator iter =
186 buffers_id_map_.find(client_id);
187 if (iter == buffers_id_map_.end())
188 return false;
189 if (service_id)
190 *service_id = iter->second;
191 return true;
192 }
193
194 void RemoveBufferId(GLuint client_id) {
195 buffers_id_map_.erase(client_id);
196 }
197
180 void AddSamplerId(GLuint client_id, GLuint service_id) { 198 void AddSamplerId(GLuint client_id, GLuint service_id) {
181 samplers_id_map_[client_id] = service_id; 199 samplers_id_map_[client_id] = service_id;
182 } 200 }
183 201
184 bool GetSamplerServiceId(GLuint client_id, GLuint* service_id) const { 202 bool GetSamplerServiceId(GLuint client_id, GLuint* service_id) const {
185 std::map<GLuint, GLuint>::const_iterator iter = 203 std::map<GLuint, GLuint>::const_iterator iter =
186 samplers_id_map_.find(client_id); 204 samplers_id_map_.find(client_id);
187 if (iter == samplers_id_map_.end()) 205 if (iter == samplers_id_map_.end())
188 return false; 206 return false;
189 if (service_id) 207 if (service_id)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 276
259 scoped_ptr<ShaderManager> shader_manager_; 277 scoped_ptr<ShaderManager> shader_manager_;
260 278
261 scoped_ptr<ValuebufferManager> valuebuffer_manager_; 279 scoped_ptr<ValuebufferManager> valuebuffer_manager_;
262 280
263 scoped_refptr<FeatureInfo> feature_info_; 281 scoped_refptr<FeatureInfo> feature_info_;
264 282
265 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; 283 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_;
266 284
267 // Mappings from client side IDs to service side IDs. 285 // Mappings from client side IDs to service side IDs.
286 std::map<GLuint, GLuint> buffers_id_map_;
268 std::map<GLuint, GLuint> samplers_id_map_; 287 std::map<GLuint, GLuint> samplers_id_map_;
269 std::map<GLuint, GLuint> transformfeedbacks_id_map_; 288 std::map<GLuint, GLuint> transformfeedbacks_id_map_;
270 289
271 GLenum draw_buffer_; 290 GLenum draw_buffer_;
272 291
273 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 292 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
274 }; 293 };
275 294
276 } // namespace gles2 295 } // namespace gles2
277 } // namespace gpu 296 } // namespace gpu
278 297
279 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 298 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
280 299
281 300
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698