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

Unified Diff: ui/gl/gpu_switching_manager.h

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ui/gl/gl_surface_win.cc ('k') | ui/gl/gpu_switching_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gpu_switching_manager.h
diff --git a/ui/gl/gpu_switching_manager.h b/ui/gl/gpu_switching_manager.h
index a097d9af681e1b9476bc059b6009d460fdcda72d..7e82d62481852762f55e091d3783acc92fb2922e 100644
--- a/ui/gl/gpu_switching_manager.h
+++ b/ui/gl/gpu_switching_manager.h
@@ -8,8 +8,10 @@
#include <vector>
#include "base/memory/singleton.h"
+#include "base/observer_list.h"
#include "ui/gl/gl_export.h"
#include "ui/gl/gpu_preference.h"
+#include "ui/gl/gpu_switching_observer.h"
#if defined(OS_MACOSX)
#include <OpenGL/OpenGL.h>
@@ -40,6 +42,16 @@ class GL_EXPORT GpuSwitchingManager {
void SetGpuCount(size_t gpu_count);
+ void AddObserver(GpuSwitchingObserver* observer);
+ void RemoveObserver(GpuSwitchingObserver* observer);
+
+ // Called when a GPU switch is noticed by the system. In the browser process
+ // this is occurs as a result of a system observer. In the GPU process, this
+ // occurs as a result of an IPC from the browser. The system observer is kept
+ // in the browser process only so that any workarounds or blacklisting can
+ // be applied there.
+ void NotifyGpuSwitched();
+
private:
friend struct DefaultSingletonTraits<GpuSwitchingManager>;
@@ -60,6 +72,8 @@ class GL_EXPORT GpuSwitchingManager {
size_t gpu_count_;
+ ObserverList<GpuSwitchingObserver> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager);
};
« no previous file with comments | « ui/gl/gl_surface_win.cc ('k') | ui/gl/gpu_switching_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698