summaryrefslogtreecommitdiff
path: root/src/sna/sna.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-09-07 17:27:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-07 17:28:33 +0100
commit7ee7e373f24b0c4604dbf67f7ff82bdb7edc55d1 (patch)
tree625967bb89917ceed0a1f59848c69404ad5fffc4 /src/sna/sna.h
parent218c9901e55e10fb5bc0c2a4caa04b1bee741a25 (diff)
sna: Split get_drawable_deltas()
In some cases we know we only have a window, and so may skip a conditional. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r--src/sna/sna.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index a4037c68..bd2cd484 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -435,14 +435,24 @@ CARD32 sna_render_format_for_depth(int depth);
void sna_debug_flush(struct sna *sna);
static inline bool
+get_window_deltas(PixmapPtr pixmap, int16_t *x, int16_t *y)
+{
+#ifdef COMPOSITE
+ *x = -pixmap->screen_x;
+ *y = -pixmap->screen_y;
+ return pixmap->screen_x | pixmap->screen_y;
+#else
+ *x = *y = 0;
+ return false;
+#endif
+}
+
+static inline bool
get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int16_t *x, int16_t *y)
{
#ifdef COMPOSITE
- if (drawable->type == DRAWABLE_WINDOW) {
- *x = -pixmap->screen_x;
- *y = -pixmap->screen_y;
- return pixmap->screen_x | pixmap->screen_y;
- }
+ if (drawable->type == DRAWABLE_WINDOW)
+ return get_window_deltas(pixmap, x, y);
#endif
*x = *y = 0;
return false;