Bug 1525817 - Be consistent about int for incReserve. r=rhunt, a=RyanVM
authorLee Salzman <lsalzman@mozilla.com>
Thu, 07 Feb 2019 16:50:31 -0500
changeset 509638 f981e28b584e
parent 509637 d39043c99ca9
child 509639 8016ccca3704
push id1935
push userryanvm@gmail.com
push dateMon, 11 Feb 2019 16:39:10 +0000
treeherdermozilla-release@be2b97abeeff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, RyanVM
bugs1525817
milestone65.0.1
Bug 1525817 - Be consistent about int for incReserve. r=rhunt, a=RyanVM
gfx/skia/skia/include/core/SkPath.h
gfx/skia/skia/src/core/SkPath.cpp
--- a/gfx/skia/skia/include/core/SkPath.h
+++ b/gfx/skia/skia/include/core/SkPath.h
@@ -544,17 +544,17 @@ public:
     bool conservativelyContainsRect(const SkRect& rect) const;
 
     /** Grows SkPath verb array and SkPoint array to contain extraPtCount additional SkPoint.
         May improve performance and use less memory by
         reducing the number and size of allocations when creating SkPath.
 
         @param extraPtCount  number of additional SkPoint to allocate
     */
-    void incReserve(unsigned extraPtCount);
+    void incReserve(int extraPtCount);
 
     /** Shrinks SkPath verb array and SkPoint array storage to discard unused capacity.
         May reduce the heap overhead for SkPath known to be fully constructed.
     */
     void shrinkToFit();
 
     /** Adds beginning of contour at SkPoint (x, y).
 
--- a/gfx/skia/skia/src/core/SkPath.cpp
+++ b/gfx/skia/skia/src/core/SkPath.cpp
@@ -755,19 +755,21 @@ void SkPath::setConvexity(Convexity c) {
 //  Construction methods
 
 #define DIRTY_AFTER_EDIT                                        \
     do {                                                        \
         fConvexity = kUnknown_Convexity;                        \
         fFirstDirection = SkPathPriv::kUnknown_FirstDirection;  \
     } while (0)
 
-void SkPath::incReserve(U16CPU inc) {
+void SkPath::incReserve(int inc) {
     SkDEBUGCODE(this->validate();)
-    SkPathRef::Editor(&fPathRef, inc, inc);
+    if (inc > 0) {
+        SkPathRef::Editor(&fPathRef, inc, inc);
+    }
     SkDEBUGCODE(this->validate();)
 }
 
 SkPath& SkPath::moveTo(SkScalar x, SkScalar y) {
     SkDEBUGCODE(this->validate();)
 
     SkPathRef::Editor ed(&fPathRef);