From 5e57976bba24409080d3681f0a921884e4f937bb Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 4 Oct 2020 23:43:19 +0200 Subject: [PATCH] Don't use ID2D1Bitmap::GetSize() to get source bitmap size Closes https://github.com/wxWidgets/wxWidgets/pull/2074 See #17171, #18686. --- src/msw/graphicsd2d.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index a436dd6243..cc6bdb08d4 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -4494,11 +4494,11 @@ void wxD2DContext::DrawBitmap(const wxGraphicsBitmap& bmp, wxDouble x, wxDouble wxD2DBitmapData* bitmapData = wxGetD2DBitmapData(bmp); bitmapData->Bind(this); - D2D1_SIZE_F imgSize = bitmapData->GetD2DBitmap()->GetSize(); + wxBitmap const& bitmap = static_cast(bitmapData->GetNativeBitmap())->GetSourceBitmap(); m_renderTargetHolder->DrawBitmap( bitmapData->GetD2DBitmap(), - D2D1::RectF(0, 0, imgSize.width, imgSize.height), + D2D1::RectF(0, 0, bitmap.GetWidth(), bitmap.GetHeight()), D2D1::RectF(x, y, x + w, y + h), GetInterpolationQuality(), GetCompositionMode());