summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-03-28 13:00:12 +0000
committerManolo Gouy <Manolo>2018-03-28 13:00:12 +0000
commit458d0636436b5f25e444dc285007dceac296c2ee (patch)
tree88510e081d4f4199db92879b4a1960ea22204769 /src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
parent29bda776bb78352b331771bd1169de31e4edc1be (diff)
Image classes: memorise the width and the height of the cached form of the image to support GUI scaling
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12811 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.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
index 5c00198f0..6b9cb6d87 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
@@ -498,7 +498,10 @@ void Fl_GDI_Graphics_Driver::draw_unscaled(Fl_RGB_Image *img, float s, int X, in
if (H + cy > img->data_h()) H = img->data_h() - cy;
if (!*Fl_Graphics_Driver::id(img)) {
*Fl_Graphics_Driver::id(img) = (fl_uintptr_t)build_id(img, (void**)(Fl_Graphics_Driver::mask(img)));
- *cache_scale(img) = 1;
+ int *pw, *ph;
+ cache_w_h(img, pw, ph);
+ *pw = img->data_w();
+ *ph = img->data_h();
}
Fl_Region r2 = scale_clip(s);
if (*Fl_Graphics_Driver::mask(img)) {
@@ -541,7 +544,10 @@ int Fl_GDI_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, int WP, i
if (!*Fl_Graphics_Driver::id(rgb)) {
*Fl_Graphics_Driver::id(rgb) = (fl_uintptr_t)build_id(rgb,
(void**)(Fl_Graphics_Driver::mask(rgb)));
- *cache_scale(rgb) = 1;
+ int *pw, *ph;
+ cache_w_h(rgb, pw, ph);
+ *pw = rgb->data_w();
+ *ph = rgb->data_h();
}
cache_size(img, WP, HP);
HDC new_gc = CreateCompatibleDC(gc_);
@@ -600,7 +606,10 @@ static Fl_Bitmask fl_create_bitmap(int w, int h, const uchar *data) {
}
fl_uintptr_t Fl_GDI_Graphics_Driver::cache(Fl_Bitmap *bm) {
- *cache_scale(bm) = Fl_Scalable_Graphics_Driver::scale();
+ int *pw, *ph;
+ cache_w_h(bm, pw, ph);
+ *pw = bm->data_w();
+ *ph = bm->data_h();
return (fl_uintptr_t)fl_create_bitmap(bm->data_w(), bm->data_h(), bm->array);
}
@@ -660,7 +669,10 @@ fl_uintptr_t Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) {
Fl_Surface_Device::pop_current();
Fl_Offscreen id = surf->get_offscreen_before_delete();
delete surf;
- *cache_scale(img) = 1;
+ int *pw, *ph;
+ cache_w_h(img, pw, ph);
+ *pw = img->data_w();
+ *ph = img->data_h();
return (fl_uintptr_t)id;
}