#include "../devices/ops.h"
#include "../devices/arts.h"
#include "../devices/render.h"
+
+#include "../art/libart.h"
+#include "../devices/artsutils.c"
+
#include "../png.h"
#include "fonts.h"
return gFalse;
}
-void GFXOutputDev::strokeGfxline(GfxState *state, gfxline_t*line)
+#define STROKE_FILL 1
+#define STROKE_CLIP 2
+void GFXOutputDev::strokeGfxline(GfxState *state, gfxline_t*line, int flags)
{
int lineCap = state->getLineCap(); // 0=butt, 1=round 2=square
int lineJoin = state->getLineJoin(); // 0=miter, 1=round 2=bevel
);
dump_outline(line);
}
-
- //swfoutput_drawgfxline(output, line, width, &col, capType, joinType, miterLimit);
- device->stroke(device, line, width, &col, capType, joinType, miterLimit);
+
+ if(flags&STROKE_FILL) {
+ ArtSVP* svp = gfxstrokeToSVP(line, width, capType, joinType, miterLimit);
+ gfxline_t*gfxline = SVPtogfxline(svp);
+ if(flags&STROKE_CLIP) {
+ device->startclip(device, gfxline);
+ states[statepos].clipping++;
+ } else {
+ device->fill(device, gfxline, &col);
+ }
+ free(gfxline);
+ art_svp_free(svp);
+ } else {
+ if(flags&STROKE_CLIP)
+ msg("<error> Stroke&clip not supported at the same time");
+ device->stroke(device, line, width, &col, capType, joinType, miterLimit);
+ }
if(line2)
gfxline_free(line2);
states[statepos].clipping++;
gfxline_free(line);
}
+void GFXOutputDev::clipToStrokePath(GfxState *state)
+{
+ GfxPath * path = state->getPath();
+ gfxline_t*line= gfxPath_to_gfxline(state, path, 0, user_movex + clipmovex, user_movey + clipmovey);
+ strokeGfxline(state, line, STROKE_FILL|STROKE_CLIP);
+ gfxline_free(line);
+}
void GFXOutputDev::endframe()
{
current_text_stroke = 0;
} else if((render&3) == RENDER_FILLSTROKE) {
fillGfxLine(state, current_text_stroke);
- strokeGfxline(state, current_text_stroke);
+ strokeGfxline(state, current_text_stroke,0);
gfxline_free(current_text_stroke);
current_text_stroke = 0;
} else if((render&3) == RENDER_STROKE) {
- strokeGfxline(state, current_text_stroke);
+ strokeGfxline(state, current_text_stroke,0);
gfxline_free(current_text_stroke);
current_text_stroke = 0;
}
GfxPath * path = state->getPath();
gfxline_t*line= gfxPath_to_gfxline(state, path, 0, user_movex + clipmovex, user_movey + clipmovey);
- strokeGfxline(state, line);
+ strokeGfxline(state, line, 0);
gfxline_free(line);
}
//----- path clipping
virtual void clip(GfxState *state) ;
virtual void eoClip(GfxState *state) ;
+ virtual void clipToStrokePath(GfxState *state);
//----- shaded fills
virtual GBool useTilingPatternFill();
GBool inlineImg, int mask, int *maskColors,
Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GfxImageColorMap*maskColorMap);
int setGfxFont(char*id, char*name, char*filename, double quality);
- void strokeGfxline(GfxState *state, gfxline_t*line);
+ void strokeGfxline(GfxState *state, gfxline_t*line, int flags);
void clipToGfxLine(GfxState *state, gfxline_t*line);
void fillGfxLine(GfxState *state, gfxline_t*line);