Commit ce207f68 authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Use Display::GetSizeInPixel to obtain the pixel size of the display

display size.

Bug: 141898654
Test: manually confirmed that this produces the same size as android's
Change-Id: I139479a615cd4aa0601b06874ad532df20141d15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845487Reviewed-by: default avatarKazuhiro Inaba <kinaba@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703956}
parent 13e71993
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/dip_util.h" #include "ui/compositor/dip_util.h"
#include "ui/display/display.h"
#include "ui/display/manager/display_manager.h" #include "ui/display/manager/display_manager.h"
#include "ui/display/screen.h"
#include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h" #include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h"
...@@ -118,16 +120,16 @@ mojom::ScreenCaptureSessionPtr ArcScreenCaptureSession::Initialize( ...@@ -118,16 +120,16 @@ mojom::ScreenCaptureSessionPtr ArcScreenCaptureSession::Initialize(
return nullptr; return nullptr;
} }
ui::Layer* layer = display_root_window_->layer();
if (!layer) {
LOG(ERROR) << "Unable to find layer for the desktop window";
return nullptr;
}
auto context_provider = GetContextProvider(); auto context_provider = GetContextProvider();
gl_helper_ = std::make_unique<viz::GLHelper>( gl_helper_ = std::make_unique<viz::GLHelper>(
context_provider->ContextGL(), context_provider->ContextSupport()); context_provider->ContextGL(), context_provider->ContextSupport());
gfx::Size desktop_size =
ui::ConvertSizeToPixel(layer, layer->bounds().size()); display::Display display =
display::Screen::GetScreen()->GetDisplayNearestWindow(
display_root_window_);
gfx::Size desktop_size = display.GetSizeInPixel();
scaler_ = gl_helper_->CreateScaler( scaler_ = gl_helper_->CreateScaler(
viz::GLHelper::ScalerQuality::SCALER_QUALITY_GOOD, viz::GLHelper::ScalerQuality::SCALER_QUALITY_GOOD,
gfx::Vector2d(desktop_size.width(), desktop_size.height()), gfx::Vector2d(desktop_size.width(), desktop_size.height()),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment