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.

(cherry picked from commit 8c14a34)
Service-Card-Id: 92788897
Service-Version: 1.21
  • Loading branch information
lhecker authored and DHowett committed Jun 24, 2024
1 parent 9cccef7 commit 846a8aa
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
Expand Up @@ -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)
Expand Down

0 comments on commit 846a8aa

Please sign in to comment.