From: Vadim Zeitlin Date: Sun, 24 Oct 2010 22:40:34 +0000 (+0000) Subject: No real changes, just inline wxDIB::Create(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/69060f4f0c6a35cd4e8c031794f7c78c59712539?ds=inline No real changes, just inline wxDIB::Create(). After removing wxDIB::m_hasAlpha in the previous commit, this method became completely trivial so put it inline in the header. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/dib.h b/include/wx/msw/dib.h index d9e5745ee3..c85c9e9d2c 100644 --- a/include/wx/msw/dib.h +++ b/include/wx/msw/dib.h @@ -53,7 +53,7 @@ public: // same as the corresponding ctors but with return value bool Create(int width, int height, int depth); - bool Create(const wxBitmap& bmp); + bool Create(const wxBitmap& bmp) { return Create(GetHbitmapOf(bmp)); } bool Create(HBITMAP hbmp); bool Load(const wxString& filename); diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index d6d127a340..45986e70ad 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -137,18 +137,10 @@ bool wxDIB::Create(int width, int height, int depth) return true; } -bool wxDIB::Create(const wxBitmap& bmp) -{ - wxCHECK_MSG( bmp.Ok(), false, wxT("wxDIB::Create(): invalid bitmap") ); - - if ( !Create(GetHbitmapOf(bmp)) ) - return false; - - return true; -} - bool wxDIB::Create(HBITMAP hbmp) { + wxCHECK_MSG( hbmp, false, wxT("wxDIB::Create(): invalid bitmap") ); + // this bitmap could already be a DIB section in which case we don't need // to convert it to DIB DIBSECTION ds;