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

Side by Side Diff: mojo/services/gles2/command_buffer_driver.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits_multi.h ('k') | mojo/tools/roll/cc_strip_video.patch » ('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 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 "mojo/services/gles2/command_buffer_driver.h" 5 #include "mojo/services/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 "gpu/command_buffer/common/constants.h" 10 #include "gpu/command_buffer/common/constants.h"
11 #include "gpu/command_buffer/common/value_state.h"
11 #include "gpu/command_buffer/service/command_buffer_service.h" 12 #include "gpu/command_buffer/service/command_buffer_service.h"
12 #include "gpu/command_buffer/service/context_group.h" 13 #include "gpu/command_buffer/service/context_group.h"
13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 14 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
14 #include "gpu/command_buffer/service/gpu_scheduler.h" 15 #include "gpu/command_buffer/service/gpu_scheduler.h"
15 #include "gpu/command_buffer/service/image_manager.h" 16 #include "gpu/command_buffer/service/image_manager.h"
16 #include "gpu/command_buffer/service/mailbox_manager.h" 17 #include "gpu/command_buffer/service/mailbox_manager.h"
17 #include "gpu/command_buffer/service/memory_tracking.h" 18 #include "gpu/command_buffer/service/memory_tracking.h"
18 #include "gpu/command_buffer/service/sync_point_manager.h" 19 #include "gpu/command_buffer/service/sync_point_manager.h"
19 #include "mojo/services/gles2/command_buffer_type_conversions.h" 20 #include "mojo/services/gles2/command_buffer_type_conversions.h"
20 #include "mojo/services/gles2/mojo_buffer_backing.h" 21 #include "mojo/services/gles2/mojo_buffer_backing.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return false; 113 return false;
113 114
114 if (!context_->MakeCurrent(surface_.get())) 115 if (!context_->MakeCurrent(surface_.get()))
115 return false; 116 return false;
116 117
117 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but 118 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but
118 // only needs to be per-thread. 119 // only needs to be per-thread.
119 scoped_refptr<gpu::gles2::ContextGroup> context_group = 120 scoped_refptr<gpu::gles2::ContextGroup> context_group =
120 new gpu::gles2::ContextGroup( 121 new gpu::gles2::ContextGroup(
121 mailbox_manager_.get(), new MemoryTrackerStub, 122 mailbox_manager_.get(), new MemoryTrackerStub,
122 new gpu::gles2::ShaderTranslatorCache, nullptr, true); 123 new gpu::gles2::ShaderTranslatorCache, nullptr, nullptr, true);
123 124
124 command_buffer_.reset( 125 command_buffer_.reset(
125 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); 126 new gpu::CommandBufferService(context_group->transfer_buffer_manager()));
126 bool result = command_buffer_->Initialize(); 127 bool result = command_buffer_->Initialize();
127 DCHECK(result); 128 DCHECK(result);
128 129
129 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); 130 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get()));
130 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(), 131 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), decoder_.get(),
131 decoder_.get())); 132 decoder_.get()));
132 decoder_->set_engine(scheduler_.get()); 133 decoder_->set_engine(scheduler_.get());
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 client_->LostContext(reason); 234 client_->LostContext(reason);
234 } 235 }
235 236
236 void CommandBufferDriver::OnUpdateVSyncParameters( 237 void CommandBufferDriver::OnUpdateVSyncParameters(
237 const base::TimeTicks timebase, 238 const base::TimeTicks timebase,
238 const base::TimeDelta interval) { 239 const base::TimeDelta interval) {
239 client_->UpdateVSyncParameters(timebase, interval); 240 client_->UpdateVSyncParameters(timebase, interval);
240 } 241 }
241 242
242 } // namespace mojo 243 } // namespace mojo
OLDNEW
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits_multi.h ('k') | mojo/tools/roll/cc_strip_video.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698