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

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 void GpuChildThread::StoreShaderToDisk(int32_t client_id, 358 void GpuChildThread::StoreShaderToDisk(int32_t client_id,
359 const std::string& key, 359 const std::string& key,
360 const std::string& shader) { 360 const std::string& shader) {
361 Send(new GpuHostMsg_CacheShader(client_id, key, shader)); 361 Send(new GpuHostMsg_CacheShader(client_id, key, shader));
362 } 362 }
363 363
364 void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) { 364 void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
365 gpu_preferences_ = gpu_preferences; 365 gpu_preferences_ = gpu_preferences;
366 366
367 gpu::GpuDriverBugWorkarounds::Initialize(
368 base::CommandLine::ForCurrentProcess(), gpu_driver_bug_workarounds_);
369
367 gpu_info_.video_decode_accelerator_capabilities = 370 gpu_info_.video_decode_accelerator_capabilities =
368 content::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); 371 content::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
369 gpu_info_.video_encode_accelerator_supported_profiles = 372 gpu_info_.video_encode_accelerator_supported_profiles =
370 content::GpuVideoEncodeAccelerator::GetSupportedProfiles( 373 content::GpuVideoEncodeAccelerator::GetSupportedProfiles(
371 gpu_preferences_); 374 gpu_preferences_);
372 gpu_info_.jpeg_decode_accelerator_supported = 375 gpu_info_.jpeg_decode_accelerator_supported =
373 content::GpuJpegDecodeAccelerator::IsSupported(); 376 content::GpuJpegDecodeAccelerator::IsSupported();
374 377
375 // Record initialization only after collecting the GPU info because that can 378 // Record initialization only after collecting the GPU info because that can
376 // take a significant amount of time. 379 // take a significant amount of time.
(...skipping 11 matching lines...) Expand all
388 } 391 }
389 392
390 // We don't need to pipe log messages if we are running the GPU thread in 393 // We don't need to pipe log messages if we are running the GPU thread in
391 // the browser process. 394 // the browser process.
392 if (!in_browser_process_) 395 if (!in_browser_process_)
393 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); 396 logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
394 397
395 // Defer creation of the render thread. This is to prevent it from handling 398 // Defer creation of the render thread. This is to prevent it from handling
396 // IPC messages before the sandbox has been enabled and all other necessary 399 // IPC messages before the sandbox has been enabled and all other necessary
397 // initialization has succeeded. 400 // initialization has succeeded.
398 gpu_channel_manager_.reset( 401 gpu_channel_manager_.reset(new GpuChannelManager(
399 new GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(), 402 gpu_preferences_, gpu_driver_bug_workarounds_, this,
400 base::ThreadTaskRunnerHandle::Get().get(), 403 watchdog_thread_.get(), base::ThreadTaskRunnerHandle::Get().get(),
401 ChildProcess::current()->io_task_runner(), 404 ChildProcess::current()->io_task_runner(),
402 ChildProcess::current()->GetShutDownEvent(), 405 ChildProcess::current()->GetShutDownEvent(), sync_point_manager_,
403 sync_point_manager_, gpu_memory_buffer_factory_)); 406 gpu_memory_buffer_factory_));
404 407
405 media_service_.reset(new MediaService(gpu_channel_manager_.get())); 408 media_service_.reset(new MediaService(gpu_channel_manager_.get()));
406 409
407 #if defined(USE_OZONE) 410 #if defined(USE_OZONE)
408 ui::OzonePlatform::GetInstance() 411 ui::OzonePlatform::GetInstance()
409 ->GetGpuPlatformSupport() 412 ->GetGpuPlatformSupport()
410 ->OnChannelEstablished(this); 413 ->OnChannelEstablished(this);
411 #endif 414 #endif
412 } 415 }
413 416
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 579
577 void GpuChildThread::BindProcessControlRequest( 580 void GpuChildThread::BindProcessControlRequest(
578 mojo::InterfaceRequest<mojom::ProcessControl> request) { 581 mojo::InterfaceRequest<mojom::ProcessControl> request) {
579 DVLOG(1) << "GPU: Binding ProcessControl request"; 582 DVLOG(1) << "GPU: Binding ProcessControl request";
580 DCHECK(process_control_); 583 DCHECK(process_control_);
581 process_control_bindings_.AddBinding(process_control_.get(), 584 process_control_bindings_.AddBinding(process_control_.get(),
582 std::move(request)); 585 std::move(request));
583 } 586 }
584 587
585 } // namespace content 588 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698