diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-14 21:26:06 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-14 21:26:06 +0000 |
| commit | 0c396a615b89530d54ad019f690fcf0d1eed2072 (patch) | |
| tree | 0ce7db5d3d5cd53cf1b9685bf68ffa8848a20250 /src/Fl_Pixmap.cxx | |
| parent | 0f61132a755a1267bbf7d0a9b72c6a033e64b8ec (diff) | |
Added fl_create_deepmask() method for creating alpha blend masks.
Implemented Fl_RGB_Image alpha blending for MacOS X - others still
get 1-bit screen-door transparency...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2083 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Pixmap.cxx')
| -rw-r--r-- | src/Fl_Pixmap.cxx | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx index 3fba05cc6..728cc9ffa 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.15 2002/04/11 11:52:41 easysw Exp $" +// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.16 2002/04/14 21:26:06 easysw Exp $" // // Pixmap drawing code for the Fast Light Tool Kit (FLTK). // @@ -102,11 +102,10 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCPAINT); DeleteDC(new_gc); } else { - fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy); + fl_copy_offscreen(X, Y, W, H, id, cx, cy); } #elif defined(__APPLE__) - if ( mask ) - { + if (mask) { Rect src, dst; src.left = 0; src.right = w(); src.top = 0; src.bottom = h(); @@ -114,18 +113,15 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { dst.top = Y; dst.bottom = Y+h(); RGBColor rgb; rgb.red = 0xffff; rgb.green = 0xffff; rgb.blue = 0xffff; - RGBBackColor( &rgb ); + RGBBackColor(&rgb); rgb.red = 0x0000; rgb.green = 0x0000; rgb.blue = 0x0000; - RGBForeColor( &rgb ); - CopyMask( - GetPortBitMapForCopyBits((GrafPtr)id), - GetPortBitMapForCopyBits((GrafPtr)mask), - GetPortBitMapForCopyBits( GetWindowPort(fl_window) ), - &src, &src, &dst); - } - else - { - fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy); + RGBForeColor(&rgb); + CopyMask(GetPortBitMapForCopyBits((GrafPtr)id), + GetPortBitMapForCopyBits((GrafPtr)mask), + GetPortBitMapForCopyBits(GetWindowPort(fl_window)), + &src, &src, &dst); + } else { + fl_copy_offscreen(X, Y, W, H, id, cx, cy); } #else if (mask) { @@ -140,7 +136,7 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) { int oy = Y-cy; if (oy < 0) oy += h(); XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy); } - fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy); + fl_copy_offscreen(X, Y, W, H, id, cx, cy); if (mask) { // put the old clip region back XSetClipOrigin(fl_display, fl_gc, 0, 0); @@ -467,5 +463,5 @@ void Fl_Pixmap::desaturate() { } // -// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.15 2002/04/11 11:52:41 easysw Exp $". +// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.16 2002/04/14 21:26:06 easysw Exp $". // |
