From 8dc4bd40a8e5d472b831a9458db9b4bbc0465f8a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 9 Aug 2017 20:36:42 +0200 Subject: [PATCH] Don't convert any non-monochrome wxBitmap to ARGB format While selecting wxBitmap with colour depth > 1 bpp into wxMemoryDC there is no need to convert its format to ARGB regardless of the current interpretation of the alpha channel values in the bitmap. If original bitmap was marked as a RGB one (with alpha channel being ignored), it should retain this format to avoid confusions. Closes #16309. --- docs/changes.txt | 1 + src/osx/core/dcmemory.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 17d8b0766d..3afa22464b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -228,6 +228,7 @@ wxOSX: - Implement wxTextCtrl::ShowPosition(). - Add support for wxTE_NO_VSCROLL style to wxTextCtrl. - Add support for wxTE_CHARWRAP style to wxTextCtrl. +- Fix selecting RGB bitmaps (with no alpha channel) into wxMemoryDC. Unix: diff --git a/src/osx/core/dcmemory.cpp b/src/osx/core/dcmemory.cpp index aeb700ddff..4d66d1cef9 100644 --- a/src/osx/core/dcmemory.cpp +++ b/src/osx/core/dcmemory.cpp @@ -72,8 +72,6 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) m_selected = bitmap; if (m_selected.IsOk()) { - if ( m_selected.GetDepth() != 1 ) - m_selected.UseAlpha() ; m_selected.BeginRawAccess() ; m_width = bitmap.GetScaledWidth(); m_height = bitmap.GetScaledHeight();