summaryrefslogtreecommitdiff
path: root/raster/porterduff.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2008-09-02 01:32:45 +0200
committerTor Andersson <tor@ghostscript.com>2008-09-02 01:32:45 +0200
commit98a12532a6df4cf6f13d109e93e3e236bf3489a4 (patch)
tree83ce8b9cd02d672bd03776bb40c56c0323b99e3b /raster/porterduff.c
parent0f168c6810aa8f031fe546312fda81e274c9be80 (diff)
downloadmupdf-98a12532a6df4cf6f13d109e93e3e236bf3489a4.tar.xz
Use unsigned char type for coverage calculations to keep the value inside the ring 0..255. This fixes a leaking pixel bug when drawing alpha blended paths.
Diffstat (limited to 'raster/porterduff.c')
-rw-r--r--raster/porterduff.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/raster/porterduff.c b/raster/porterduff.c
index e9aa6307..8f2b9862 100644
--- a/raster/porterduff.c
+++ b/raster/porterduff.c
@@ -238,7 +238,7 @@ static void duff_4i1o4(byte * restrict sp0, int sw, byte * restrict mp0, int mw,
* Path and text masks
*/
-static void path_1c1(byte * restrict src, int cov, int len, byte * restrict dst)
+static void path_1c1(byte * restrict src, byte cov, int len, byte * restrict dst)
{
while (len--)
{
@@ -247,7 +247,7 @@ static void path_1c1(byte * restrict src, int cov, int len, byte * restrict dst)
}
}
-static void path_1o1(byte * restrict src, int cov, int len, byte * restrict dst)
+static void path_1o1(byte * restrict src, byte cov, int len, byte * restrict dst)
{
while (len--)
{
@@ -258,7 +258,7 @@ static void path_1o1(byte * restrict src, int cov, int len, byte * restrict dst)
}
// With 4 In 1 Over 4
-static void path_w4i1o4(byte * restrict argb, byte * restrict src, int cov, int len, byte * restrict dst)
+static void path_w4i1o4(byte * restrict argb, byte * restrict src, byte cov, int len, byte * restrict dst)
{
byte alpha = argb[0];
byte r = argb[4];
@@ -351,9 +351,9 @@ void (*fz_duff_4i1c4)(byte*,int,byte*,int,byte*,int,int,int) = duff_4i1c4;
void (*fz_duff_1i1o1)(byte*,int,byte*,int,byte*,int,int,int) = duff_1i1o1;
void (*fz_duff_4i1o4)(byte*,int,byte*,int,byte*,int,int,int) = duff_4i1o4;
-void (*fz_path_1c1)(byte*,int,int,byte*) = path_1c1;
-void (*fz_path_1o1)(byte*,int,int,byte*) = path_1o1;
-void (*fz_path_w4i1o4)(byte*,byte*,int,int,byte*) = path_w4i1o4;
+void (*fz_path_1c1)(byte*,byte,int,byte*) = path_1c1;
+void (*fz_path_1o1)(byte*,byte,int,byte*) = path_1o1;
+void (*fz_path_w4i1o4)(byte*,byte*,byte,int,byte*) = path_w4i1o4;
void (*fz_text_1c1)(byte*,int,byte*,int,int,int) = text_1c1;
void (*fz_text_1o1)(byte*,int,byte*,int,int,int) = text_1o1;