Skip to content

Commit

Permalink
Increase error tolerance in PreserveNearIntegralBounds() again
Browse files Browse the repository at this point in the history
If a layer has an offset from integral location < 1e-3, the
antialiased pixels on the edge of the layer is invisible, so we
can safely remove such offsets. Same for size.

Bug: 1462054
Change-Id: I4608ec95cc8efe91ec5dc197203f72d4cd75937f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4892513
Auto-Submit: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201240}
  • Loading branch information
wangxianzhu authored and Chromium LUCI CQ committed Sep 26, 2023
1 parent 8689d15 commit fcf6ea5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace {

// Snap |bounds| if within floating-point numeric limits of an integral rect.
void PreserveNearIntegralBounds(gfx::RectF& bounds) {
constexpr float kTolerance = 1e-4f;
constexpr float kTolerance = 1e-3f;
if (std::abs(std::round(bounds.x()) - bounds.x()) <= kTolerance &&
std::abs(std::round(bounds.y()) - bounds.y()) <= kTolerance &&
std::abs(std::round(bounds.right()) - bounds.right()) <= kTolerance &&
Expand Down

0 comments on commit fcf6ea5

Please sign in to comment.