diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-02-17 15:51:29 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-02-23 22:52:06 +0100 |
commit | 23d4fdbe8a7d67c1e0786d5f7efc40ef6d261f40 (patch) | |
tree | 3860e0517fb6d8a15c27c69fd50270a64a55bf30 /common/canvas_base.c | |
parent | e57cfae896c70b37ecee1acd0297183f4b4ae758 (diff) | |
download | spice-23d4fdbe8a7d67c1e0786d5f7efc40ef6d261f40.tar.gz spice-23d4fdbe8a7d67c1e0786d5f7efc40ef6d261f40.tar.xz spice-23d4fdbe8a7d67c1e0786d5f7efc40ef6d261f40.zip |
Convert cairo canvas to use pixman for draw_stroke
Diffstat (limited to 'common/canvas_base.c')
-rw-r--r-- | common/canvas_base.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c index a96bd428..a2917d29 100644 --- a/common/canvas_base.c +++ b/common/canvas_base.c @@ -93,6 +93,23 @@ typedef struct __attribute__ ((__packed__)) LZImage { static const cairo_user_data_key_t pixman_data_type = {0}; + static inline int fix_to_int(SPICE_FIXED28_4 fixed) +{ + int val, rem; + + rem = fixed & 0x0f; + val = fixed >> 4; + if (rem > 8) { + val++; + } + return val; +} + + static inline SPICE_FIXED28_4 int_to_fix(int v) +{ + return v << 4; +} + static inline double fix_to_double(SPICE_FIXED28_4 fixed) { return (double)(fixed & 0x0f) / 0x0f + (fixed >> 4); |