diff options
| author | Manolo Gouy <Manolo> | 2017-03-17 16:33:14 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-03-17 16:33:14 +0000 |
| commit | 367e567b7b14d88bc723dba6bde156bd705bf86c (patch) | |
| tree | 78e4472938a1f16ba8a6b7d7aefee3974ce02316 /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | |
| parent | 300e0b32a9b18e9ab37185532d3a7c885e710f02 (diff) | |
Remove class Fl_Translated_Xlib_Graphics_Driver and move its processing to Fl_Xlib_Graphics_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12205 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index ed30b2e36..b5ad6487a 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -580,7 +580,7 @@ void Fl_Xlib_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, if (alpha) d ^= FL_IMAGE_WITH_ALPHA; const int mono = (d>-3 && d<3); - innards(buf,x,y,w,h,d,l,mono,0,0,alpha,gc_); + innards(buf,x+offset_x_,y+offset_y_,w,h,d,l,mono,0,0,alpha,gc_); } void Fl_Xlib_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data, @@ -590,16 +590,16 @@ void Fl_Xlib_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data, if (alpha) d ^= FL_IMAGE_WITH_ALPHA; const int mono = (d>-3 && d<3); - innards(0,x,y,w,h,d,0,mono,cb,data,alpha,gc_); + innards(0,x+offset_x_,y+offset_y_,w,h,d,0,mono,cb,data,alpha,gc_); } void Fl_Xlib_Graphics_Driver::draw_image_mono(const uchar* buf, int x, int y, int w, int h, int d, int l){ - innards(buf,x,y,w,h,d,l,1,0,0,0,gc_); + innards(buf,x+offset_x_,y+offset_y_,w,h,d,l,1,0,0,0,gc_); } void Fl_Xlib_Graphics_Driver::draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int x, int y, int w, int h,int d) { - innards(0,x,y,w,h,d,0,1,cb,data,0,gc_); + innards(0,x+offset_x_,y+offset_y_,w,h,d,0,1,cb,data,0,gc_); } void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) { @@ -624,7 +624,7 @@ void Fl_Xlib_Graphics_Driver::delete_bitmask(Fl_Bitmask bm) { void Fl_Xlib_Graphics_Driver::draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) { int X, Y, W, H; - if (Fl_Graphics_Driver::prepare(bm, XP, YP, WP, HP, cx, cy, X, Y, W, H)) { + if (Fl_Graphics_Driver::prepare(bm, XP+offset_x_, YP+offset_y_, WP, HP, cx, cy, X, Y, W, H)) { return; } @@ -717,6 +717,8 @@ static Fl_Offscreen cache_rgb(Fl_RGB_Image *img) { void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy) { int X, Y, W, H; + XP += offset_x_; + YP += offset_y_; // Don't draw an empty image... if (!img->d() || !img->array) { Fl_Graphics_Driver::draw_empty(img, XP, YP); @@ -730,9 +732,9 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, in } if (*Fl_Graphics_Driver::id(img)) { if (img->d() == 4 || img->d() == 2) - copy_offscreen_with_alpha(X, Y, W, H, *Fl_Graphics_Driver::id(img), cx, cy); + copy_offscreen_with_alpha(X - offset_x_, Y - offset_y_, W, H, *Fl_Graphics_Driver::id(img), cx, cy); else - copy_offscreen(X, Y, W, H, *Fl_Graphics_Driver::id(img), cx, cy); + copy_offscreen(X - offset_x_, Y - offset_y_, W, H, *Fl_Graphics_Driver::id(img), cx, cy); } else { // Composite image with alpha manually each time... alpha_blend(img, X, Y, W, H, cx, cy); @@ -753,7 +755,7 @@ fl_uintptr_t Fl_Xlib_Graphics_Driver::cache(Fl_Bitmap*, int w, int h, const ucha void Fl_Xlib_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) { int X, Y, W, H; - if (Fl_Graphics_Driver::prepare(pxm, XP, YP, WP, HP, cx, cy, X, Y, W, H)) return; + if (Fl_Graphics_Driver::prepare(pxm, XP+offset_x_, YP+offset_y_, WP, HP, cx, cy, X, Y, W, H)) return; if (*Fl_Graphics_Driver::mask(pxm)) { // make X use the bitmap as a mask: XSetClipMask(fl_display, gc_, *Fl_Graphics_Driver::mask(pxm)); @@ -776,17 +778,17 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int H Y1 = r->rects[i].y1; W1 = r->rects[i].x2 - r->rects[i].x1; H1 = r->rects[i].y2 - r->rects[i].y1; - copy_offscreen(X1, Y1, W1, H1, *Fl_Graphics_Driver::id(pxm), cx + (X1 - X), cy + (Y1 - Y)); + copy_offscreen(X1-offset_x_, Y1-offset_y_, W1, H1, *Fl_Graphics_Driver::id(pxm), cx + (X1 - X), cy + (Y1 - Y)); } XDestroyRegion(r); } else { - copy_offscreen(X, Y, W, H, *Fl_Graphics_Driver::id(pxm), cx, cy); + copy_offscreen(X-offset_x_, Y-offset_y_, W, H, *Fl_Graphics_Driver::id(pxm), cx, cy); } // put the old clip region back XSetClipOrigin(fl_display, gc_, 0, 0); restore_clip(); } - else copy_offscreen(X, Y, W, H, *Fl_Graphics_Driver::id(pxm), cx, cy); + else copy_offscreen(X-offset_x_, Y-offset_y_, W, H, *Fl_Graphics_Driver::id(pxm), cx, cy); } |
