Bug 1117026 - Cherry-pick commit a10742c of upstream skia code; r=upstream
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 02 Jan 2015 00:10:19 -0500
changeset 247662 d05292b218197993bb235001d3fb60fda3e7afb6
parent 247661 305b1834db8549169de1e3880bf1de859e48cbf9
child 247663 78930b6efe65b3c69cf530ef4b2df44e2af8c4af
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersupstream
bugs1117026
milestone37.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 1117026 - Cherry-pick commit a10742c of upstream skia code; r=upstream
gfx/skia/trunk/include/core/SkRect.h
gfx/skia/trunk/include/views/SkOSMenu.h
gfx/skia/trunk/src/core/SkMatrix.cpp
gfx/skia/trunk/src/core/SkRect.cpp
gfx/skia/trunk/src/core/SkScan_Path.cpp
gfx/skia/trunk/src/ports/SkFontHost_FreeType.cpp
gfx/skia/trunk/src/views/SkTextBox.cpp
gfx/skia/trunk/src/views/SkViewPriv.cpp
--- a/gfx/skia/trunk/include/core/SkRect.h
+++ b/gfx/skia/trunk/include/core/SkRect.h
@@ -272,17 +272,16 @@ struct SK_API SkIRect {
         return this->intersect(r.fLeft, r.fTop, r.fRight, r.fBottom);
     }
 
     /** If rectangles a and b intersect, return true and set this rectangle to
         that intersection, otherwise return false and do not change this
         rectangle. If either rectangle is empty, do nothing and return false.
     */
     bool intersect(const SkIRect& a, const SkIRect& b) {
-        SkASSERT(&a && &b);
 
         if (!a.isEmpty() && !b.isEmpty() &&
                 a.fLeft < b.fRight && b.fLeft < a.fRight &&
                 a.fTop < b.fBottom && b.fTop < a.fBottom) {
             fLeft   = SkMax32(a.fLeft,   b.fLeft);
             fTop    = SkMax32(a.fTop,    b.fTop);
             fRight  = SkMin32(a.fRight,  b.fRight);
             fBottom = SkMin32(a.fBottom, b.fBottom);
@@ -293,17 +292,16 @@ struct SK_API SkIRect {
 
     /** If rectangles a and b intersect, return true and set this rectangle to
         that intersection, otherwise return false and do not change this
         rectangle. For speed, no check to see if a or b are empty is performed.
         If either is, then the return result is undefined. In the debug build,
         we assert that both rectangles are non-empty.
     */
     bool intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b) {
-        SkASSERT(&a && &b);
         SkASSERT(!a.isEmpty() && !b.isEmpty());
 
         if (a.fLeft < b.fRight && b.fLeft < a.fRight &&
                 a.fTop < b.fBottom && b.fTop < a.fBottom) {
             fLeft   = SkMax32(a.fLeft,   b.fLeft);
             fTop    = SkMax32(a.fTop,    b.fTop);
             fRight  = SkMin32(a.fRight,  b.fRight);
             fBottom = SkMin32(a.fBottom, b.fBottom);
--- a/gfx/skia/trunk/include/views/SkOSMenu.h
+++ b/gfx/skia/trunk/include/views/SkOSMenu.h
@@ -124,17 +124,17 @@ public:
     /**
      * Create predefined items with the given parameters. To be used with the
      * other helper functions below to retrive/update state information.
      * Note: the helper functions below assume that slotName is UNIQUE for all
      * menu items of the same type since it's used to identify the event
      */
     int appendAction(const char label[], SkEventSinkID target);
     int appendList(const char label[], const char slotName[],
-                   SkEventSinkID target, int defaultIndex, const char[] ...);
+                   SkEventSinkID target, int defaultIndex, const char* ...);
     int appendSlider(const char label[], const char slotName[],
                      SkEventSinkID target, SkScalar min, SkScalar max,
                      SkScalar defaultValue);
     int appendSwitch(const char label[], const char slotName[],
                      SkEventSinkID target, bool defaultState = false);
     int appendTriState(const char label[], const char slotName[],
                        SkEventSinkID target, TriState defaultState = kOffState);
     int appendTextField(const char label[], const char slotName[],
--- a/gfx/skia/trunk/src/core/SkMatrix.cpp
+++ b/gfx/skia/trunk/src/core/SkMatrix.cpp
@@ -1062,17 +1062,17 @@ void SkMatrix::mapVectors(SkPoint dst[],
 
         tmp.fMat[kMTransX] = tmp.fMat[kMTransY] = 0;
         tmp.clearTypeMask(kTranslate_Mask);
         tmp.mapPoints(dst, src, count);
     }
 }
 
 bool SkMatrix::mapRect(SkRect* dst, const SkRect& src) const {
-    SkASSERT(dst && &src);
+    SkASSERT(dst);
 
     if (this->rectStaysRect()) {
         this->mapPoints((SkPoint*)dst, (const SkPoint*)&src, 2);
         dst->sort();
         return true;
     } else {
         SkPoint quad[4];
 
--- a/gfx/skia/trunk/src/core/SkRect.cpp
+++ b/gfx/skia/trunk/src/core/SkRect.cpp
@@ -109,38 +109,35 @@ bool SkRect::intersect(SkScalar left, Sk
         if (fRight > right) fRight = right;
         if (fBottom > bottom) fBottom = bottom;
         return true;
     }
     return false;
 }
 
 bool SkRect::intersect(const SkRect& r) {
-    SkASSERT(&r);
     return this->intersect(r.fLeft, r.fTop, r.fRight, r.fBottom);
 }
 
 bool SkRect::intersect2(const SkRect& r) {
-    SkASSERT(&r);
     SkScalar L = SkMaxScalar(fLeft, r.fLeft);
     SkScalar R = SkMinScalar(fRight, r.fRight);
     if (L >= R) {
         return false;
     }
     SkScalar T = SkMaxScalar(fTop, r.fTop);
     SkScalar B = SkMinScalar(fBottom, r.fBottom);
     if (T >= B) {
         return false;
     }
     this->set(L, T, R, B);
     return true;
 }
 
 bool SkRect::intersect(const SkRect& a, const SkRect& b) {
-    SkASSERT(&a && &b);
 
     if (!a.isEmpty() && !b.isEmpty() &&
         a.fLeft < b.fRight && b.fLeft < a.fRight &&
         a.fTop < b.fBottom && b.fTop < a.fBottom) {
         fLeft   = SkMaxScalar(a.fLeft,   b.fLeft);
         fTop    = SkMaxScalar(a.fTop,    b.fTop);
         fRight  = SkMinScalar(a.fRight,  b.fRight);
         fBottom = SkMinScalar(a.fBottom, b.fBottom);
--- a/gfx/skia/trunk/src/core/SkScan_Path.cpp
+++ b/gfx/skia/trunk/src/core/SkScan_Path.cpp
@@ -427,17 +427,17 @@ static SkEdge* sort_edges(SkEdge* list[]
 // clipRect may be null, even though we always have a clip. This indicates that
 // the path is contained in the clip, and so we can ignore it during the blit
 //
 // clipRect (if no null) has already been shifted up
 //
 void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitter,
                   int start_y, int stop_y, int shiftEdgesUp,
                   const SkRegion& clipRgn) {
-    SkASSERT(&path && blitter);
+    SkASSERT(blitter);
 
     SkEdgeBuilder   builder;
 
     int count = builder.build(path, clipRect, shiftEdgesUp);
     SkEdge**    list = builder.edgeList();
 
     if (count < 2) {
         if (path.isInverseFillType()) {
--- a/gfx/skia/trunk/src/ports/SkFontHost_FreeType.cpp
+++ b/gfx/skia/trunk/src/ports/SkFontHost_FreeType.cpp
@@ -1332,17 +1332,17 @@ void SkScalerContext_FreeType::generateI
     generateGlyphImage(fFace, glyph);
 }
 
 
 void SkScalerContext_FreeType::generatePath(const SkGlyph& glyph,
                                             SkPath* path) {
     SkAutoMutexAcquire  ac(gFTMutex);
 
-    SkASSERT(&glyph && path);
+    SkASSERT(path);
 
     if (this->setupSize()) {
         path->reset();
         return;
     }
 
     uint32_t flags = fLoadGlyphFlags;
     flags |= FT_LOAD_NO_BITMAP; // ignore embedded bitmaps so we're sure to get the outline
--- a/gfx/skia/trunk/src/views/SkTextBox.cpp
+++ b/gfx/skia/trunk/src/views/SkTextBox.cpp
@@ -162,17 +162,17 @@ void SkTextBox::setSpacing(SkScalar mul,
     fSpacingMul = mul;
     fSpacingAdd = add;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////
 
 void SkTextBox::draw(SkCanvas* canvas, const char text[], size_t len, const SkPaint& paint)
 {
-    SkASSERT(canvas && &paint && (text || len == 0));
+    SkASSERT(canvas && (text || len == 0));
 
     SkScalar marginWidth = fBox.width();
 
     if (marginWidth <= 0 || len == 0)
         return;
 
     const char* textStop = text + len;
 
--- a/gfx/skia/trunk/src/views/SkViewPriv.cpp
+++ b/gfx/skia/trunk/src/views/SkViewPriv.cpp
@@ -12,17 +12,17 @@
 void SkView::Artist::draw(SkView* view, SkCanvas* canvas)
 {
     SkASSERT(view && canvas);
     this->onDraw(view, canvas);
 }
 
 void SkView::Artist::inflate(const SkDOM& dom, const SkDOM::Node* node)
 {
-    SkASSERT(&dom && node);
+    SkASSERT(node);
     this->onInflate(dom, node);
 }
 
 void SkView::Artist::onInflate(const SkDOM&, const SkDOM::Node*)
 {
     // subclass should override this as needed
 }
 
@@ -58,17 +58,17 @@ void SkView::Layout::layoutChildren(SkVi
 {
     SkASSERT(parent);
     if (parent->width() > 0 && parent->height() > 0)
         this->onLayoutChildren(parent);
 }
 
 void SkView::Layout::inflate(const SkDOM& dom, const SkDOM::Node* node)
 {
-    SkASSERT(&dom && node);
+    SkASSERT(node);
     this->onInflate(dom, node);
 }
 
 void SkView::Layout::onInflate(const SkDOM&, const SkDOM::Node*)
 {
     // subclass should override this as needed
 }