From 7650ecf6586ecc1111a5e1130ea644a830179a3e Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Thu, 25 May 2023 20:22:07 +0200 Subject: [PATCH] AtlasEngine: Fix cursor invalidation for BackendD2D (#15427) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TIL: `CreateCompatibleRenderTarget` does not initialize the bitmap it returns. You got to do that yourself just like in D3D. ## Validation Steps Performed * Set `ATLAS_DEBUG_FORCE_D2D_MODE` to 1 * Changing the cursor in the settings immediately updates it ✅ --- src/renderer/atlas/BackendD2D.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/atlas/BackendD2D.cpp b/src/renderer/atlas/BackendD2D.cpp index 50e6e90d9b4..1d0db35803b 100644 --- a/src/renderer/atlas/BackendD2D.cpp +++ b/src/renderer/atlas/BackendD2D.cpp @@ -538,6 +538,7 @@ void BackendD2D::_resizeCursorBitmap(const RenderingPayload& p, const til::size cursorRenderTarget->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED); cursorRenderTarget->BeginDraw(); + cursorRenderTarget->Clear(); { const D2D1_RECT_F rect{ 0, 0, sizeF.width, sizeF.height }; const auto brush = _brushWithColor(0xffffffff);