Bug 858978 - Use DST_IN to draw ShapedButton (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 25 Apr 2013 12:20:21 +0100
changeset 140800 72ee55092cb83c43ac40361e32b51d8534c3bb1c
parent 140799 039a1de069ed16479c73c22c037209d3bb303573
child 140801 3dbdab219220d32e242a2e1f1fc123e5e8fc40df
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs858978
milestone23.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 858978 - Use DST_IN to draw ShapedButton (r=mfinkle)
mobile/android/base/ShapedButton.java
--- a/mobile/android/base/ShapedButton.java
+++ b/mobile/android/base/ShapedButton.java
@@ -38,17 +38,17 @@ public class ShapedButton extends GeckoI
             mSide = CurveTowards.NONE;
         else if (curveTowards == 0x01)
             mSide = CurveTowards.LEFT;
         else
             mSide = CurveTowards.RIGHT;
 
         // Path is clipped.
         mPath = new Path();
-        mCanvasDelegate = new CanvasDelegate(this, Mode.DST_OUT);
+        mCanvasDelegate = new CanvasDelegate(this, Mode.DST_IN);
 
         setWillNotDraw(false);
     }
 
     @Override
     public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
 
@@ -61,25 +61,26 @@ public class ShapedButton extends GeckoI
 
         mPath.reset();
 
         if (mSide == CurveTowards.RIGHT) {
             mPath.moveTo(0, 0);
             mPath.cubicTo(curve * 0.75f, 0,
                           curve * 0.25f, height,
                           curve, height);
-            mPath.lineTo(0, height);
+            mPath.lineTo(width, height);
+            mPath.lineTo(width, 0);
             mPath.lineTo(0, 0);
         } else if (mSide == CurveTowards.LEFT) {
             mPath.moveTo(width, 0);
             mPath.cubicTo((width - (curve * 0.75f)), 0,
                           (width - (curve * 0.25f)), height,
                           (width - curve), height);
-            mPath.lineTo(width, height);
-            mPath.lineTo(width, 0);
+            mPath.lineTo(0, height);
+            mPath.lineTo(0, 0);
         }
     }
 
     @Override
     public void draw(Canvas canvas) {
         if (mCanvasDelegate != null && mSide != CurveTowards.NONE)
             mCanvasDelegate.draw(canvas, mPath, getWidth(), getHeight());
         else