Fix OSR surface sizing on browser resize (fixes issue #2733).

This includes the following changes:
- Update usage of surface IDs to match the Aura implementation from the
  RWHVAura/Window classes.
- Batch CefBrowserHost::WasResized calls to avoid excessive/unnecessary calls
  to SynchronizeVisualProperties.
- Cache the results of CefRenderHandler::GetViewRect after resize and make
  RWHVOSR::GetViewBounds the source of truth for all size calculations.
- Fix bounds calculations in CefVideoConsumerOSR with GPU enabled.

Known issues:
- The size passed to OnPaint may be off by 1 pixel in cases where the device
  scale factor is not 1 and does not divide evenly into the pixel size. This is
  due to the inexact conversion from integer pixel size to integer logical size
  for GetViewRect.
This commit is contained in:
Marshall Greenblatt
2020-01-31 17:54:26 -05:00
parent afcee77abe
commit 8c6cc302d0
15 changed files with 421 additions and 230 deletions

View File

@@ -1079,7 +1079,7 @@ void CefBrowserHostImpl::WasResized() {
if (!web_contents() || !platform_delegate_)
return;
platform_delegate_->SynchronizeVisualProperties();
platform_delegate_->WasResized();
}
void CefBrowserHostImpl::WasHidden(bool hidden) {