[Xcb] [PATCH proto 2/9] render: make padding explicit

Christian Linhart chris at demorecorder.com
Sun Sep 13 06:45:10 PDT 2015


Add explicit align-padding for:
* the request "SetPictureFilter":
  Added 4-byte align-pad between list "filter" and list "values"
  The spec does not show the padding:
    http://cgit.freedesktop.org/xorg/proto/renderproto/tree/renderproto.txt?id=renderproto-0.11.1#n721
  But there has to be padding to make accesses to 32-bit values in list
  "values" aligned.
  The Xlib implementation at
    http://cgit.freedesktop.org/xorg/lib/libXrender/tree/src/Filter.c?id=libXrender-0.9.9#n160
  correctly does the padding:
  The string "filter" is written with "Data" which does 4-byte padding at the end:
    http://cgit.freedesktop.org/xorg/lib/libX11/tree/include/X11/Xlibint.h?id=libX11-1.6.3#n535
    http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/xcb_io.c?id=libX11-1.6.3#n484

Signed-off-by: Christian Linhart <chris at demorecorder.com>
---
 src/render.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/render.xml b/src/render.xml
index c54608e..935fdcc 100644
--- a/src/render.xml
+++ b/src/render.xml
@@ -603,14 +603,15 @@ <request name="QueryFilters" opcode="29">
   <request name="SetPictureFilter" opcode="30">
     <field type="PICTURE" name="picture" />
     <field type="CARD16" name="filter_len" />
     <pad bytes="2" />
     <list type="char" name="filter">
       <fieldref>filter_len</fieldref>
     </list>
+    <pad align="4" />
     <list type="FIXED" name="values" />
   </request>
 
   <!-- new in version 0.8 -->
 
   <struct name="ANIMCURSORELT">
     <field type="CURSOR" name="cursor" />
-- 
2.1.4



More information about the Xcb mailing list