summaryrefslogtreecommitdiff
path: root/src/Fl_Image.cxx
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2008-10-13 23:10:43 +0000
committerFabien Costantini <fabien@onepost.net>2008-10-13 23:10:43 +0000
commit92051890f1127429142cc0b60e3e9a1e567bf01d (patch)
tree4c0e7f28192914b24202d08aa3eaa72a7bf5f7e4 /src/Fl_Image.cxx
parent8e9c1d1ab030dc7beed522f368c467dd94e1f8bb (diff)
Quickdraw removal: option removed from configure, all Qd code removed from sources. Also took this opportunity to sort the ifdef clauses so that USE_X11 shows first. Also added error pragma to enforce proper target checking, thus make even less assumptions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6423 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Image.cxx')
-rw-r--r--src/Fl_Image.cxx76
1 files changed, 26 insertions, 50 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index ed5ff1dbe..b2385437d 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -482,56 +482,8 @@ void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
}
#endif
}
-#ifdef WIN32
- if (mask) {
- HDC new_gc = CreateCompatibleDC(fl_gc);
- int save = SaveDC(new_gc);
- SelectObject(new_gc, (void*)mask);
- BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCAND);
- SelectObject(new_gc, (void*)id);
- BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCPAINT);
- RestoreDC(new_gc,save);
- DeleteDC(new_gc);
- } else if (d()==2 || d()==4) {
- fl_copy_offscreen_with_alpha(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
- } else {
- fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
- }
-#elif defined(__APPLE_QD__)
- if (mask) {
- Rect src, dst;
- // MRS: STR #114 says we should be using cx, cy, W, and H...
-// src.left = 0; src.right = w();
-// src.top = 0; src.bottom = h();
-// dst.left = X; dst.right = X+w();
-// dst.top = Y; dst.bottom = Y+h();
- src.left = cx; src.right = cx+W;
- src.top = cy; src.bottom = cy+H;
- dst.left = X; dst.right = X+W;
- dst.top = Y; dst.bottom = Y+H;
- RGBColor rgb;
- rgb.red = 0xffff; rgb.green = 0xffff; rgb.blue = 0xffff;
- 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 if (id) fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
- else {
- // Composite image with alpha manually each time...
- alpha_blend(this, X, Y, W, H, cx, cy);
- }
-#elif defined(__APPLE_QUARTZ__)
- if (id && fl_gc) {
- CGRect rect = { { X, Y }, { W, H } };
- Fl_X::q_begin_image(rect, cx, cy, w(), h());
- CGContextDrawImage(fl_gc, rect, (CGImageRef)id);
- Fl_X::q_end_image();
- }
-#else
+
+#if defined(USE_X11)
if (id) {
if (mask) {
// I can't figure out how to combine a mask with existing region,
@@ -557,6 +509,30 @@ void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
// Composite image with alpha manually each time...
alpha_blend(this, X, Y, W, H, cx, cy);
}
+#elif defined(WIN32)
+ if (mask) {
+ HDC new_gc = CreateCompatibleDC(fl_gc);
+ int save = SaveDC(new_gc);
+ SelectObject(new_gc, (void*)mask);
+ BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCAND);
+ SelectObject(new_gc, (void*)id);
+ BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCPAINT);
+ RestoreDC(new_gc,save);
+ DeleteDC(new_gc);
+ } else if (d()==2 || d()==4) {
+ fl_copy_offscreen_with_alpha(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
+ } else {
+ fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
+ }
+#elif defined(__APPLE_QUARTZ__)
+ if (id && fl_gc) {
+ CGRect rect = { { X, Y }, { W, H } };
+ Fl_X::q_begin_image(rect, cx, cy, w(), h());
+ CGContextDrawImage(fl_gc, rect, (CGImageRef)id);
+ Fl_X::q_end_image();
+ }
+#else
+# error unsupported platform
#endif
}