summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-31 13:17:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-31 14:33:01 +0100
commit786d1f962a7e7ee7036ea85d4ea3aec7580e25db (patch)
tree2ac2aeec0eedbc256fbf28648aac0663a3ff39a6 /src/cairo-xlib-display.c
parent53cbbad8fbbd2b9423a5eb179d0cec3fc7678791 (diff)
downloadcairo-786d1f962a7e7ee7036ea85d4ea3aec7580e25db.tar.gz
[xlib] Use server-side gradients.
We can offload creation of gradients to server that support RENDER 0.10 and later. This greatly reduces the amount of traffic we need to send over our display connection as the gradient patterns are much smaller than the full image. Even if the server fallbacks to using pixman, performance should be improved by the reduced transport overhead. Furthermore this is a requisite to enable hardware accelerated gradients with the xlib backend. Running cairo-perf-trace on tiny, Celeron/i915: before: firefox-20090601 211.585 after: firefox-20090601 270.939 and on tiger, CoreDuo/nvidia: before: firefox-20090601 70.143 after: firefox-20090601 87.326 where linear gradients are used extensively throughout the GTK+ theme. Not quite the result I was expecting! In particular, looking at tiny: xlib-rgba paint-with-alpha_linear-rgba_over-512 47.11 (47.16 0.05%) -> 123.42 (123.72 0.13%): 2.62x slowdown █▋ xlib-rgba paint-with-alpha_linear3-rgba_over-512 47.27 (47.32 0.04%) -> 123.78 (124.04 0.13%): 2.62x slowdown █▋ xlib-rgba paint-with-alpha_linear-rgb_over-512 47.19 (47.21 0.02%) -> 123.37 (123.70 0.13%): 2.61x slowdown █▋ xlib-rgba paint-with-alpha_linear3-rgb_over-512 47.30 (47.31 0.04%) -> 123.52 (123.62 0.09%): 2.61x slowdown █▋ xlib-rgba paint_linear3-rgb_over-512 47.29 (47.32 0.05%) -> 118.95 (119.60 0.29%): 2.52x slowdown █▌ xlib-rgba paint_linear-rgba_over-512 47.14 (47.17 0.06%) -> 116.76 (117.06 0.16%): 2.48x slowdown █▌ xlib-rgba paint_linear3-rgba_over-512 47.32 (47.34 0.04%) -> 116.85 (116.98 0.05%): 2.47x slowdown █▌ xlib-rgba paint_linear-rgb_over-512 47.15 (47.19 0.03%) -> 114.08 (114.55 0.20%): 2.42x slowdown █▍ xlib-rgba paint-with-alpha_radial-rgb_over-512 117.25 (119.43 1.21%) -> 194.36 (194.73 0.09%): 1.66x slowdown ▋ xlib-rgba paint-with-alpha_radial-rgba_over-512 117.22 (117.26 0.02%) -> 193.81 (194.17 0.11%): 1.65x slowdown ▋ xlib-rgba paint_radial-rgba_over-512 117.23 (117.26 0.02%) -> 186.35 (186.41 0.03%): 1.59x slowdown ▋ xlib-rgba paint_radial-rgb_over-512 117.23 (117.27 0.02%) -> 184.14 (184.62 1.51%): 1.57x slowdown ▋ Before 1.10, we may choose to disable server-side gradients for the current crop of Xorg servers, similar to the extended repeat modes. [Updated by Chris Wilson. All bugs are his.]
Diffstat (limited to 'src/cairo-xlib-display.c')
-rw-r--r--src/cairo-xlib-display.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index d9ee90483..880ac9303 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -284,8 +284,9 @@ _cairo_xlib_display_get (Display *dpy,
memset (display->cached_xrender_formats, 0,
sizeof (display->cached_xrender_formats));
- display->buggy_repeat = FALSE;
+ display->buggy_gradients = FALSE;
display->buggy_pad_reflect = TRUE;
+ display->buggy_repeat = FALSE;
/* This buggy_repeat condition is very complicated because there
* are multiple X server code bases (with multiple versioning
@@ -335,6 +336,12 @@ _cairo_xlib_display_get (Display *dpy,
if (VendorRelease (dpy) >= 60700000) {
if (VendorRelease (dpy) < 70000000)
display->buggy_repeat = TRUE;
+
+ /* We know that gradients simply do not work in eary Xorg servers */
+ if (VendorRelease (dpy) < 70200000)
+ {
+ display->buggy_gradients = TRUE;
+ }
} else {
if (VendorRelease (dpy) < 10400000)
display->buggy_repeat = TRUE;