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

Unified Diff: ui/gl/gpu_switching_manager.h

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
Index: ui/gl/gpu_switching_manager.h
===================================================================
--- ui/gl/gpu_switching_manager.h (revision 0)
+++ ui/gl/gpu_switching_manager.h (revision 0)
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef UI_GL_GPU_SWITCHING_MANAGER_H_
+#define UI_GL_GPU_SWITCHING_MANAGER_H_
+
+#include <vector>
+
+#include "base/memory/singleton.h"
+#include "ui/gl/gl_export.h"
+#include "ui/gl/gpu_preference.h"
+
+namespace gfx {
+
+class GL_EXPORT GpuSwitchingManager {
+ public:
+ // Getter for the singleton. This will return NULL on failure.
+ static GpuSwitchingManager* GetInstance();
+
+ // Set the switching option, but don't take any actions until later
+ // we access GPU.
+ void ForceUseOfIntegratedGpu();
+ void ForceUseOfDiscreteGpu();
+
+ // Adjust GpuPreference based on the current switching option.
+ // If none is set, return the original GpuPreference.
+ GpuPreference AdjustGpuPreference(GpuPreference gpu_preference);
+
+ private:
+ friend struct DefaultSingletonTraits<GpuSwitchingManager>;
+
+ GpuSwitchingManager();
+ virtual ~GpuSwitchingManager();
+
+ std::vector<GpuPreference> gpu_switching_option_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_GPU_SWITCHING_MANAGER_H_
+
Property changes on: ui/gl/gpu_switching_manager.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« ui/gl/gl_switches.cc ('K') | « ui/gl/gl_switches.cc ('k') | ui/gl/gpu_switching_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698