Commit b005a9a8 authored by Bill Carr's avatar Bill Carr Committed by Commit Bot

Reduce 3d Engine Work for Steady State Video Playback

When DirectCompositionChildSurfaceWin::EnqueuePendingFrame is called if
swap_rect_ is non-empty a d3d11 query is created resulting in 3d engine
work.

Due to an optimization in DirectRenderer::DrawFrame (see
https://source.chromium.org/chromium/chromium/src/+/master:components/v
iz/service/display/direct_renderer.cc;drc=be67975e
bd6cf67bbe1;l=402) we are not however currently clearing swap_rect_ by
calling DirectCompositionChildSurfaceWin::SetDrawRectangle with an
empty rect when there is no damage to the root.

As a result after the first SetDrawRectangle call 3d engine work is
performed for each queued frame.

To help reduce the amount of 3d engine work we'll reset swap_rect_ at
the end of SwapBuffers;  allowing the d3d11 query to be skipped until
the next new SetDrawRectangle occurs.

Bug: 1133916
Change-Id: I84ccf81d18a8e45e1ce871484a763c20e5bb6418
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443489
Commit-Queue: William Carr <wicarr@microsoft.com>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812886}
parent 27f267f7
......@@ -260,6 +260,11 @@ gfx::SwapResult DirectCompositionChildSurfaceWin::SwapBuffers(
? gfx::SwapResult::SWAP_ACK
: gfx::SwapResult::SWAP_FAILED;
EnqueuePendingFrame(std::move(callback));
// Reset swap_rect_ since SetDrawRectangle may not be called when the root
// damage rect is empty.
swap_rect_ = gfx::Rect();
return swap_result;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment