Skip to content

Commit 2c0f661

Browse files
author
F#m
committed
Increases the threshold to check for pixel snapping
With display zoom a wide range of device scale factors can now be set as for a given device. Sometimes a value can lead to a failure in the pixel snapping check. This patch increases the threshold for these checks. Bug: 790723 Change-Id: I21ae6711f608b9f6bc99efd47d0c8466f03722eb Component: Dip Util, Pixel Snapping, Reviewed-on: https://chromium-review.googlesource.com/884361 Commit-Queue: Malay Keshav <[email protected]> Reviewed-by: Scott Violet <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#531966}(cherry picked from commit d85e91c) Reviewed-on: https://chromium-review.googlesource.com/887283 Reviewed-by: Malay Keshav <[email protected]> Cr-Commit-Position: refs/branch-heads/3325@{#94} Cr-Branched-From: bc084a8-refs/heads/master@{#530369}
1 parent 7760fad commit 2c0f661

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/compositor/dip_util.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ gfx::Rect ConvertRectToPixel(const Layer* layer,
6666
namespace {
6767

6868
void CheckSnapped(float snapped_position) {
69-
const float kEplison = 0.0003f;
69+
// The acceptable error epsilon should be small enough to detect visible
70+
// artifacts as well as large enough to not cause false crashes when an
71+
// uncommon device scale factor is applied.
72+
const float kEplison = 0.003f;
7073
float diff = std::abs(snapped_position - gfx::ToRoundedInt(snapped_position));
7174
DCHECK_LT(diff, kEplison);
7275
}

0 commit comments

Comments
 (0)