diff options
| author | Manolo Gouy <Manolo> | 2018-04-20 12:37:08 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-04-20 12:37:08 +0000 |
| commit | de4026aecafaa2da1d3607bc9a8e2e1544b3b8be (patch) | |
| tree | 59e72a4466ba243fa11ebf763d6fb1803fcb69a0 /src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | |
| parent | 7e234e3abc907bcb97b5eb7d0b74919cd08f8aa2 (diff) | |
Fix Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *) where 2 distinct Fl_GDI_Graphics_Driver objects should be used in the right way.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12865 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index b393175a3..9368836ca 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -348,10 +348,8 @@ Fl_Bitmask Fl_GDI_Graphics_Driver::create_bitmask(int w, int h, const uchar *dat static uchar loNibble[16] = { 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e, 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f }; - HDC hdc = GetDC(NULL); - int np = GetDeviceCaps(hdc, PLANES); //: was always one on sample machines - int bpp = GetDeviceCaps(hdc, BITSPIXEL);//: 1,4,8,16,24,32 and more odd stuff? - ReleaseDC(NULL, hdc); + int np = GetDeviceCaps(gc_, PLANES); //: was always one on sample machines + int bpp = GetDeviceCaps(gc_, BITSPIXEL);//: 1,4,8,16,24,32 and more odd stuff? int Bpr = (bpp*w+7)/8; //: bytes per row int pad = Bpr&1, w1 = (w+7)/8, shr = ((w-1)&7)+1; if (bpp==4) shr = (shr+1)/2; @@ -703,7 +701,8 @@ void Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) { fl_draw_pixmap(img->data(), 0, 0, FL_BLACK); uchar *bitmap = *pbitmap; if (bitmap) { - *Fl_Graphics_Driver::mask(img) = (fl_uintptr_t)create_bitmask(img->data_w(), img->data_h(), bitmap); + // call fl_create_bitmask here because "this" is not the current graphics driver + *Fl_Graphics_Driver::mask(img) = (fl_uintptr_t)fl_create_bitmask(img->data_w(), img->data_h(), bitmap); delete[] bitmap; } *pbitmap = 0; |
