summaryrefslogtreecommitdiff
path: root/FL/Fl_Cairo_Window.H
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-03-14 18:46:56 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-03-14 19:51:34 +0100
commit0f41797b7ab0ee010e31659f60cafd38affac8f5 (patch)
treeb7202f3bfcc801c6af29890e128de3a848fc70fa /FL/Fl_Cairo_Window.H
parent0eb6a0e193d7608650728f42b88e9dfc0ab29282 (diff)
Cairo: introduce Fl::cairo_flush() in FLTK API
Flushing the Cairo context is necessary on Windows to make Cairo drawings appear on the device (screen). This new method makes it easy for user code to do this correctly after using Cairo drawings. - add Fl::cairo_flush(cairo_t *) - document Fl::cairo_flush(cairo_t *) - reformat Cairo doxygen docs and code (partially) - use the new method in Fl_Cairo_Window - use the new method in test/cairo_test.cxx - other minor (text) changes in test/cairo_test.cxx - add test/cairo_test to the demo menu (test/demo.menu)
Diffstat (limited to 'FL/Fl_Cairo_Window.H')
-rw-r--r--FL/Fl_Cairo_Window.H3
1 files changed, 1 insertions, 2 deletions
diff --git a/FL/Fl_Cairo_Window.H b/FL/Fl_Cairo_Window.H
index 65a8d5eeb..2470dd0fe 100644
--- a/FL/Fl_Cairo_Window.H
+++ b/FL/Fl_Cairo_Window.H
@@ -102,8 +102,7 @@ protected:
Fl::cairo_make_current(this);
draw_cb_(this, Fl::cairo_cc());
// flush Cairo drawings: necessary at least for Windows
- cairo_surface_t *s = cairo_get_target(Fl::cairo_cc());
- cairo_surface_flush(s);
+ Fl::cairo_flush(Fl::cairo_cc());
}
}