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

[Cleanup] Remove obsolete GetDensityRatio

Bug: None
Change-Id: I0aa45c8214cbd847aedbf2ffaeb24236d76b3cc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2493254Reviewed-by: default avatarMalay Keshav <malaykeshav@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821573}
parent a8b5f272
......@@ -114,7 +114,6 @@ Pointer::Pointer(PointerDelegate* delegate, Seat* seat)
seat_(seat),
cursor_(ui::mojom::CursorType::kNull),
capture_scale_(GetCaptureDisplayInfo().device_scale_factor()),
capture_ratio_(GetCaptureDisplayInfo().GetDensityRatio()),
cursor_capture_source_id_(base::UnguessableToken::Create()) {
WMHelper* helper = WMHelper::GetInstance();
helper->AddPreTargetHandler(this);
......@@ -598,7 +597,6 @@ void Pointer::OnCursorDisplayChanged(const display::Display& display) {
UpdatePointerSurface(root_surface());
auto info = GetCaptureDisplayInfo();
capture_scale_ = info.device_scale_factor();
capture_ratio_ = info.GetDensityRatio();
auto* cursor_client = WMHelper::GetInstance()->GetCursorClient();
// TODO(crbug.com/631103): CursorClient does not exist in mash yet.
......@@ -747,7 +745,7 @@ void Pointer::UpdateCursor() {
if (cursor_ == ui::mojom::CursorType::kCustom) {
SkBitmap bitmap = cursor_bitmap_;
gfx::Point hotspot =
gfx::ScaleToFlooredPoint(cursor_hotspot_, capture_ratio_);
gfx::ScaleToFlooredPoint(cursor_hotspot_, capture_scale_);
// TODO(oshima|weidongg): Add cutsom cursor API to handle size/display
// change without explicit management like this. https://crbug.com/721601.
......
......@@ -211,10 +211,6 @@ class Pointer : public SurfaceTreeHost,
// Scale at which cursor snapshot is captured.
float capture_scale_;
// Density ratio of the cursor snapshot. The bitmap is scaled on displays with
// a different ratio.
float capture_ratio_;
// Source used for cursor capture copy output requests.
const base::UnguessableToken cursor_capture_source_id_;
......
......@@ -407,12 +407,6 @@ void ManagedDisplayInfo::SetBounds(const gfx::Rect& new_bounds_in_native) {
UpdateDisplaySize();
}
float ManagedDisplayInfo::GetDensityRatio() const {
if (Display::IsInternalDisplayId(id_) && device_scale_factor_ == 1.25f)
return 1.0f;
return device_scale_factor_;
}
float ManagedDisplayInfo::GetEffectiveDeviceScaleFactor() const {
return device_scale_factor_ * zoom_factor_;
}
......
......@@ -202,10 +202,6 @@ class DISPLAY_MANAGER_EXPORT ManagedDisplayInfo {
// Returns the rotation set by a given |source|.
Display::Rotation GetRotation(Display::RotationSource source) const;
// Returns a measure of density relative to a display with 1.0 DSF. Unlike the
// effective DSF, this is independent from the UI scale.
float GetDensityRatio() const;
// Returns the ui scale and device scale factor actually used to create
// display that chrome sees. This is |device_scale_factor| x |zoom_factor_|.
// TODO(oshima): Rename to |GetDeviceScaleFactor()|.
......
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