diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-03-14 14:38:16 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-01 16:46:40 -0700 |
commit | f0cad4844c53d857a3b298c34bdbc9d52b56baec (patch) | |
tree | 8f245a90d3ba76f8dd1192b1d05a9fbed7eb7cc3 /src/compositor.h | |
parent | 952b6c80040a258b8b0e75fef16fb564d4ff0c2c (diff) | |
download | weston-f0cad4844c53d857a3b298c34bdbc9d52b56baec.tar.gz |
compositor: replace weston_buffer_viewport::viewport_set
Remove the explicit boolean variable, and use illegal width to denote
"not set".
Split the boolean into two, so we can later start having buffer.src_*
and surface.* set or not set independently. This may become useful when
the wl_viewport interface is changed to allow modifying them separately.
At the moment, both buffer.src_width and surface.width conditions are
always in sync.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'src/compositor.h')
-rw-r--r-- | src/compositor.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compositor.h b/src/compositor.h index f1f126b1..d2afacdd 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -662,16 +662,18 @@ struct weston_buffer_viewport { /* wl_surface.set_scaling_factor */ int32_t scale; - /* bool for whether wl_viewport.set has been - * called yet (before this is called there is no - * cropping or scaling on the surface) */ - int viewport_set; /* bool */ - + /* + * If src_width != wl_fixed_from_int(-1), + * then and only then src_* are used. + */ wl_fixed_t src_x, src_y; wl_fixed_t src_width, src_height; } buffer; struct { + /* + * If width == -1, the size is inferred from the buffer. + */ int32_t width, height; } surface; }; |