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

Side by Side Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 2286873003: Provide TaskRunner to ContextCacheController (Closed)
Patch Set: feedback Created 4 years, 3 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 "gpu/command_buffer/service/in_process_command_buffer.h" 5 #include "gpu/command_buffer/service/in_process_command_buffer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 executor_->PutChanged(); 249 executor_->PutChanged();
250 } 250 }
251 251
252 bool InProcessCommandBuffer::Initialize( 252 bool InProcessCommandBuffer::Initialize(
253 scoped_refptr<gl::GLSurface> surface, 253 scoped_refptr<gl::GLSurface> surface,
254 bool is_offscreen, 254 bool is_offscreen,
255 gfx::AcceleratedWidget window, 255 gfx::AcceleratedWidget window,
256 const gles2::ContextCreationAttribHelper& attribs, 256 const gles2::ContextCreationAttribHelper& attribs,
257 InProcessCommandBuffer* share_group, 257 InProcessCommandBuffer* share_group,
258 GpuMemoryBufferManager* gpu_memory_buffer_manager, 258 GpuMemoryBufferManager* gpu_memory_buffer_manager,
259 ImageFactory* image_factory) { 259 ImageFactory* image_factory,
260 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
260 DCHECK(!share_group || service_.get() == share_group->service_.get()); 261 DCHECK(!share_group || service_.get() == share_group->service_.get());
261 262
262 if (surface) { 263 if (surface) {
264 // If a surface is provided, we are running in a webview and should not have
265 // a task runner.
266 DCHECK(!task_runner);
267
263 // GPU thread must be the same as client thread due to GLSurface not being 268 // GPU thread must be the same as client thread due to GLSurface not being
264 // thread safe. 269 // thread safe.
265 sequence_checker_.reset(new base::SequenceChecker); 270 sequence_checker_.reset(new base::SequenceChecker);
266 surface_ = surface; 271 surface_ = surface;
267 } else { 272 } else {
268 origin_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 273 DCHECK(task_runner);
274 origin_task_runner_ = std::move(task_runner);
269 client_thread_weak_ptr_ = client_thread_weak_ptr_factory_.GetWeakPtr(); 275 client_thread_weak_ptr_ = client_thread_weak_ptr_factory_.GetWeakPtr();
270 } 276 }
271 277
272 gpu::Capabilities capabilities; 278 gpu::Capabilities capabilities;
273 InitializeOnGpuThreadParams params(is_offscreen, window, attribs, 279 InitializeOnGpuThreadParams params(is_offscreen, window, attribs,
274 &capabilities, share_group, image_factory); 280 &capabilities, share_group, image_factory);
275 281
276 base::Callback<bool(void)> init_task = 282 base::Callback<bool(void)> init_task =
277 base::Bind(&InProcessCommandBuffer::InitializeOnGpuThread, 283 base::Bind(&InProcessCommandBuffer::InitializeOnGpuThread,
278 base::Unretained(this), params); 284 base::Unretained(this), params);
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 framebuffer_completeness_cache_ = 1062 framebuffer_completeness_cache_ =
1057 new gpu::gles2::FramebufferCompletenessCache; 1063 new gpu::gles2::FramebufferCompletenessCache;
1058 return framebuffer_completeness_cache_; 1064 return framebuffer_completeness_cache_;
1059 } 1065 }
1060 1066
1061 SyncPointManager* GpuInProcessThread::sync_point_manager() { 1067 SyncPointManager* GpuInProcessThread::sync_point_manager() {
1062 return sync_point_manager_; 1068 return sync_point_manager_;
1063 } 1069 }
1064 1070
1065 } // namespace gpu 1071 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698