Am 15.08.2014 17:55, schrieb Keith Packard:
Fixed point coordinates don't provide reasonable precision for
transformation operations; the resulting transforms are often off by
several pixels.
Allow clients to represent the transformation using either fixed point
or floating point.
Signed-off-by: Keith Packard kei...@keithp.com
---
configure.ac| 2 +-
render.h| 5 -
renderproto.h | 26 ++
renderproto.txt | 42 --
4 files changed, 71 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8154a3a..43d054f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ([2.60])
-AC_INIT([RenderProto], [0.11.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AC_INIT([RenderProto], [0.12.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
# Require xorg-macros: XORG_DEFAULT_OPTIONS
diff --git a/render.h b/render.h
index 7ecde3f..0f04cc6 100644
--- a/render.h
+++ b/render.h
@@ -77,7 +77,10 @@ typedef XIDPictFormat;
#define X_RenderCreateLinearGradient34
#define X_RenderCreateRadialGradient35
#define X_RenderCreateConicalGradient 36
-#define RenderNumberRequests (X_RenderCreateConicalGradient+1)
+/* 0.12 */
+#define X_RenderSetPictureTransformFloat37
+
+#define RenderNumberRequests (X_RenderSetPictureTransformFloat+1)
#define BadPictFormat0
#define BadPicture 1
diff --git a/renderproto.h b/renderproto.h
index b7b72c1..4fe8da6 100644
--- a/renderproto.h
+++ b/renderproto.h
@@ -640,6 +640,32 @@ typedef struct {
#define sz_xRenderCreateConicalGradientReq 24
+/* 0.12 and higher */
+
+typedef struct {
+floatmatrix11;
+floatmatrix12;
+floatmatrix13;
+floatmatrix21;
+floatmatrix22;
+floatmatrix23;
+floatmatrix31;
+floatmatrix32;
+floatmatrix33;
+} xRenderTransformFloat;
Would it make sense to use double for internal calculation ?
Most systems provide 64bit (or more) fpu-registers these days.
re,
wh
+#define sz_xRenderTransformFloat 36
+
+typedef struct {
+CARD8reqType;
+CARD8renderReqType;
+CARD16 length B16;
+Picture picture B32;
+xRenderTransformFloattransform;
+} xRenderSetPictureTransformFloatReq;
+
+#define sz_xRenderSetPictureTransformFloatReq44
+
#undef Window
#undef Drawable
#undef Font
diff --git a/renderproto.txt b/renderproto.txt
index 9f1f231..fe5a233 100644
--- a/renderproto.txt
+++ b/renderproto.txt
@@ -1,6 +1,6 @@
The X Rendering Extension
- Version 0.11
-2009-07-15
+ Version 0.12
+2014-08-13
Keith Packard
kei...@keithp.com
@@ -12,6 +12,10 @@ Rendering geometric figures is accomplished by client-side
tessellation into
either triangles or trapezoids. Text is drawn by loading glyphs into the
server and rendering sets of them.
+1.1 Version 0.12
+
+Version 0.12 adds 32-bit floating point transforms.
+
2. Acknowledgments
This extension was the work of many people, in particular:
@@ -252,6 +256,15 @@ ANIMCURSORELT[
cursor: CURSOR
delay: CARD32
]
+6.1 Protocol Types added in Version 0.12
+
+FLOAT32-bit IEEE 754 single precision float
+TRANSFORMFLOAT [
+ p11, p12, p13: FLOAT
+ p21, p22, p23: FLOAT
+ p31, p32, p33: FLOAT
+ ]
+
7. Standard PictFormats
The server must support a Direct PictFormat with 8 bits each of red, green,
@@ -1143,6 +1156,29 @@ CreateConicalGradient
The colors are non premultiplied.
+14.1 Extension requests added in Version 0.12
+
+SetPictureTransformFloat
+
+ picture:PICTURE
+ transform: TRANSFORMFLOAT
+
+ Errors:
+ Alloc, Value, Picture
+
+ This request changes the projective transformation used to
+ map coordinates when 'picture' is used as the source or
+ mask in any compositing operation. The transform
+ maps from destination pixel geometry back to the source pixel
+ geometry.
+
+ Setting a transform via this request replaces any transform
+ set by SetPictureTransform. Similarly, setting a transform via
+ SetPictureTransform replaces any transform set with this
+ request.
+
+ The matrix must be invertable, else a Value error is generated.
+
15. Extension Versioning