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 450889 2ed846865c929797300674d0b8f0ca20736722c7
parent 450888 1f0a03852bb67a6a48c60b99beced88f699431c1
child 450890 b17f7fff04e1a3882bc11bbe296eccc3d6d18200
push id325
push userjcristau@mozilla.com
push dateMon, 11 Feb 2019 18:26:45 +0000
treeherdermozilla-esr60@96858707ca39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, RyanVM
bugs1525817
milestone60.5.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
@@ -531,17 +531,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);
 
     /** Adds beginning of contour at SkPoint (x, y).
 
         @param x  x-coordinate of contour start
         @param y  y-coordinate of contour start
     */
     void moveTo(SkScalar x, SkScalar y);
 
--- a/gfx/skia/skia/src/core/SkPath.cpp
+++ b/gfx/skia/skia/src/core/SkPath.cpp
@@ -738,19 +738,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();)
 }
 
 void SkPath::moveTo(SkScalar x, SkScalar y) {
     SkDEBUGCODE(this->validate();)
 
     SkPathRef::Editor ed(&fPathRef);