summaryrefslogtreecommitdiff
path: root/src/fl_scroll_area.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/fl_scroll_area.cxx')
-rw-r--r--src/fl_scroll_area.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fl_scroll_area.cxx b/src/fl_scroll_area.cxx
index 40609bc51..ff07ef3b4 100644
--- a/src/fl_scroll_area.cxx
+++ b/src/fl_scroll_area.cxx
@@ -151,6 +151,16 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
BitBlt(fl_gc, dest_x, dest_y, src_w, src_h, fl_gc, src_x, src_y,SRCCOPY);
#elif defined(__APPLE_QUARTZ__)
+
+#if defined(__APPLE_COCOA__)
+ extern CGImageRef MAC_CGImageFromRectOfWindow(Fl_Window*, int x, int y, int w, int h);
+ CGImageRef img = MAC_CGImageFromRectOfWindow(Fl_Window::current(), src_x, src_y, src_w, src_h);
+ CGRect rect = { { dest_x, dest_y }, { src_w, src_h } };
+ Fl_X::q_begin_image(rect, 0, 0, src_w, src_h);
+ CGContextDrawImage(fl_gc, rect, img);
+ Fl_X::q_end_image();
+ CFRelease(img);
+#else
// warning: there does not seem to be an equivalent to this function in Quartz
// ScrollWindowRect is a QuickDraw function and won't work here.
// Since on OS X all windows are fully double buffered, we need not
@@ -161,6 +171,8 @@ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
static RGBColor fg = { 0x0000, 0x0000, 0x0000 }; RGBForeColor( &fg );
CopyBits( GetPortBitMapForCopyBits( GetWindowPort(fl_window) ),
GetPortBitMapForCopyBits( GetWindowPort(fl_window) ), &src, &dst, srcCopy, 0L);
+#endif
+
#else
# error unsupported platform
#endif