Bug 1642839 - Implement WebRenderLayerManager::SendInvalidRegion() r=jrmuizel
When DWM is disabled, each window does not have own back buffer. They would paint directly to a buffer that was to be displayed by the video card. WM_PAINT via SendInvalidRegion() requests necessary re-paint. With it, RenderCompositorANGLE does not need to disable partial present. Differential Revision: https://phabricator.services.mozilla.com/D77989
This commit is contained in:
@@ -671,6 +671,18 @@ void WebRenderLayerManager::WaitOnTransactionProcessed() {
|
|||||||
|
|
||||||
void WebRenderLayerManager::SendInvalidRegion(const nsIntRegion& aRegion) {
|
void WebRenderLayerManager::SendInvalidRegion(const nsIntRegion& aRegion) {
|
||||||
// XXX Webrender does not support invalid region yet.
|
// XXX Webrender does not support invalid region yet.
|
||||||
|
|
||||||
|
#ifdef XP_WIN
|
||||||
|
// When DWM is disabled, each window does not have own back buffer. They would
|
||||||
|
// paint directly to a buffer that was to be displayed by the video card.
|
||||||
|
// WM_PAINT via SendInvalidRegion() requests necessary re-paint.
|
||||||
|
const bool needsInvalidate = !gfx::gfxVars::DwmCompositionEnabled();
|
||||||
|
#else
|
||||||
|
const bool needsInvalidate = true;
|
||||||
|
#endif
|
||||||
|
if (needsInvalidate && WrBridge()) {
|
||||||
|
WrBridge()->SendInvalidateRenderedFrame();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRenderLayerManager::ScheduleComposite() {
|
void WebRenderLayerManager::ScheduleComposite() {
|
||||||
|
|||||||
@@ -928,17 +928,7 @@ void RenderCompositorANGLE::InitializeUsePartialPresent() {
|
|||||||
|
|
||||||
bool RenderCompositorANGLE::UsePartialPresent() { return mUsePartialPresent; }
|
bool RenderCompositorANGLE::UsePartialPresent() { return mUsePartialPresent; }
|
||||||
|
|
||||||
bool RenderCompositorANGLE::RequestFullRender() {
|
bool RenderCompositorANGLE::RequestFullRender() { return mFullRender; }
|
||||||
if (!gfx::gfxVars::DwmCompositionEnabled()) {
|
|
||||||
// When DWM is disabled, background window needs to repaint its visible
|
|
||||||
// region with WM_PAINT. But invalid region is not supported yet by
|
|
||||||
// WebRenderLayerManager::SendInvalidRegion(). When partial present is
|
|
||||||
// enabled, there is a case that updated rectangle does not cover the
|
|
||||||
// invalid region. Then requests full render for now.
|
|
||||||
mFullRender = true;
|
|
||||||
}
|
|
||||||
return mFullRender;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t RenderCompositorANGLE::GetMaxPartialPresentRects() {
|
uint32_t RenderCompositorANGLE::GetMaxPartialPresentRects() {
|
||||||
if (!mUsePartialPresent) {
|
if (!mUsePartialPresent) {
|
||||||
|
|||||||
@@ -2657,12 +2657,6 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) {
|
|||||||
// don't have a compositing window manager, our pixels could be stale.
|
// don't have a compositing window manager, our pixels could be stale.
|
||||||
GetLayerManager()->SetNeedsComposite(true);
|
GetLayerManager()->SetNeedsComposite(true);
|
||||||
GetLayerManager()->SendInvalidRegion(region.ToUnknownRegion());
|
GetLayerManager()->SendInvalidRegion(region.ToUnknownRegion());
|
||||||
if (WebRenderLayerManager* wrlm =
|
|
||||||
GetLayerManager()->AsWebRenderLayerManager()) {
|
|
||||||
if (WebRenderBridgeChild* bridge = wrlm->WrBridge()) {
|
|
||||||
bridge->SendInvalidateRenderedFrame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<nsWindow> strongThis(this);
|
RefPtr<nsWindow> strongThis(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user