summaryrefslogtreecommitdiff
path: root/src/cairo-wideint.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-30 17:28:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-12 08:29:48 +0100
commitaf9fbd176b145f042408ef5391eef2a51d7531f8 (patch)
tree5f75d1087d4325a013af6f0a4204a666fb4ca4f0 /src/cairo-wideint.c
parent0540bf384aed344899417d3b0313bd6704679c1c (diff)
Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
Diffstat (limited to 'src/cairo-wideint.c')
-rw-r--r--src/cairo-wideint.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cairo-wideint.c b/src/cairo-wideint.c
index b6e22808..59af2c8c 100644
--- a/src/cairo-wideint.c
+++ b/src/cairo-wideint.c
@@ -99,6 +99,22 @@ _cairo_uint64_to_double (cairo_uint64_t i)
return i.hi * 4294967296. + i.lo;
}
+cairo_int64_t
+_cairo_double_to_int64 (double i)
+{
+ cairo_uint64_t q;
+
+ q.hi = i * (1. / INT32_MAX);
+ q.lo = i - q.hi * (double)INT32_MAX;
+ return q;
+}
+
+double
+_cairo_int64_to_double (cairo_int64_t i)
+{
+ return i.hi * INT32_MAX + i.lo;
+}
+
cairo_uint64_t
_cairo_uint32_to_uint64 (uint32_t i)
{