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 512984 f05abb753b64609a9e169a08c66fc237615b3b50
parent 512983 81b95ee7a2f3a2e09ac4428bafe6957f5942781a
child 512985 2305c930b771669f33078d7c85d404e63b6f3e81
push id10669
push userryanvm@gmail.com
push dateMon, 11 Feb 2019 12:53:17 +0000
treeherdermozilla-beta@2305c930b771 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, RyanVM
bugs1525817
milestone66.0
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);