Commit 2bdffd7c authored by Kazuhiro Inaba's avatar Kazuhiro Inaba Committed by Commit Bot

Fix the zoom level table for 1.77777 (arc 1.5).

It looks precisely 9 levels are expected to be provided in the
current implementation.

Bug: b/137830936
Test: display_unittests
Test: Display settings does not show an invalid (Inf*Inf) resolution
Change-Id: I31e928d3534ba0f7e8cfa070f2c8c239dc524dd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832124
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
Auto-Submit: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701933}
parent 300a38d4
...@@ -49,11 +49,11 @@ constexpr std::array<ZoomListBucket, 8> kZoomListBuckets{{ ...@@ -49,11 +49,11 @@ constexpr std::array<ZoomListBucket, 8> kZoomListBuckets{{
// zoom values that includes a zoom level to go to the native resolution of the // zoom values that includes a zoom level to go to the native resolution of the
// display. Ensure that the list of DSFs are in sync with the list of default // display. Ensure that the list of DSFs are in sync with the list of default
// device scale factors in display_change_observer.cc. // device scale factors in display_change_observer.cc.
constexpr std::array<ZoomListBucketDsf, 7> kZoomListBucketsForDsf{{ constexpr std::array<ZoomListBucketDsf, 6> kZoomListBucketsForDsf{{
{1.25f, {0.7f, 1.f / 1.25f, 0.85f, 0.9f, 0.95f, 1.f, 1.1f, 1.2f, 1.3f}}, {1.25f, {0.7f, 1.f / 1.25f, 0.85f, 0.9f, 0.95f, 1.f, 1.1f, 1.2f, 1.3f}},
{1.6f, {1.f / 1.6f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1.f, 1.15f, 1.3f}}, {1.6f, {1.f / 1.6f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1.f, 1.15f, 1.3f}},
{1.6f, {1.f / 1.6f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1.f, 1.15f, 1.3f}}, {1.77777f,
{1.77777f, {1.f / 1.77777f, 0.7f, 0.8f, 0.9f, 1.f, 1.2f, 1.35f}}, {1.f / 1.77777f, 0.65f, 0.75f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f}},
{2.f, {1.f / 2.f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.25f, 1.5f}}, {2.f, {1.f / 2.f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.25f, 1.5f}},
{2.25f, {1.f / 2.25f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.15f, 1.3f, 1.5f}}, {2.25f, {1.f / 2.25f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.15f, 1.3f, 1.5f}},
{2.66666f, {2.66666f,
......
...@@ -69,6 +69,7 @@ TEST_F(DisplayUtilTest, DisplayZoomsWithInternalDsf) { ...@@ -69,6 +69,7 @@ TEST_F(DisplayUtilTest, DisplayZoomsWithInternalDsf) {
checks |= 0x01; checks |= 0x01;
if (WithinEpsilon(zoom_values[j], 1.f)) if (WithinEpsilon(zoom_values[j], 1.f))
checks |= 0x02; checks |= 0x02;
EXPECT_LT(0.0f, zoom_values[j]);
} }
EXPECT_TRUE(checks & 0x01) << "Inverse of " << dsf << " not on the list."; EXPECT_TRUE(checks & 0x01) << "Inverse of " << dsf << " not on the list.";
EXPECT_TRUE(checks & 0x02) << "Zoom level of unity is not on the list."; EXPECT_TRUE(checks & 0x02) << "Zoom level of unity is not on the list.";
......
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