fix black bars around popups and scaled images when using gpu rendering

This commit is contained in:
Heilig Benedek 2017-04-12 04:11:49 +02:00
parent 155fef99ae
commit 2f32311292

View file

@ -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();
}
}