diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-03-13 22:16:37 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-03-13 22:16:37 +0000 |
| commit | b496d18b85917106c48e8e6f74115b3122b603d1 (patch) | |
| tree | 4d96befa4377a81c89c6a32f4d66220199572938 /src/Fl_Window_Driver.cxx | |
| parent | 30756ae3500a62bd8f63b4df3eb3ca8f6b8b0b70 (diff) | |
Fixed 'flush()' code for single, double, and overlay buffering
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11359 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window_Driver.cxx')
| -rw-r--r-- | src/Fl_Window_Driver.cxx | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx index 9908fde9d..eda8c2901 100644 --- a/src/Fl_Window_Driver.cxx +++ b/src/Fl_Window_Driver.cxx @@ -22,6 +22,7 @@ #include "config_lib.h" #include <FL/Fl_Window_Driver.H> #include <FL/Fl.H> +#include <FL/Fl_Overlay_Window.H> #include <FL/fl_draw.H> @@ -37,41 +38,47 @@ Fl_Window_Driver::~Fl_Window_Driver() } -/* - Used in Fl::focus(Fl_Window). - Default implementation does not need to do anything. - - reimplemented for OS X Cocoa - - reimplemented for X11 - */ void Fl_Window_Driver::take_focus() { + // nothing to do } -int Fl_Window_Driver::double_flush(int eraseoverlay) { - /* This is a working, platform-independent implementation. - Some platforms may re-implement it for their own logic: - - on Mac OS, the system double buffers all windows, so it is - reimplemented to do the same as Fl_Window::flush(), except for - Fl_Overlay_Window's which fall back on this implementation. - - on Xlib, it is reimplemented if the Xdbe extension is available. - */ +void Fl_Window_Driver::flush_single() +{ Fl_X *i = Fl_X::i(pWindow); - - if (!i->other_xid) { - i->other_xid = fl_create_offscreen(pWindow->w(), pWindow->h()); - pWindow->clear_damage(FL_DAMAGE_ALL); - } - if (pWindow->damage() & ~FL_DAMAGE_EXPOSE) { - fl_clip_region(i->region); i->region = 0; - fl_begin_offscreen(i->other_xid); - fl_graphics_driver->clip_region( 0 ); - draw(); - fl_end_offscreen(); - } - return 0; + if (!i) return; + fl_clip_region(i->region); + i->region = 0; + pWindow->draw(); } + +void Fl_Window_Driver::flush_double() +{ + flush_single(); +} + + +void Fl_Window_Driver::flush_overlay() +{ + flush_single(); +} + + +void Fl_Window_Driver::draw_begin() +{ + // nothing to do +} + + +void Fl_Window_Driver::draw_end() +{ + // nothing to do +} + + + void Fl_Window_Driver::destroy_double_buffer() { Fl_X *i = Fl_X::i(pWindow); /* This is a working, platform-independent implementation. @@ -113,7 +120,6 @@ void Fl_Window_Driver::draw() { # endif } -void Fl_Window::draw() {pWindowDriver->draw();} /** Assigns a non-rectangular shape to the window. This function gives an arbitrary shape (not just a rectangular region) to an Fl_Window. |
