[Screen Ruler] optimize d3d device & continuous capture mode (#20198)

* [Screen Ruler] Exclude overlay window from capture

* [Screen ruler] Sync OverlayUI threads creation and don't recreate d3d device
This commit is contained in:
Andrey Nekrasov
2022-08-31 17:43:32 +03:00
committed by GitHub
parent 76ebed0897
commit c7d1465946
13 changed files with 207 additions and 103 deletions

View File

@@ -217,7 +217,7 @@ void DrawMeasureToolTick(const CommonState& commonState,
D2D_POINT_2F hLineEnd{ .x = hLineStart.x + hMeasure, .y = hLineStart.y };
d2dState.rt->DrawLine(hLineStart, hLineEnd, d2dState.solidBrushes[Brush::line].get());
if (drawFeetOnCross && !continuousCapture)
if (drawFeetOnCross)
{
// To fill all pixels which are close, we call DrawLine with end point one pixel too far, since
// it doesn't get filled, i.e. end point of the range is excluded. However, we want to draw cross
@@ -236,7 +236,7 @@ void DrawMeasureToolTick(const CommonState& commonState,
D2D_POINT_2F vLineEnd{ .x = vLineStart.x, .y = vLineStart.y + vMeasure };
d2dState.rt->DrawLine(vLineStart, vLineEnd, d2dState.solidBrushes[Brush::line].get());
if (drawFeetOnCross && !continuousCapture)
if (drawFeetOnCross)
{
vLineEnd.y -= 1.f;
auto [top_start, top_end] = ComputeCrossFeetLine(vLineStart, true);