summaryrefslogtreecommitdiff
path: root/transform.c
diff options
context:
space:
mode:
authorDylan Simon <dylan@dylex.net>2009-09-27 14:44:35 -0400
committerSung-Jin Park <sj76.park@samsung.com>2013-09-02 23:37:56 -0400
commit8a78b5283dd40bc38d2c1065f290a68a9c0d65bf (patch)
tree36a25fc8b364053ea0c126013eabaa7cb69075b8 /transform.c
parent221d31fb2f3b2a2989a983cb30f866f57b683f52 (diff)
downloadxeyes-8a78b5283dd40bc38d2c1065f290a68a9c0d65bf.tar.gz
xeyes-8a78b5283dd40bc38d2c1065f290a68a9c0d65bf.tar.bz2
xeyes-8a78b5283dd40bc38d2c1065f290a68a9c0d65bf.zip
Add xrender support
Optionally draw all components (except shape) with xrender. Enabled by default. Xlib rendering can be restored by "configure --without-xrender" or "xeyes +render". Change-Id: Ib63621e450e6f75ef76a160634ae2186a7db9456 Signed-off-by: Dylan Simon <dylan@dylex.net> Signed-off-by: James Cloos <cloos@jhcloos.com>
Diffstat (limited to 'transform.c')
-rw-r--r--transform.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/transform.c b/transform.c
index 0f02498..5f63516 100644
--- a/transform.c
+++ b/transform.c
@@ -83,25 +83,20 @@ TDrawArc (
#endif
void
-TFillArc (Display *dpy, Drawable d, GC gc, Transform *t,
- double x, double y, double width, double height,
- int angle1, int angle2)
+Trectangle(const Transform *t, const TRectangle *i, TRectangle *o)
{
- int xx, xy, xw, xh;
-
- xx = Xx(x,y,t);
- xy = Xy(x,y,t);
- xw = Xwidth (width, height, t);
- xh = Xheight (width, height, t);
- if (xw < 0) {
- xx += xw;
- xw = -xw;
- }
- if (xh < 0) {
- xy += xh;
- xh = -xh;
- }
- XFillArc (dpy, d, gc, xx, xy, xw, xh, angle1, angle2);
+ o->x = t->mx * i->x + t->bx;
+ o->y = t->my * i->y + t->by;
+ o->width = t->mx * i->width;
+ o->height = t->my * i->height;
+ if (o->width < 0) {
+ o->x += o->width;
+ o->width = -o->width;
+ }
+ if (o->height < 0) {
+ o->y += o->height;
+ o->height = -o->height;
+ }
}
void