mirror of
https://github.com/electron/electron.git
synced 2026-01-27 16:28:23 -05:00
fix black bars around popups and scaled images when using gpu rendering
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user