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

Side by Side Diff: services/ui/gpu/gpu_service.cc

Issue 2772193006: gpu: Replace GpuMsg_GpuSwitched with mojom api. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | services/ui/gpu/interfaces/gpu_service.mojom » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/gpu/gpu_service.h" 5 #include "services/ui/gpu/gpu_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 427 }
428 #if defined(OS_ANDROID) 428 #if defined(OS_ANDROID)
429 if (!gpu_channel_manager_) 429 if (!gpu_channel_manager_)
430 return; 430 return;
431 gpu_channel_manager_->WakeUpGpu(); 431 gpu_channel_manager_->WakeUpGpu();
432 #else 432 #else
433 NOTREACHED() << "WakeUpGpu() not supported on this platform."; 433 NOTREACHED() << "WakeUpGpu() not supported on this platform.";
434 #endif 434 #endif
435 } 435 }
436 436
437 void GpuService::GpuSwitched() {
438 DVLOG(1) << "GPU: GPU has switched";
439 if (!in_host_process_)
440 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched();
441 }
442
437 void GpuService::DestroyAllChannels() { 443 void GpuService::DestroyAllChannels() {
438 if (io_runner_->BelongsToCurrentThread()) { 444 if (io_runner_->BelongsToCurrentThread()) {
439 main_runner_->PostTask( 445 main_runner_->PostTask(
440 FROM_HERE, base::Bind(&GpuService::DestroyAllChannels, weak_ptr_)); 446 FROM_HERE, base::Bind(&GpuService::DestroyAllChannels, weak_ptr_));
441 return; 447 return;
442 } 448 }
443 if (!gpu_channel_manager_) 449 if (!gpu_channel_manager_)
444 return; 450 return;
445 DVLOG(1) << "GPU: Removing all contexts"; 451 DVLOG(1) << "GPU: Removing all contexts";
446 gpu_channel_manager_->DestroyAllChannels(); 452 gpu_channel_manager_->DestroyAllChannels();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 485
480 void GpuService::Stop(const StopCallback& callback) { 486 void GpuService::Stop(const StopCallback& callback) {
481 DCHECK(io_runner_->BelongsToCurrentThread()); 487 DCHECK(io_runner_->BelongsToCurrentThread());
482 main_runner_->PostTaskAndReply(FROM_HERE, base::Bind([] { 488 main_runner_->PostTaskAndReply(FROM_HERE, base::Bind([] {
483 base::MessageLoop::current()->QuitWhenIdle(); 489 base::MessageLoop::current()->QuitWhenIdle();
484 }), 490 }),
485 callback); 491 callback);
486 } 492 }
487 493
488 } // namespace ui 494 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | services/ui/gpu/interfaces/gpu_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698