From 2f32311292117f5eda05d1f1403548bbaa653eb8 Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Wed, 12 Apr 2017 04:11:49 +0200 Subject: [PATCH] fix black bars around popups and scaled images when using gpu rendering --- atom/browser/osr/osr_web_contents_view.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atom/browser/osr/osr_web_contents_view.cc b/atom/browser/osr/osr_web_contents_view.cc index 8fe6968319..efcdafd51c 100644 --- a/atom/browser/osr/osr_web_contents_view.cc +++ b/atom/browser/osr/osr_web_contents_view.cc @@ -30,6 +30,8 @@ OffScreenWebContentsView::~OffScreenWebContentsView() { void OffScreenWebContentsView::SetWebContents( content::WebContents* web_contents) { web_contents_ = web_contents; + + RenderViewCreated(web_contents_->GetRenderViewHost()); } #if !defined(OS_MACOSX) @@ -139,23 +141,22 @@ void OffScreenWebContentsView::SetOverscrollControllerEnabled(bool enabled) { } void OffScreenWebContentsView::GetScreenInfo( - content::ScreenInfo* screen_info) const { + content::ScreenInfo* screen_info) const { screen_info->depth = 24; screen_info->depth_per_component = 8; screen_info->orientation_angle = 0; + screen_info->device_scale_factor = 1.0; screen_info->orientation_type = content::SCREEN_ORIENTATION_VALUES_LANDSCAPE_PRIMARY; if (GetView()) { screen_info->rect = gfx::Rect(GetView()->size()); screen_info->available_rect = gfx::Rect(GetView()->size()); - screen_info->device_scale_factor = GetView()->scale_factor(); } else { const display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); screen_info->rect = display.bounds(); screen_info->available_rect = display.work_area(); - screen_info->device_scale_factor = display.device_scale_factor(); } }