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

Side by Side Diff: components/view_manager/gles2/command_buffer_driver.cc

Issue 1278333003: Fix crash caused by concurrent access to framebuffer_combo_complete_map_. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments; return unittesting of cache behaviour. Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/view_manager/gles2/command_buffer_driver.h" 5 #include "components/view_manager/gles2/command_buffer_driver.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "components/view_manager/gles2/command_buffer_type_conversions.h" 10 #include "components/view_manager/gles2/command_buffer_type_conversions.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 if (!context_->MakeCurrent(surface_.get())) 111 if (!context_->MakeCurrent(surface_.get()))
112 return false; 112 return false;
113 113
114 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but 114 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but
115 // only needs to be per-thread. 115 // only needs to be per-thread.
116 bool bind_generates_resource = false; 116 bool bind_generates_resource = false;
117 scoped_refptr<gpu::gles2::ContextGroup> context_group = 117 scoped_refptr<gpu::gles2::ContextGroup> context_group =
118 new gpu::gles2::ContextGroup( 118 new gpu::gles2::ContextGroup(
119 gpu_state_->mailbox_manager(), new GpuMemoryTracker, 119 gpu_state_->mailbox_manager(), new GpuMemoryTracker,
120 new gpu::gles2::ShaderTranslatorCache, nullptr, nullptr, nullptr, 120 new gpu::gles2::ShaderTranslatorCache,
121 bind_generates_resource); 121 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr,
122 nullptr, bind_generates_resource);
122 123
123 command_buffer_.reset( 124 command_buffer_.reset(
124 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); 125 new gpu::CommandBufferService(context_group->transfer_buffer_manager()));
125 bool result = command_buffer_->Initialize(); 126 bool result = command_buffer_->Initialize();
126 DCHECK(result); 127 DCHECK(result);
127 128
128 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); 129 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get()));
129 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), 130 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(),
130 decoder_.get())); 131 decoder_.get()));
131 decoder_->set_engine(scheduler_.get()); 132 decoder_->set_engine(scheduler_.get());
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 334
334 void CommandBufferDriver::DestroyDecoder() { 335 void CommandBufferDriver::DestroyDecoder() {
335 if (decoder_) { 336 if (decoder_) {
336 bool have_context = decoder_->MakeCurrent(); 337 bool have_context = decoder_->MakeCurrent();
337 decoder_->Destroy(have_context); 338 decoder_->Destroy(have_context);
338 decoder_.reset(); 339 decoder_.reset();
339 } 340 }
340 } 341 }
341 342
342 } // namespace gles2 343 } // namespace gles2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698