summaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-04-04 14:22:12 +0300
committerKristian Høgsberg <krh@bitplanet.net>2014-04-06 22:38:15 -0700
commit2c8b5f534be21a7eee89d0476dbf77fe86e59c5f (patch)
tree25a10b1d713d529c9cb5c77355bc4855dde0e2ff /protocol
parentcd186fbfaf88003175346644d077efa7e70627a2 (diff)
downloadweston-2c8b5f534be21a7eee89d0476dbf77fe86e59c5f.tar.gz
protocol: unify wl_viewport src and dst size rules
Let's make the source and destination size rules consistent: neither can have zero, {-1, -1} disables it, and other negatives are not allowed. The sanity of allowing zero sized source rectangle as debatable. Now the minimum becomes 1/256x1/256, and with output_scale the actual samples may be even smaller. That should be enough. On not allowed values, raise a protocol error. This should help catch bugs in clients that accidentally send garbage values. The old wl_viewport.set request remains the same, and can still produce zero sized source rectangle. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'protocol')
-rw-r--r--protocol/scaler.xml17
1 files changed, 11 insertions, 6 deletions
diff --git a/protocol/scaler.xml b/protocol/scaler.xml
index 5094616d..e21ae5b0 100644
--- a/protocol/scaler.xml
+++ b/protocol/scaler.xml
@@ -86,7 +86,8 @@
dst_width, dst_height. The source (rectangle) is scaled to exactly
this size. This overrides whatever the attached wl_buffer size is,
unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
- has no content and therefore no size.
+ has no content and therefore no size. Otherwise, the size is always
+ at least 1x1 in surface coordinates.
If the source rectangle is set, it defines what area of the
wl_buffer is taken as the source. If the source rectangle is set and
@@ -131,7 +132,7 @@
<enum name="error">
<entry name="bad_value" value="0"
- summary="negative values in width or height"/>
+ summary="negative or zero values in width or height"/>
</enum>
<request name="set">
@@ -167,8 +168,10 @@
wl_viewport for the description, and relation to the wl_buffer
size.
- If width and/or height are negative, the source rectangle is unset
- instead.
+ If width is -1.0 and height is -1.0, the destination size is unset
+ instead. Any other pair of values for width and height that
+ contains zero or negative values raises the bad_value protocol
+ error.
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.
@@ -186,8 +189,10 @@
wl_viewport for the description, and relation to the wl_buffer
size.
- If width and/or height are negative or zero, the destination size
- is unset instead.
+ If width is -1 and height is -1, the destination size is unset
+ instead. Any other pair of values for width and height that
+ contains zero or negative values raises the bad_value protocol
+ error.
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.