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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 217813004: Make ShaderTranslatorCache thread safe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: protect ShFinalize Created 6 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 | 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 if (!context->GetTotalGpuMemory(&total_gpu_memory_)) 486 if (!context->GetTotalGpuMemory(&total_gpu_memory_))
487 total_gpu_memory_ = 0; 487 total_gpu_memory_ = 0;
488 488
489 if (!context_group_->has_program_cache()) { 489 if (!context_group_->has_program_cache()) {
490 context_group_->set_program_cache( 490 context_group_->set_program_cache(
491 channel_->gpu_channel_manager()->program_cache()); 491 channel_->gpu_channel_manager()->program_cache());
492 } 492 }
493 493
494 // Initialize the decoder with either the view or pbuffer GLContext. 494 // Initialize the decoder with either the view or pbuffer GLContext.
495 if (!decoder_->Initialize(surface_, 495 if (!decoder_->Initialize(
496 context, 496 surface_,
497 !surface_id(), 497 context,
498 initial_size_, 498 channel_->gpu_channel_manager()->shader_translator_cache(),
499 disallowed_features_, 499 !surface_id(),
500 requested_attribs_)) { 500 initial_size_,
501 disallowed_features_,
502 requested_attribs_)) {
501 DLOG(ERROR) << "Failed to initialize decoder."; 503 DLOG(ERROR) << "Failed to initialize decoder.";
502 OnInitializeFailed(reply_message); 504 OnInitializeFailed(reply_message);
503 return; 505 return;
504 } 506 }
505 507
506 gpu_control_.reset( 508 gpu_control_.reset(
507 new gpu::GpuControlService(context_group_->image_manager(), 509 new gpu::GpuControlService(context_group_->image_manager(),
508 NULL, 510 NULL,
509 context_group_->mailbox_manager(), 511 context_group_->mailbox_manager(),
510 NULL, 512 NULL,
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 if (decoder_) 961 if (decoder_)
960 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 962 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
961 command_buffer_->SetParseError(gpu::error::kLostContext); 963 command_buffer_->SetParseError(gpu::error::kLostContext);
962 } 964 }
963 965
964 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 966 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
965 return GetMemoryManager()->GetClientMemoryUsage(this); 967 return GetMemoryManager()->GetClientMemoryUsage(this);
966 } 968 }
967 969
968 } // namespace content 970 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698