[gs-cvs] rev 8489 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Thu Jan 17 05:47:12 PST 2008
Author: leonardo
Date: 2008-01-17 05:47:11 -0800 (Thu, 17 Jan 2008)
New Revision: 8489
Modified:
trunk/gs/src/dwtrace.c
trunk/gs/src/vdtrace.c
trunk/gs/src/vdtrace.h
Log:
Fix (visual trace) : Add a single pixels painting operation.
DETAILS :
This patch doesn't change the algorithm.
It only enhances debuging instrument.
The new instrument will be used for debugging the clist logics about transparency masks.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/src/dwtrace.c
===================================================================
--- trunk/gs/src/dwtrace.c 2008-01-17 13:37:19 UTC (rev 8488)
+++ trunk/gs/src/dwtrace.c 2008-01-17 13:47:11 UTC (rev 8489)
@@ -245,6 +245,14 @@
SelectObject(I->host->hdc, h);
}
+static void dw_gt_pixel(vd_trace_interface *I, double x, double y, unsigned long rgbcolor)
+{ HPEN h;
+ get_window();
+ if (host.tw == NULL)
+ return;
+ SetPixel(I->host->hdc, SX(x), SY(y), rgbcolor);
+}
+
static void dw_gt_fill(vd_trace_interface *I)
{ get_window();
if (host.tw == NULL)
@@ -339,6 +347,7 @@
SET_CALLBACK(visual_tracer, closepath);
SET_CALLBACK(visual_tracer, circle);
SET_CALLBACK(visual_tracer, round);
+ SET_CALLBACK(visual_tracer, pixel);
SET_CALLBACK(visual_tracer, fill);
SET_CALLBACK(visual_tracer, stroke);
SET_CALLBACK(visual_tracer, setcolor);
Modified: trunk/gs/src/vdtrace.c
===================================================================
--- trunk/gs/src/vdtrace.c 2008-01-17 13:37:19 UTC (rev 8488)
+++ trunk/gs/src/vdtrace.c 2008-01-17 13:47:11 UTC (rev 8489)
@@ -183,6 +183,11 @@
vd_trace1->round(vd_trace1, SX(x), SY(y), r);
}
+void vd_impl_pixel(double x, double y, unsigned long c)
+{ NullRET;
+ vd_trace1->pixel(vd_trace1, SX(x), SY(y), c);
+}
+
void vd_impl_text(double x, double y, char *s, unsigned long c)
{ NullRET;
vd_trace1->setcolor(vd_trace1, c);
Modified: trunk/gs/src/vdtrace.h
===================================================================
--- trunk/gs/src/vdtrace.h 2008-01-17 13:37:19 UTC (rev 8488)
+++ trunk/gs/src/vdtrace.h 2008-01-17 13:47:11 UTC (rev 8489)
@@ -61,6 +61,7 @@
void (*closepath)(vd_trace_interface *I);
void (*circle)(vd_trace_interface *I, double x, double y, int r); /* Radius doesn't scale. */
void (*round)(vd_trace_interface *I, double x, double y, int r); /* Radius doesn't scale. */
+ void (*pixel)(vd_trace_interface *I, double x, double y, unsigned long rgbcolor);
void (*fill)(vd_trace_interface *I);
void (*stroke)(vd_trace_interface *I);
void (*setcolor)(vd_trace_interface *I, unsigned long rgbcolor);
@@ -87,6 +88,7 @@
void vd_impl_curve(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, int w, unsigned long c); /* unscaled width */
void vd_impl_circle(double x, double y, int r, unsigned long c); /* unscaled radius */
void vd_impl_round(double x, double y, int r, unsigned long c); /* unscaled radius */
+void vd_impl_pixel(double x, double y, unsigned long c);
void vd_impl_text(double x, double y, char *s, unsigned long c); /* unscaled font */
void vd_setflag(char f, char v);
@@ -127,6 +129,7 @@
# define vd_curve(x0,y0,x1,y1,x2,y2,x3,y3,w,c) BEGIN if (vd_trace1) vd_impl_curve(x0,y0,x1,y1,x2,y2,x3,y3,w,c); END
# define vd_circle(x,y,r,c) BEGIN if (vd_trace1) vd_impl_circle(x,y,r,c); END
# define vd_round(x,y,r,c) BEGIN if (vd_trace1) vd_impl_round(x,y,r,c); END
+# define vd_pixel(x,y,c) BEGIN if (vd_trace1) vd_impl_pixel(x,y,c); END
# define vd_fill BEGIN if (vd_trace1) vd_trace1->fill(vd_trace1); END
# define vd_stroke BEGIN if (vd_trace1) vd_trace1->stroke(vd_trace1); END
# define vd_setcolor(c) BEGIN if (vd_trace1) vd_trace1->setcolor(vd_trace1,c); END
@@ -172,6 +175,7 @@
# define vd_curve(x0,y0,x1,y1,x2,y2,x3,y3,w,c) DO_NOTHING
# define vd_circle(x,y,r,c) DO_NOTHING
# define vd_round(x,y,r,c) DO_NOTHING
+# define vd_pixel(x,y,c) DO_NOTHING
# define vd_fill DO_NOTHING
# define vd_stroke DO_NOTHING
# define vd_setcolor(c) DO_NOTHING
More information about the gs-cvs
mailing list