diff options
| author | Manolo Gouy <Manolo> | 2016-03-26 14:36:11 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-26 14:36:11 +0000 |
| commit | 915d6c643a8b4e31ea79fdad81761d26b42530f5 (patch) | |
| tree | 8756c72f988596beb8e55382f40ff04142816057 /src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | |
| parent | e86e4a6ab0e3ad8ccbb694909383f5d72b9b4c92 (diff) | |
Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, Fl_Region, Fl_Bitmask).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx index 967712490..aa82393fe 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx @@ -20,6 +20,7 @@ #include "../../config_lib.h" #include "Fl_Xlib_Graphics_Driver.H" #include <FL/fl_draw.H> +#include <FL/x.H> #include <string.h> @@ -51,6 +52,8 @@ GC Fl_Xlib_Graphics_Driver::gc_ = NULL; Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) { mask_bitmap_ = NULL; + p_size = 0; + p = NULL; } void Fl_Xlib_Graphics_Driver::gc(void *value) { @@ -105,6 +108,22 @@ void Fl_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y, int XUnionRectWithRegion(&R, r, r); } +void Fl_Xlib_Graphics_Driver::transformed_vertex0(short x, short y) { + if (!n || x != p[n-1].x || y != p[n-1].y) { + if (n >= p_size) { + p_size = p ? 2*p_size : 16; + p = (XPOINT*)realloc((void*)p, p_size*sizeof(*p)); + } + p[n].x = x; + p[n].y = y; + n++; + } +} + +void Fl_Xlib_Graphics_Driver::fixloop() { // remove equal points from closed path + while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--; +} + // // End of "$Id$". // |
