summaryrefslogtreecommitdiff
path: root/src/cairo
diff options
context:
space:
mode:
authorscuri <scuri>2010-05-12 21:08:26 +0000
committerscuri <scuri>2010-05-12 21:08:26 +0000
commitd398073d6172282659e91eeaa2d6452a3144ebc3 (patch)
treecfe43f43228891ac808ac70955f472cabb434dc2 /src/cairo
parentb7d97c7ed82f0d0472cf0c2ae5d61e99a73b33a8 (diff)
*** empty log message ***
Diffstat (limited to 'src/cairo')
-rw-r--r--src/cairo/cdcairo.c24
-rw-r--r--src/cairo/cdcairoctx.h1
-rw-r--r--src/cairo/cdcairodbuf.c3
-rw-r--r--src/cairo/cdcairoimg.c2
-rw-r--r--src/cairo/cdcairoirgb.c2
-rw-r--r--src/cairo/cdcaironative_gdk.c2
-rw-r--r--src/cairo/cdcairopdf.c2
-rw-r--r--src/cairo/cdcairops.c2
-rw-r--r--src/cairo/cdcairosvg.c2
9 files changed, 11 insertions, 29 deletions
diff --git a/src/cairo/cdcairo.c b/src/cairo/cdcairo.c
index 34fdef7..83cf088 100644
--- a/src/cairo/cdcairo.c
+++ b/src/cairo/cdcairo.c
@@ -14,14 +14,11 @@
#include "cdcairoctx.h"
-#define HATCH_WIDTH 8
-#define HATCH_HEIGHT 8
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
-
static int StrIsAscii(const char* str)
{
while(*str)
@@ -294,12 +291,12 @@ static void cdstipple(cdCtxCanvas *ctxcanvas, int n, int m, const unsigned char
static int cdhatch(cdCtxCanvas *ctxcanvas, int style)
{
- int hsize = HATCH_WIDTH - 1;
+ int hsize = ctxcanvas->hatchboxsize;
int hhalf = hsize / 2;
cairo_surface_t* hatch_surface;
cairo_t* cr;
- hatch_surface = cairo_surface_create_similar(cairo_get_target(ctxcanvas->cr), CAIRO_CONTENT_COLOR_ALPHA, HATCH_WIDTH, HATCH_HEIGHT);
+ hatch_surface = cairo_surface_create_similar(cairo_get_target(ctxcanvas->cr), CAIRO_CONTENT_COLOR_ALPHA, hsize, hsize);
cr = cairo_create(hatch_surface);
@@ -366,21 +363,6 @@ static int cdhatch(cdCtxCanvas *ctxcanvas, int style)
/* attributes */
/******************************************************/
-static int cdwritemode(cdCtxCanvas *ctxcanvas, int write_mode)
-{
- switch (write_mode)
- {
- case CD_REPLACE:
- cairo_set_operator (ctxcanvas->cr, CAIRO_OPERATOR_OVER);
- break;
- case CD_XOR:
- cairo_set_operator (ctxcanvas->cr, CAIRO_OPERATOR_XOR);
- break;
- }
-
- return write_mode;
-}
-
static int cdinteriorstyle (cdCtxCanvas* ctxcanvas, int style)
{
switch (style)
@@ -1676,6 +1658,7 @@ cdCtxCanvas *cdcairoCreateCanvas(cdCanvas* canvas, cairo_t* cr)
ctxcanvas->cr = cr;
ctxcanvas->canvas = canvas;
ctxcanvas->last_source = -1;
+ ctxcanvas->hatchboxsize = 8;
canvas->ctxcanvas = ctxcanvas;
canvas->invert_yaxis = 1;
@@ -1735,7 +1718,6 @@ void cdcairoInitTable(cdCanvas* canvas)
canvas->cxGetFontDim = cdgetfontdim;
canvas->cxGetTextSize = cdgettextsize;
canvas->cxTransform = cdtransform;
- canvas->cxWriteMode = cdwritemode;
canvas->cxForeground = cdforeground;
canvas->cxGetImageRGB = cdgetimagergb;
diff --git a/src/cairo/cdcairoctx.h b/src/cairo/cdcairoctx.h
index 266cfb3..7516875 100644
--- a/src/cairo/cdcairoctx.h
+++ b/src/cairo/cdcairoctx.h
@@ -31,6 +31,7 @@ struct _cdCtxCanvas
cairo_pattern_t *pattern, *solid;
int last_source;
+ int hatchboxsize;
char* cairoLastConvertUTF8;
diff --git a/src/cairo/cdcairodbuf.c b/src/cairo/cdcairodbuf.c
index 0e23f06..4861014 100644
--- a/src/cairo/cdcairodbuf.c
+++ b/src/cairo/cdcairodbuf.c
@@ -155,8 +155,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdDBufferContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS |
- CD_CAP_FPRIMTIVES ),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE ),
0,
cdcreatecanvas,
cdinittable,
diff --git a/src/cairo/cdcairoimg.c b/src/cairo/cdcairoimg.c
index 54c2fa7..4eda676 100644
--- a/src/cairo/cdcairoimg.c
+++ b/src/cairo/cdcairoimg.c
@@ -37,7 +37,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdImageContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES ),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE ),
0,
cdcreatecanvas,
cdinittable,
diff --git a/src/cairo/cdcairoirgb.c b/src/cairo/cdcairoirgb.c
index 1bb9698..b326834 100644
--- a/src/cairo/cdcairoirgb.c
+++ b/src/cairo/cdcairoirgb.c
@@ -145,7 +145,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdCairoImageRGBContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_FPRIMTIVES),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
0,
cdcreatecanvas,
cdinittable,
diff --git a/src/cairo/cdcaironative_gdk.c b/src/cairo/cdcaironative_gdk.c
index 98face0..29be6c6 100644
--- a/src/cairo/cdcaironative_gdk.c
+++ b/src/cairo/cdcaironative_gdk.c
@@ -65,7 +65,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdNativeWindowContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE | CD_CAP_FPRIMTIVES),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
1,
cdcreatecanvas,
cdinittable,
diff --git a/src/cairo/cdcairopdf.c b/src/cairo/cdcairopdf.c
index 880a2e5..f17fff4 100644
--- a/src/cairo/cdcairopdf.c
+++ b/src/cairo/cdcairopdf.c
@@ -108,7 +108,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdCairoPDFContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_FPRIMTIVES),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
0,
cdcreatecanvas,
cdinittable,
diff --git a/src/cairo/cdcairops.c b/src/cairo/cdcairops.c
index ed58723..52268e5 100644
--- a/src/cairo/cdcairops.c
+++ b/src/cairo/cdcairops.c
@@ -155,7 +155,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdCairoPSContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_FPRIMTIVES),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
0,
cdcreatecanvas,
cdinittable,
diff --git a/src/cairo/cdcairosvg.c b/src/cairo/cdcairosvg.c
index ce36758..0f528fa 100644
--- a/src/cairo/cdcairosvg.c
+++ b/src/cairo/cdcairosvg.c
@@ -67,7 +67,7 @@ static void cdinittable(cdCanvas* canvas)
static cdContext cdCairoSVGContext =
{
- CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_FPRIMTIVES),
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
0,
cdcreatecanvas,
cdinittable,