Windows: Resize offscreen compositor window to match view size (issue #1933)

This commit is contained in:
Marshall Greenblatt 2016-08-17 17:29:38 +02:00
parent e2f626dcf8
commit 37d988bda8
5 changed files with 14 additions and 0 deletions

View File

@ -1375,6 +1375,7 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer() {
root_layer_->SetBounds(gfx::Rect(size));
compositor_->SetScaleAndSize(scale_factor_, size_in_pixels);
PlatformResizeCompositorWidget(size_in_pixels);
}
void CefRenderWidgetHostViewOSR::OnBeginFrameTimerTick() {

View File

@ -315,6 +315,7 @@ class CefRenderWidgetHostViewOSR
#endif // defined(OS_MACOSX)
void PlatformCreateCompositorWidget();
void PlatformResizeCompositorWidget(const gfx::Size& size);
void PlatformDestroyCompositorWidget();
#if defined(USE_AURA)

View File

@ -123,6 +123,9 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
compositor_widget_ = window_->xwindow();
}
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size&) {
}
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
DCHECK(window_);
window_->Close();

View File

@ -318,6 +318,9 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
browser_compositor_->Unsuspend();
}
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size&) {
}
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
DCHECK(window_);

View File

@ -149,6 +149,12 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
compositor_widget_ = window_->hwnd();
}
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size& size) {
DCHECK(window_);
SetWindowPos(window_->hwnd(), NULL, 0, 0, size.width(), size.height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW);
}
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
window_.reset(NULL);
compositor_widget_ = gfx::kNullAcceleratedWidget;