summaryrefslogtreecommitdiff
path: root/poppler/CairoOutputDev.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2015-01-15 21:20:05 +1030
committerCarlos Garcia Campos <carlosgc@gnome.org>2015-12-04 11:50:48 +0100
commit47ffce08e75002aa0707107c76984e7e471d8afb (patch)
tree37283bb8a9c3ed5e49901d46712f7dabd4e5682e /poppler/CairoOutputDev.h
parentd7717cf18d0db5663687690ccf66102e9a124025 (diff)
cairo: Implement function shading using mesh gradients
Gfx draws function shadings by subdividing the shading until the colors are the same or the maximum subdivision is reached then fills each cell with the color of the mid point of the cell. The solid colors can result in a pixelated appearance. This patch implements a cairo specific version of the function shading that uses mesh gradients to draw each cell. By setting the corner of each patch to the shading color at that point, the mesh gradient will interpolate the colors resulting in a smooth appearance. Bug 88394
Diffstat (limited to 'poppler/CairoOutputDev.h')
-rw-r--r--poppler/CairoOutputDev.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index 33dde0c5..1c9a18ca 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -112,7 +112,7 @@ public:
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
virtual GBool useShadedFills(int type) { return type <= 7; }
#else
- virtual GBool useShadedFills(int type) { return type < 4; }
+ virtual GBool useShadedFills(int type) { return type > 1 && type < 4; }
#endif
// Does this device use FillColorStop()?
@@ -169,6 +169,9 @@ public:
double *mat, double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep);
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
+ virtual GBool functionShadedFill(GfxState *state, GfxFunctionShading *shading);
+#endif
virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax);
virtual GBool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading);
virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax);