]> git.saurik.com Git - wxWidgets.git/commitdiff
draw monochrome source directly onto destination when it is also monochrome
authorPaul Cornett <paulcor@bullseye.com>
Sun, 20 Jan 2013 02:04:57 +0000 (02:04 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 20 Jan 2013 02:04:57 +0000 (02:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dcclient.cpp

index 8a6960eb2439c8dad3a5ac97cd8ce2a7a5892de1..03d45851154386954428e7ccfd8b4a0f1915bfc0 100644 (file)
@@ -1164,9 +1164,12 @@ void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap,
         pixmap = bitmap.GetPixmap();
     if (pixmap && gdk_drawable_get_depth(pixmap) == 1)
     {
-        // convert mono pixmap to color using text fg/bg colors
-        pixmap = MonoToColor(pixmap, 0, 0, w, h);
-        pixmap_new = pixmap;
+        if (gdk_drawable_get_depth(m_gdkwindow) != 1)
+        {
+            // convert mono pixmap to color using text fg/bg colors
+            pixmap = MonoToColor(pixmap, 0, 0, w, h);
+            pixmap_new = pixmap;
+        }
     }
     else if (hasAlpha || pixmap == NULL)
         pixbuf = bitmap.GetPixbuf();
@@ -1340,7 +1343,8 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
     }
 
     GdkPixmap* pixmap = NULL;
-    if (gdk_drawable_get_depth(srcDrawable) == 1)
+    if (gdk_drawable_get_depth(srcDrawable) == 1 &&
+        (gdk_drawable_get_depth(m_gdkwindow) != 1 || isScaled))
     {
         // Convert mono pixmap to color using text fg/bg colors.
         // Scaling/drawing is simpler if this is done first.