Commit 57deb7a4 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Avoid DCHECK failure in ChunkToLayerMapper::MapVisualRect()

Because of floating point errors, the fast path and slow path can't
always create the same result. Previously we tolerated non-empty cases,
now also tolerate empty cases.

Bug: 947803
Change-Id: I3b444ea1bb58ede0daa4546be6d161a65d6b4907
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548546Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647064}
parent 8d93483a
......@@ -83,15 +83,12 @@ IntRect ChunkToLayerMapper::MapVisualRect(const FloatRect& rect) const {
if (!mapped_rect.IsEmpty() && !clip_rect_.IsInfinite())
mapped_rect.Intersect(clip_rect_.Rect());
if (mapped_rect.IsEmpty()) {
DCHECK(MapUsingGeometryMapper(rect).IsEmpty());
return IntRect();
IntRect result;
if (!mapped_rect.IsEmpty()) {
mapped_rect.Inflate(outset_for_raster_effects_);
AdjustVisualRectBySubpixelOffset(mapped_rect);
result = EnclosingIntRect(mapped_rect);
}
mapped_rect.Inflate(outset_for_raster_effects_);
AdjustVisualRectBySubpixelOffset(mapped_rect);
auto result = EnclosingIntRect(mapped_rect);
#if DCHECK_IS_ON()
auto slow_result = MapUsingGeometryMapper(rect);
if (result != slow_result) {
......
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