Bug 1364691 - don't use walk_convex_edges in Skia path rendering unless edge count is at least 2. r=mchang
authorLee Salzman <lsalzman@mozilla.com>
Fri, 26 May 2017 12:59:29 -0400
changeset 409065 4787ff70ae13e6ae43b89a09dd620df5a5ad3824
parent 409064 bfa432683e279c14b37912a5c45638005f2b0b07
child 409066 2ad37344866157634cd602a4636a674b9fe49dcb
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchang
bugs1364691
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1364691 - don't use walk_convex_edges in Skia path rendering unless edge count is at least 2. r=mchang MozReview-Commit-ID: 8lN0tpqZIEh
gfx/skia/skia/src/core/SkScan_AAAPath.cpp
gfx/skia/skia/src/core/SkScan_Path.cpp
--- a/gfx/skia/skia/src/core/SkScan_AAAPath.cpp
+++ b/gfx/skia/skia/src/core/SkScan_AAAPath.cpp
@@ -1677,17 +1677,17 @@ static SK_ALWAYS_INLINE void aaa_fill_pa
         // If we're using mask, then we have to limit the bound within the path bounds.
         // Otherwise, the edge drift may access an invalid address inside the mask.
         SkIRect ir;
         path.getBounds().roundOut(&ir);
         leftBound = SkTMax(leftBound, SkIntToFixed(ir.fLeft));
         rightBound = SkTMin(rightBound, SkIntToFixed(ir.fRight));
     }
 
-    if (!path.isInverseFillType() && path.isConvex()) {
+    if (!path.isInverseFillType() && path.isConvex() && count >= 2) {
         SkASSERT(count >= 2);   // convex walker does not handle missing right edges
         aaa_walk_convex_edges(&headEdge, blitter, start_y, stop_y,
                               leftBound, rightBound, isUsingMask);
     } else {
         // Only use deferred blitting if there are many edges.
         bool useDeferred = count >
                 (SkFixedFloorToInt(tailEdge.fPrev->fLowerY - headEdge.fNext->fUpperY) + 1) * 4;
 
--- a/gfx/skia/skia/src/core/SkScan_Path.cpp
+++ b/gfx/skia/skia/src/core/SkScan_Path.cpp
@@ -462,17 +462,17 @@ void sk_fill_path(const SkPath& path, co
     PrePostProc     proc = nullptr;
 
     if (path.isInverseFillType()) {
         ib.setBlitter(blitter, clipRect, shiftEdgesUp);
         blitter = &ib;
         proc = PrePostInverseBlitterProc;
     }
 
-    if (path.isConvex() && (nullptr == proc)) {
+    if (path.isConvex() && (nullptr == proc) && count >= 2) {
         SkASSERT(count >= 2);   // convex walker does not handle missing right edges
         walk_convex_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, nullptr);
     } else {
         walk_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, proc,
                 shiftedClip.right());
     }
 }