diff options
| author | Manolo Gouy <Manolo> | 2018-04-13 13:22:15 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-04-13 13:22:15 +0000 |
| commit | 2abe8bd413f97da1beb5c144e1a1f6cb3db25290 (patch) | |
| tree | 6ec8ad0471f4fde2a475a555a5823be6c592a0bc /src/Fl_Graphics_Driver.cxx | |
| parent | e440b8859f84b65517e016b5b623d09f99289ab9 (diff) | |
Homogenise and simplify the API of Fl_Graphics_Driver::cache(image-type *) virtual member functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12833 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Graphics_Driver.cxx')
| -rw-r--r-- | src/Fl_Graphics_Driver.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index e7b9036b9..2b331f327 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -328,12 +328,14 @@ void Fl_Graphics_Driver::draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int if (!*id(pxm)) { if (pxm->data_w() != w2 || pxm->data_h() != h2) { // build a scaled id_ & mask_ for pxm Fl_Pixmap *pxm2 = (Fl_Pixmap*)pxm->copy(w2, h2); - *id(pxm) = cache(pxm2); + cache(pxm2); + *id(pxm) = *id(pxm2); + *id(pxm2) = 0; *pw = w2; *ph = h2; // memorize size of cached form of pixmap *mask(pxm) = *mask(pxm2); *mask(pxm2) = 0; delete pxm2; - } else *id(pxm) = cache(pxm); + } else cache(pxm); } // draw pxm using its scaled id_ & pixmap_ draw_fixed(pxm, X, Y, W, H, cx, cy); @@ -355,10 +357,12 @@ void Fl_Graphics_Driver::draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int if (!*id(bm)) { if (bm->data_w() != w2 || bm->data_h() != h2) { // build a scaled id_ for bm Fl_Bitmap *bm2 = (Fl_Bitmap*)bm->copy(w2, h2); - *id(bm) = cache(bm2); + cache(bm2); + *id(bm) = *id(bm2); + *id(bm2) = 0; *pw = w2; *ph = h2; // memorize size of cached form of bitmap delete bm2; - } else *id(bm) = cache(bm); + } else cache(bm); } // draw bm using its scaled id_ draw_fixed(bm, X, Y, W, H, cx, cy); |
