Skip to content

Commit

Permalink
Fix builtin glyph corruption in the D2D renderer (#17464)
Browse files Browse the repository at this point in the history
The initial contents of a texture are undefined. That's not good.
Now they are. That's good.
lhecker authored Jun 23, 2024

Verified

This commit was signed with the committer’s verified signature.
blizzz Arthur Schiwon
1 parent bb4981c commit 8c14a34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/renderer/atlas/BackendD2D.cpp
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 8c14a34

Please sign in to comment.