diff options
-rw-r--r-- | html/en/drv/xrender.html | 2 | ||||
-rw-r--r-- | src/cairo/cdcairo.c | 28 |
2 files changed, 16 insertions, 14 deletions
diff --git a/html/en/drv/xrender.html b/html/en/drv/xrender.html index 6970e29..381470f 100644 --- a/html/en/drv/xrender.html +++ b/html/en/drv/xrender.html @@ -4,7 +4,7 @@ <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -<title>X-Windows</title> +<title>XRender</title> <link rel="stylesheet" type="text/css" href="../../style.css"> </head> diff --git a/src/cairo/cdcairo.c b/src/cairo/cdcairo.c index 0561c08..6b536a4 100644 --- a/src/cairo/cdcairo.c +++ b/src/cairo/cdcairo.c @@ -130,8 +130,11 @@ static void cdflush(cdCtxCanvas *ctxcanvas) /******************************************************/ -static void setcliprect(cdCtxCanvas* ctxcanvas, double xmin, double ymin, double xmax, double ymax) +static void cdfcliparea(cdCtxCanvas *ctxcanvas, double xmin, double xmax, double ymin, double ymax) { + if (ctxcanvas->canvas->clip_mode != CD_CLIPAREA) + return; + cairo_reset_clip(ctxcanvas->cr); cairo_rectangle(ctxcanvas->cr, xmin, ymin, xmax-xmin+1, ymax-ymin+1); cairo_clip(ctxcanvas->cr); @@ -139,31 +142,27 @@ static void setcliprect(cdCtxCanvas* ctxcanvas, double xmin, double ymin, double static void cdcliparea(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int ymax) { - if (ctxcanvas->canvas->clip_mode != CD_CLIPAREA) - return; - - setcliprect(ctxcanvas, (double)xmin, (double)ymin, (double)xmax, (double)ymax); + cdfcliparea(ctxcanvas, (double)xmin, (double)xmax, (double)ymin, (double)ymax); } static int cdclip(cdCtxCanvas *ctxcanvas, int mode) { + cairo_reset_clip(ctxcanvas->cr); + switch (mode) { case CD_CLIPOFF: - cairo_reset_clip(ctxcanvas->cr); break; case CD_CLIPAREA: - ctxcanvas->canvas->clip_mode = CD_CLIPAREA; - setcliprect(ctxcanvas, (double)ctxcanvas->canvas->clip_rect.xmin, - (double)ctxcanvas->canvas->clip_rect.ymin, - (double)ctxcanvas->canvas->clip_rect.xmax, - (double)ctxcanvas->canvas->clip_rect.ymax); + cairo_rectangle(ctxcanvas->cr, ctxcanvas->canvas->clip_frect.xmin, + ctxcanvas->canvas->clip_frect.ymin, + ctxcanvas->canvas->clip_frect.xmax, + ctxcanvas->canvas->clip_frect.ymax); break; case CD_CLIPPOLYGON: { int hole_index = 0; int i; - cairo_reset_clip(ctxcanvas->cr); if (ctxcanvas->canvas->clip_poly) { @@ -195,13 +194,15 @@ static int cdclip(cdCtxCanvas *ctxcanvas, int mode) cairo_line_to(ctxcanvas->cr, poly[i].x, poly[i].y); } } - cairo_clip(ctxcanvas->cr); break; } case CD_CLIPREGION: break; } + if (mode != CD_CLIPOFF) + cairo_clip(ctxcanvas->cr); + return mode; } @@ -1731,6 +1732,7 @@ void cdcairoInitTable(cdCanvas* canvas) canvas->cxClip = cdclip; canvas->cxClipArea = cdcliparea; + canvas->cxFClipArea = cdfcliparea; canvas->cxLineStyle = cdlinestyle; canvas->cxLineWidth = cdlinewidth; canvas->cxLineCap = cdlinecap; |