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

Unified Diff: content/browser/renderer_host/compositing_iosurface_context_mac.h

Issue 231863002: Mac: Recreate browser-side GL contexts on GPU switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/compositing_iosurface_context_mac.h
diff --git a/content/browser/renderer_host/compositing_iosurface_context_mac.h b/content/browser/renderer_host/compositing_iosurface_context_mac.h
index bd9a17381d5b8ad0cf44e4eed9beaf52327054d4..2904178ca396b307184cbf65cbe4e34b12801546 100644
--- a/content/browser/renderer_host/compositing_iosurface_context_mac.h
+++ b/content/browser/renderer_host/compositing_iosurface_context_mac.h
@@ -14,6 +14,7 @@
#include "base/mac/scoped_nsobject.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/gpu_data_manager_observer.h"
#include "ui/gl/scoped_cgl.h"
namespace content {
@@ -27,7 +28,8 @@ CoreAnimationStatus GetCoreAnimationStatus();
class CompositingIOSurfaceShaderPrograms;
class CompositingIOSurfaceContext
- : public base::RefCounted<CompositingIOSurfaceContext> {
+ : public base::RefCounted<CompositingIOSurfaceContext>,
+ public content::GpuDataManagerObserver {
public:
enum {
// The number used to look up the context used for async readback and for
@@ -58,6 +60,9 @@ class CompositingIOSurfaceContext
bool is_vsync_disabled() const { return is_vsync_disabled_; }
int window_number() const { return window_number_; }
+ // content::GpuDataManagerObserver implementation.
+ virtual void OnGpuSwitching() OVERRIDE;
+
private:
friend class base::RefCounted<CompositingIOSurfaceContext>;
@@ -68,7 +73,7 @@ class CompositingIOSurfaceContext
CGLContextObj clg_context,
bool is_vsync_disabled_,
scoped_ptr<CompositingIOSurfaceShaderPrograms> shader_program_cache);
- ~CompositingIOSurfaceContext();
+ virtual ~CompositingIOSurfaceContext();
int window_number_;
base::scoped_nsobject<NSOpenGLContext> nsgl_context_;

Powered by Google App Engine
This is Rietveld 408576698