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

Unified Diff: ui/ozone/platform/dri/crtc_controller.h

Issue 821023003: [Ozone-DRI] Listen for swap events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-swap
Patch Set: Added comment Created 5 years, 11 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 | « no previous file | ui/ozone/platform/dri/crtc_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ 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);
};
« no previous file with comments | « no previous file | ui/ozone/platform/dri/crtc_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698