Bug 1462682 - Skia path bounds rounding fix. r=rhunt, a=jcristau FENNEC_60_0_2_BUILD1 FENNEC_60_0_2_RELEASE FIREFOX_60_0_2_BUILD1 FIREFOX_60_0_2_RELEASE
authorLee Salzman <lsalzman@mozilla.com>
Fri, 25 May 2018 00:57:45 -0400
changeset 463641 a0b222c551f5
parent 463640 760e1b2d9adc
child 463642 46ca4895d7a6
push id1724
push userjcristau@mozilla.com
push dateTue, 05 Jun 2018 17:15:42 +0000
treeherdermozilla-release@a0b222c551f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, jcristau
Bug 1462682 - Skia path bounds rounding fix. r=rhunt, a=jcristau MozReview-Commit-ID: Lm0XhyLLCCV
--- a/gfx/skia/skia/src/core/SkScan_Path.cpp
+++ b/gfx/skia/skia/src/core/SkScan_Path.cpp
@@ -559,17 +559,22 @@ static bool clip_to_limit(const SkRegion
     reduced->op(orig, limitR, SkRegion::kIntersect_Op);
     return true;
 // Bias used for conservative rounding of float rects to int rects, to nudge the irects a little
 // larger, so we don't "think" a path's bounds are inside a clip, when (due to numeric drift in
 // the scan-converter) we might walk beyond the predicted limits.
-static const double kConservativeRoundBias = 0.5 + 0.5 / SK_FDot6One;
+// This value has been determined trial and error: pick the smallest value (after the 0.5) that
+// fixes any problematic cases (e.g. crbug.com/844457)
+// NOTE: cubics appear to be the main reason for needing this slop. If we could (perhaps) have a
+// more accurate walker for cubics, we may be able to reduce this fudge factor.
+static const double kConservativeRoundBias = 0.5 + 1.5 / SK_FDot6One;
  *  Round the value down. This is used to round the top and left of a rectangle,
  *  and corresponds to the way the scan converter treats the top and left edges.
  *  It has a slight bias to make the "rounded" int smaller than a normal round, to create a more
  *  conservative int-bounds (larger) from a float rect.
 static inline int round_down_to_int(SkScalar x) {