From: Paul Cornett Date: Sun, 20 Jan 2013 02:04:57 +0000 (+0000) Subject: draw monochrome source directly onto destination when it is also monochrome X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d4ca3c5d8de0a336a7a805db9751b13b63dc745d draw monochrome source directly onto destination when it is also monochrome git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 8a6960eb24..03d4585115 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -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.