gpu_switching_observer.h 933 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_GL_GPU_SWITCHING_OBSERVER_H_
  5. #define UI_GL_GPU_SWITCHING_OBSERVER_H_
  6. #include "ui/gl/gl_export.h"
  7. #include "ui/gl/gpu_preference.h"
  8. namespace ui {
  9. class GL_EXPORT GpuSwitchingObserver {
  10. public:
  11. virtual ~GpuSwitchingObserver() = default;
  12. // Called for any observer when the system switches to a different GPU.
  13. virtual void OnGpuSwitched(gl::GpuPreference active_gpu_heuristic) {}
  14. // Called for any observer when a monitor is plugged in.
  15. virtual void OnDisplayAdded() {}
  16. // Called for any observer when a monitor is unplugged.
  17. virtual void OnDisplayRemoved() {}
  18. // Called for any observer when the display metrics changed.
  19. virtual void OnDisplayMetricsChanged() {}
  20. };
  21. } // namespace ui
  22. #endif // UI_GL_GPU_SWITCHING_OBSERVER_H_