diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2004-08-31 22:00:49 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2004-08-31 22:00:49 +0000 |
| commit | 98a0be39654892de753912045a36bd7f66eac31c (patch) | |
| tree | d39bb112c2484c0c8266b91df8fdacc59929a1e4 /src/Fl_Pixmap.cxx | |
| parent | a3155cb205973ee1ebd1bbcf807232a119e67806 (diff) | |
Quartz for FLTK1.1
- Pixmaps now correctly support transparency/masking
- subimage drawing aligned correctly
- lines with a size over 1 always anti-alias
- fl_begin_points/fl_end_points works
- fixed refresh problem for multiple open windows
Will check Linux compile right after this commit to make sure that
I didn't destroy anything.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3800 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Pixmap.cxx')
| -rw-r--r-- | src/Fl_Pixmap.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx index 82e8250f5..1fbd68a74 100644 --- a/src/Fl_Pixmap.cxx +++ b/src/Fl_Pixmap.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.31 2004/08/31 01:29:54 easysw Exp $" +// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.32 2004/08/31 22:00:47 matthiaswm Exp $" // // Pixmap drawing code for the Fast Light Tool Kit (FLTK). // @@ -41,6 +41,10 @@ #include "flstring.h" #include <ctype.h> +#ifdef __APPLE_QUARTZ__ +extern Fl_Offscreen fl_create_offscreen_with_alpha(int w, int h); +#endif + extern uchar **fl_mask_bitmap; // used by fl_draw_pixmap.cxx to store mask void fl_restore_clip(); // in fl_rect.cxx @@ -80,7 +84,12 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { if (cy+H > h()) H = h()-cy; if (H <= 0) return; if (!id) { -//#warning : to enable masking in Quartz, write our own version of this little function! +#ifdef __APPLE_QUARTZ__ + id = fl_create_offscreen_with_alpha(w(), h()); + fl_begin_offscreen((Fl_Offscreen)id); + fl_draw_pixmap(data(), 0, 0, FL_GREEN); + fl_end_offscreen(); +#else id = fl_create_offscreen(w(), h()); fl_begin_offscreen((Fl_Offscreen)id); uchar *bitmap = 0; @@ -91,8 +100,8 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { mask = fl_create_bitmask(w(), h(), bitmap); delete[] bitmap; } - fl_end_offscreen(); +#endif } #ifdef WIN32 if (mask) { @@ -464,5 +473,5 @@ void Fl_Pixmap::desaturate() { } // -// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.31 2004/08/31 01:29:54 easysw Exp $". +// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.32 2004/08/31 22:00:47 matthiaswm Exp $". // |
