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

Unified Diff: ui/gl/gpu_switching_manager.cc

Issue 10909221: Implement blacklist's force GPU capability in dual GPU machines. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« ui/gl/gl_switches.cc ('K') | « ui/gl/gpu_switching_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gpu_switching_manager.cc
===================================================================
--- ui/gl/gpu_switching_manager.cc (revision 0)
+++ ui/gl/gpu_switching_manager.cc (revision 0)
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/gpu_switching_manager.h"
+
+#include "base/logging.h"
+
+namespace gfx {
+
+// static
+GpuSwitchingManager* GpuSwitchingManager::GetInstance() {
+ return Singleton<GpuSwitchingManager>::get();
+}
+
+GpuSwitchingManager::GpuSwitchingManager() {
+}
+
+GpuSwitchingManager::~GpuSwitchingManager() {
+}
+
+void GpuSwitchingManager::ForceUseOfIntegratedGpu() {
+ gpu_switching_option_.clear();
+ gpu_switching_option_.push_back(PreferIntegratedGpu);
+}
+
+void GpuSwitchingManager::ForceUseOfDiscreteGpu() {
+ gpu_switching_option_.clear();
+ gpu_switching_option_.push_back(PreferDiscreteGpu);
+}
+
+GpuPreference GpuSwitchingManager::AdjustGpuPreference(
+ GpuPreference gpu_preference) {
+ if (gpu_switching_option_.size() == 0)
+ return gpu_preference;
+ DCHECK_EQ(gpu_switching_option_.size(), 1u);
+ return gpu_switching_option_[0];
+}
+
+} // namespace gfx
+
Property changes on: ui/gl/gpu_switching_manager.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« ui/gl/gl_switches.cc ('K') | « ui/gl/gpu_switching_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698