Commit 32d15eec authored by Florin Malita's avatar Florin Malita Committed by Commit Bot

Fix assert in GraphicsContext::IsSimpleDRRect

[1] added a couple of asserts, assuming the outer/inner radii are
always following border invariants.

But the same code path is also triggered for outline painting, which
overrides some border properties to force rectangular outlines.

Also, GraphicsContext is not a good place to make outer/inner geometry
assumptions.

Remove the asserts and replace with explicit width/height checks.

[1] https://chromium.googlesource.com/chromium/src/+/e2eef42958b177eaf8cbbdae667c481d0789421c

Bug: 861529

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7deb45c42f2fef8dec2caf4cc90c0b52ee1b5f51
Reviewed-on: https://chromium-review.googlesource.com/1129328Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573486}
parent d466bf97
...@@ -1114,14 +1114,9 @@ bool IsSimpleDRRect(const FloatRoundedRect& outer, ...@@ -1114,14 +1114,9 @@ bool IsSimpleDRRect(const FloatRoundedRect& outer,
const auto& is_simple_corner = [&stroke_size](const FloatSize& outer, const auto& is_simple_corner = [&stroke_size](const FloatSize& outer,
const FloatSize& inner) { const FloatSize& inner) {
DCHECK(outer.Width() >= inner.Width());
DCHECK(outer.Height() >= inner.Height());
// trivial/zero-radius corner // trivial/zero-radius corner
if (outer.IsZero()) { if (outer.IsZero() && inner.IsZero())
DCHECK(inner.IsZero());
return true; return true;
}
// and // and
// 2) all corners are isotropic // 2) all corners are isotropic
......
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