Chromium Code Reviews| Index: ui/ozone/platform/dri/crtc_controller.h |
| diff --git a/ui/ozone/platform/dri/crtc_controller.h b/ui/ozone/platform/dri/crtc_controller.h |
| index 0a422a7370878ffb442c972b72ac81e0b60b4e56..d9e26bc3c8403b12a5b1399057092ef25e4f327c 100644 |
| --- a/ui/ozone/platform/dri/crtc_controller.h |
| +++ b/ui/ozone/platform/dri/crtc_controller.h |
| @@ -9,6 +9,8 @@ |
| #include <stdint.h> |
| #include <xf86drmMode.h> |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/observer_list.h" |
| #include "ui/ozone/platform/dri/hardware_display_plane_manager.h" |
| #include "ui/ozone/platform/dri/overlay_plane.h" |
| #include "ui/ozone/platform/dri/scoped_drm_types.h" |
| @@ -16,13 +18,14 @@ |
| namespace ui { |
| class DriWrapper; |
| +class PageFlipObserver; |
| // Wrapper around a CRTC. |
| // |
| // One CRTC can be paired up with one or more connectors. The simplest |
| // configuration represents one CRTC driving one monitor, while pairing up a |
| // CRTC with multiple connectors results in hardware mirroring. |
| -class CrtcController { |
| +class CrtcController : public base::SupportsWeakPtr<CrtcController> { |
| public: |
| CrtcController(DriWrapper* drm, uint32_t crtc, uint32_t connector); |
| ~CrtcController(); |
| @@ -64,6 +67,9 @@ class CrtcController { |
| bool UnsetCursor(); |
| bool MoveCursor(const gfx::Point& location); |
| + void AddObserver(PageFlipObserver* observer); |
|
dnicoara
2015/01/08 15:31:37
This seemed good at the beginning, but now I feel
|
| + void RemoveObserver(PageFlipObserver* observer); |
| + |
| private: |
| DriWrapper* drm_; // Not owned. |
| @@ -97,6 +103,8 @@ class CrtcController { |
| // The time of the last page flip event as reported by the kernel callback. |
| uint64_t time_of_last_flip_; |
| + ObserverList<PageFlipObserver> observers_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(CrtcController); |
| }; |