[Screen Ruler] Better error handling and reuse D3D device (#20223)

* [Screen Ruler] simplify lines calculation

* [Screen Ruler] Add inches and centimeters support

* [Chore] prefer x64 toolset to avoid hitting C1076

* [Screen Ruler] Allow making screenshots in non-continuous mode

* [Screen Ruler] Use single d3d device for all ops

* [Screen Ruler] remove gpu mutex and clean up screen capturing

* [Screen Ruler] handle and log DXGI initialization failure

* [Screen Ruler] Add unhandled exception handler

* [Screen Ruler] comment out Units of Measure setting

* [Screen Ruler] introduce a separate device dedicated for capturing
This commit is contained in:
Andrey Nekrasov
2022-09-05 15:39:56 +03:00
committed by GitHub
parent feead9c68b
commit 9d7c9c1746
40 changed files with 958 additions and 429 deletions

View File

@@ -17,13 +17,13 @@ struct OpacityEffect : winrt::implements<OpacityEffect, IDrawingEffect>
struct PerGlyphOpacityTextRender : winrt::implements<PerGlyphOpacityTextRender, IDWriteTextRenderer>
{
ID2D1Factory* _pD2DFactory = nullptr;
ID2D1HwndRenderTarget* _rt = nullptr;
ID2D1RenderTarget* _rt = nullptr;
ID2D1SolidColorBrush* _baseBrush = nullptr;
PerGlyphOpacityTextRender(
wil::com_ptr<ID2D1Factory> pD2DFactory,
wil::com_ptr<ID2D1HwndRenderTarget> rt,
wil::com_ptr<ID2D1SolidColorBrush> baseBrush);
winrt::com_ptr<ID2D1Factory> pD2DFactory,
winrt::com_ptr<ID2D1RenderTarget> rt,
winrt::com_ptr<ID2D1SolidColorBrush> baseBrush);
HRESULT __stdcall DrawGlyphRun(void* clientDrawingContext,
FLOAT baselineOriginX,