summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorRoman Gilg <subdiff@gmail.com>2018-03-13 16:00:40 +0100
committerAdam Jackson <ajax@redhat.com>2018-03-28 14:36:24 -0400
commit84112a1d0b221c00d7d3c23fd5b97687e6e3749a (patch)
tree6b7f5ce5eb2ec621098c52e77fafe863f278c8c9 /present
parent1db7cf0429eabf33f8e2b55a15db4d1f87e1fb95 (diff)
present: Add flip mode API hook for present_can_window_flip
Flip modes can now have different implementations of present_can_window_flip. Signed-off-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'present')
-rw-r--r--present/present.c9
-rw-r--r--present/present_priv.h2
-rw-r--r--present/present_scmd.c5
3 files changed, 14 insertions, 2 deletions
diff --git a/present/present.c b/present/present.c
index ddd9c1cc3..da4549197 100644
--- a/present/present.c
+++ b/present/present.c
@@ -109,6 +109,15 @@ present_set_tree_pixmap(WindowPtr window,
TraverseTree(window, present_set_tree_pixmap_visit, &visit);
}
+Bool
+present_can_window_flip(WindowPtr window)
+{
+ ScreenPtr screen = window->drawable.pScreen;
+ present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+ return screen_priv->can_window_flip(window);
+}
+
int
present_pixmap(WindowPtr window,
PixmapPtr pixmap,
diff --git a/present/present_priv.h b/present/present_priv.h
index 27b80483e..aee3e57d2 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -97,6 +97,7 @@ typedef Bool (*present_priv_check_flip_ptr)(RRCrtcPtr crtc,
int16_t y_off,
PresentFlipReason *reason);
typedef void (*present_priv_check_flip_window_ptr)(WindowPtr window);
+typedef Bool (*present_priv_can_window_flip_ptr)(WindowPtr window);
typedef int (*present_priv_pixmap_ptr)(WindowPtr window,
PixmapPtr pixmap,
@@ -148,6 +149,7 @@ typedef struct present_screen_priv {
/* Mode hooks */
present_priv_check_flip_ptr check_flip;
present_priv_check_flip_window_ptr check_flip_window;
+ present_priv_can_window_flip_ptr can_window_flip;
present_priv_pixmap_ptr present_pixmap;
present_priv_create_event_id_ptr create_event_id;
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 8ba4b2e80..7fd27ac9d 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -512,8 +512,8 @@ present_check_flip_window (WindowPtr window)
}
}
-Bool
-present_can_window_flip(WindowPtr window)
+static Bool
+present_scmd_can_window_flip(WindowPtr window)
{
ScreenPtr screen = window->drawable.pScreen;
PixmapPtr window_pixmap;
@@ -852,6 +852,7 @@ present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv)
{
screen_priv->check_flip = &present_check_flip;
screen_priv->check_flip_window = &present_check_flip_window;
+ screen_priv->can_window_flip = &present_scmd_can_window_flip;
screen_priv->present_pixmap = &present_scmd_pixmap;
screen_priv->create_event_id = &present_scmd_create_event_id;