summaryrefslogtreecommitdiff
path: root/src/Fl_Image_Surface.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-12-26 16:07:51 +0000
committerManolo Gouy <Manolo>2017-12-26 16:07:51 +0000
commit7758d472c2356f6908bce9fec6aa3e6d7e6a63e1 (patch)
tree0bac011dc51e12d811f249855e91ba60addce2e8 /src/Fl_Image_Surface.cxx
parent8ee87d15e3c369d74752736a9c3e6614e2950cb0 (diff)
Continue support for GUI rescaling under MacOS: fix fl_XXX_offscreen() functions and Fl_Image_Surface class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12605 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Image_Surface.cxx')
-rw-r--r--src/Fl_Image_Surface.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx
index bdd47fcf3..96358deaf 100644
--- a/src/Fl_Image_Surface.cxx
+++ b/src/Fl_Image_Surface.cxx
@@ -102,7 +102,7 @@ Fl_RGB_Image *Fl_Image_Surface::image() {
Fl_Shared_Image* Fl_Image_Surface::highres_image()
{
if (!platform_surface) return NULL;
- Fl_Shared_Image *s_img = Fl_Shared_Image::get(platform_surface->image());
+ Fl_Shared_Image *s_img = Fl_Shared_Image::get(image());
int width, height;
platform_surface->printable_rect(&width, &height);
s_img->scale(width, height, 1, 1);
@@ -146,9 +146,7 @@ static int find_slot(void) { // return an available slot to memorize an Fl_Image
*/
Fl_Offscreen fl_create_offscreen(int w, int h) {
int rank = find_slot();
- float d = Fl_Graphics_Driver::default_driver().scale();
- int high_res = d != 1;
- offscreen_api_surface[rank] = new Fl_Image_Surface(w, h, high_res);
+ offscreen_api_surface[rank] = new Fl_Image_Surface(w, h, 1/*high_res*/);
return offscreen_api_surface[rank]->offscreen();
}
@@ -197,11 +195,9 @@ void fl_scale_offscreen(Fl_Offscreen &ctx) {
}
}
if (i >= count_offscreens) return;
- Fl_RGB_Image *rgb = offscreen_api_surface[i]->image();
+ Fl_Shared_Image *shared = offscreen_api_surface[i]->highres_image();
offscreen_api_surface[i]->printable_rect(&w, &h);
fl_delete_offscreen(ctx);
- Fl_Shared_Image *shared = Fl_Shared_Image::get(rgb);
- shared->scale(w, h, 0, 1);
ctx = fl_create_offscreen(w, h);
fl_begin_offscreen(ctx);
shared->draw(0, 0);