X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c3562311c8fd0a0a6f7682fa229ad9083b4c9091..96c9640205933ad0673d5af2c96af0816c50160c:/src/msw/graphics.cpp diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index af177f3365..dd6ff85899 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -272,7 +272,7 @@ private: GraphicsPath* m_brushPath; }; -class WXDLLIMPEXP_CORE wxGDIPlusBitmapData : public wxGraphicsObjectRefData +class WXDLLIMPEXP_CORE wxGDIPlusBitmapData : public wxGraphicsBitmapData { public: wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, Bitmap* bitmap ); @@ -280,6 +280,7 @@ public: ~wxGDIPlusBitmapData (); virtual Bitmap* GetGDIPlusBitmap() { return m_bitmap; } + void* GetNativeBitmap() const { return (void*)m_bitmap; } #if wxUSE_IMAGE wxImage ConvertToImage() const; @@ -396,10 +397,7 @@ protected: void Init(Graphics* graphics, int width, int height); private: - virtual void DoDrawText(const wxString& str, wxDouble x, wxDouble y) - { DoDrawFilledText(str, x, y, wxNullGraphicsBrush); } - virtual void DoDrawFilledText(const wxString& str, wxDouble x, wxDouble y, - const wxGraphicsBrush& backgroundBrush); + virtual void DoDrawText(const wxString& str, wxDouble x, wxDouble y); Graphics* m_context; wxStack m_stateStack; @@ -946,13 +944,13 @@ wxGDIPlusFontData::~wxGDIPlusFontData() //----------------------------------------------------------------------------- wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, Bitmap* bitmap ) : - wxGraphicsObjectRefData( renderer ), m_bitmap( bitmap ) + wxGraphicsBitmapData( renderer ), m_bitmap( bitmap ) { m_helper = NULL; } wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, - const wxBitmap &bmp) : wxGraphicsObjectRefData( renderer ) + const wxBitmap &bmp) : wxGraphicsBitmapData( renderer ) { m_bitmap = NULL; m_helper = NULL; @@ -1541,8 +1539,6 @@ bool wxGDIPlusContext::SetInterpolationQuality(wxInterpolationQuality interpolat if (m_interpolation == interpolation) return true; - m_interpolation = interpolation; - InterpolationMode interpolationMode = InterpolationModeDefault; switch (interpolation) { @@ -1569,7 +1565,12 @@ bool wxGDIPlusContext::SetInterpolationQuality(wxInterpolationQuality interpolat default: return false; } - m_context->SetInterpolationMode(interpolationMode); + + if ( m_context->SetInterpolationMode(interpolationMode) != Gdiplus::Ok ) + return false; + + m_interpolation = interpolation; + return true; } @@ -1730,9 +1731,8 @@ void wxGDIPlusContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxD DeleteObject(iconInfo.hbmMask); } -void wxGDIPlusContext::DoDrawFilledText(const wxString& str, - wxDouble x, wxDouble y, - const wxGraphicsBrush& brush) +void wxGDIPlusContext::DoDrawText(const wxString& str, + wxDouble x, wxDouble y ) { if (m_composition == wxCOMPOSITION_DEST) return; @@ -1745,9 +1745,7 @@ void wxGDIPlusContext::DoDrawFilledText(const wxString& str, wxGDIPlusFontData * const fontData = (wxGDIPlusFontData *)m_font.GetRefData(); - wxGDIPlusBrushData * const - brushData = (wxGDIPlusBrushData *)brush.GetRefData(); - + m_context->DrawString ( str.wc_str(*wxConvUI), // string to draw, always Unicode @@ -1755,8 +1753,7 @@ void wxGDIPlusContext::DoDrawFilledText(const wxString& str, fontData->GetGDIPlusFont(), PointF(x, y), StringFormat::GenericTypographic(), - brushData ? brushData->GetGDIPlusBrush() - : fontData->GetGDIPlusBrush() + fontData->GetGDIPlusBrush() ); }