Fix builtin glyph corruption in the D2D renderer (#17464)

The initial contents of a texture are undefined. That's not good.
Now they are. That's good.

(cherry picked from commit 8c14a34263165bb3ab0a3689dc49840159a17820)
Service-Card-Id: 92788897
Service-Version: 1.21
This commit is contained in:
Leonard Hecker 2024-06-23 12:09:42 +02:00 committed by Dustin L. Howett
parent 9cccef7224
commit 846a8aa7a6

View File

@ -394,8 +394,14 @@ void BackendD2D::_prepareBuiltinGlyphRenderTarget(const RenderingPayload& p)
THROW_IF_FAILED(target->GetBitmap(_builtinGlyphsBitmap.put()));
_builtinGlyphsRenderTarget = target.query<ID2D1DeviceContext>();
_builtinGlyphsBitmapCellCountU = cellCountU;
_builtinGlyphsRenderTargetActive = false;
memset(&_builtinGlyphsReady[0], 0, sizeof(_builtinGlyphsReady));
_builtinGlyphsRenderTarget->BeginDraw();
_builtinGlyphsRenderTargetActive = true;
// The initial contents of the bitmap are undefined.
// -> We need to define them. :)
_builtinGlyphsRenderTarget->Clear();
}
D2D1_RECT_U BackendD2D::_prepareBuiltinGlyph(const RenderingPayload& p, char32_t ch, u32 off)