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

Side by Side Diff: gpu/command_buffer/client/share_group.cc

Issue 2826043002: Do not share FBOs/VAOs/Transform feedback objects across contexts (Closed)
Patch Set: FBOs/VAOs should not be shared between contexts Created 3 years, 8 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 #include "gpu/command_buffer/client/share_group.h" 5 #include "gpu/command_buffer/client/share_group.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <stack> 9 #include <stack>
10 #include <vector> 10 #include <vector>
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 private: 346 private:
347 base::Lock lock_; 347 base::Lock lock_;
348 IdAllocator id_allocator_; 348 IdAllocator id_allocator_;
349 }; 349 };
350 350
351 ShareGroup::ShareGroup(bool bind_generates_resource, uint64_t tracing_guid) 351 ShareGroup::ShareGroup(bool bind_generates_resource, uint64_t tracing_guid)
352 : bind_generates_resource_(bind_generates_resource), 352 : bind_generates_resource_(bind_generates_resource),
353 tracing_guid_(tracing_guid) { 353 tracing_guid_(tracing_guid) {
354 if (bind_generates_resource) { 354 if (bind_generates_resource) {
355 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { 355 for (int i = 0; i < id_namespaces::kNumSharedIdNamespaces; ++i) {
356 if (i == id_namespaces::kProgramsAndShaders) { 356 if (i == id_namespaces::kProgramsAndShaders) {
357 id_handlers_[i].reset(new NonReusedIdHandler()); 357 id_handlers_[i].reset(new NonReusedIdHandler());
358 } else { 358 } else {
359 id_handlers_[i].reset(new IdHandler()); 359 id_handlers_[i].reset(new IdHandler());
360 } 360 }
361 } 361 }
362 } else { 362 } else {
363 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { 363 for (int i = 0; i < id_namespaces::kNumSharedIdNamespaces; ++i) {
364 if (i == id_namespaces::kProgramsAndShaders) { 364 if (i == id_namespaces::kProgramsAndShaders) {
365 id_handlers_[i].reset(new NonReusedIdHandler()); 365 id_handlers_[i].reset(new NonReusedIdHandler());
366 } else { 366 } else {
367 id_handlers_[i].reset(new StrictIdHandler(i)); 367 id_handlers_[i].reset(new StrictIdHandler(i));
368 } 368 }
369 } 369 }
370 } 370 }
371 program_info_manager_.reset(new ProgramInfoManager); 371 program_info_manager_.reset(new ProgramInfoManager);
372 for (auto& range_id_handler : range_id_handlers_) { 372 for (auto& range_id_handler : range_id_handlers_) {
373 range_id_handler.reset(new RangeIdHandler()); 373 range_id_handler.reset(new RangeIdHandler());
(...skipping 11 matching lines...) Expand all
385 } 385 }
386 386
387 void ShareGroup::SetProgramInfoManagerForTesting(ProgramInfoManager* manager) { 387 void ShareGroup::SetProgramInfoManagerForTesting(ProgramInfoManager* manager) {
388 program_info_manager_.reset(manager); 388 program_info_manager_.reset(manager);
389 } 389 }
390 390
391 ShareGroup::~ShareGroup() {} 391 ShareGroup::~ShareGroup() {}
392 392
393 } // namespace gles2 393 } // namespace gles2
394 } // namespace gpu 394 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698