summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.H1
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx6
-rw-r--r--src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx8
3 files changed, 11 insertions, 4 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
index 897f66ffa..967800a52 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H
@@ -39,6 +39,7 @@ private:
BOOL alpha_blend_(int x, int y, int w, int h, HDC src_gc, int srcx, int srcy, int srcw, int srch);
int depth; // to support translation
POINT *origins; // to support translation
+ void set_current_();
protected:
HDC gc_;
int numcount;
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index 0f80c0ecd..73d9498d2 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -94,7 +94,7 @@ char Fl_GDI_Graphics_Driver::can_do_alpha_blending() {
}
HDC fl_makeDC(HBITMAP bitmap) {
- HDC new_gc = CreateCompatibleDC((HDC)fl_graphics_driver->gc());
+ HDC new_gc = CreateCompatibleDC((HDC)Fl_Graphics_Driver::default_driver().gc());
SetTextAlign(new_gc, TA_BASELINE|TA_LEFT);
SetBkMode(new_gc, TRANSPARENT);
#if USE_COLORMAP
@@ -282,6 +282,10 @@ Fl_Region Fl_GDI_Graphics_Driver::scale_clip(float f) {
return (r == r2 ? NULL : (rstack[rstackptr] = r2, r));
}
+void Fl_GDI_Graphics_Driver::set_current_() {
+ restore_clip();
+}
+
//
// End of "$Id$".
//
diff --git a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
index e068afe53..6b851e4a8 100644
--- a/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Image_Surface_Driver.cxx
@@ -38,6 +38,7 @@ public:
void translate(int x, int y);
void untranslate();
Fl_RGB_Image *image();
+ POINT origin;
};
@@ -58,6 +59,7 @@ Fl_GDI_Image_Surface_Driver::Fl_GDI_Image_Surface_Driver(int w, int h, int high_
if (!offscreen) offscreen = CreateCompatibleBitmap(fl_GetDC(0), w, h);
driver(new Fl_GDI_Graphics_Driver);
if (d != 1 && high_res) driver()->scale(d);
+ origin.x = origin.y = 0;
}
@@ -69,12 +71,12 @@ Fl_GDI_Image_Surface_Driver::~Fl_GDI_Image_Surface_Driver() {
void Fl_GDI_Image_Surface_Driver::set_current() {
HDC gc = fl_makeDC(offscreen);
+ driver()->gc(gc);
+ SetWindowOrgEx(gc, origin.x, origin.y, NULL);
Fl_Surface_Device::set_current();
pre_window = fl_window;
- driver()->gc(gc);
_savedc = SaveDC(gc);
fl_window=(HWND)offscreen;
- fl_push_no_clip();
}
@@ -98,9 +100,9 @@ Fl_RGB_Image* Fl_GDI_Image_Surface_Driver::image()
void Fl_GDI_Image_Surface_Driver::end_current_(Fl_Surface_Device*)
{
HDC gc = (HDC)driver()->gc();
+ GetWindowOrgEx(gc, &origin);
RestoreDC(gc, _savedc);
DeleteDC(gc);
- fl_pop_clip();
fl_window = pre_window;
}