diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-31 11:14:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-31 11:14:46 +0100 |
commit | 8f796d4586507a0a6e9ca3608f43448983a3b965 (patch) | |
tree | d5ef1777077153d0cf20bd378865b6eff59a833b /src/sna/sna.h | |
parent | 27c086a89d838fe0060e5ddd0fb2f37434078e4d (diff) |
sna: Promote to the GPU operations that cover the whole pixmap
If the pixmap is already partially on the GPU, and the next operation
touches the entire pixmap, promote that operation back to the whole GPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r-- | src/sna/sna.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index a2b5e83d..00175828 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -632,6 +632,14 @@ static inline bool box_empty(const BoxRec *box) } static inline bool +box_covers_pixmap(PixmapPtr pixmap, const BoxRec *box) +{ + int w = box->x2 - box->x1; + int h = box->y2 - box->y1; + return pixmap->drawable.width <= w && pixmap->drawable.height <= h; +} + +static inline bool box_inplace(PixmapPtr pixmap, const BoxRec *box) { struct sna *sna = to_sna_from_pixmap(pixmap); |