OSDN Git Service

Revert "Use default constructor to get anti-aliasing"
authorChris Craik <ccraik@google.com>
Tue, 12 May 2015 16:36:28 +0000 (16:36 +0000)
committerThe Android Automerger <android-build@google.com>
Tue, 12 May 2015 19:35:52 +0000 (12:35 -0700)
bug:20948129

This reverts commit 58fc522a69e8ddf9ac8530ce88e9c2c92da1dd14.

Change-Id: Iddeccb4ad15b843bb3e610bd3673a0c7abc1bf46

core/java/android/widget/Editor.java
core/java/android/widget/Switch.java
core/java/android/widget/TextView.java
core/java/com/android/internal/util/ImageUtils.java
graphics/java/android/graphics/drawable/GradientDrawable.java
graphics/java/android/graphics/drawable/ShapeDrawable.java
packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
services/core/java/com/android/server/wm/Watermark.java

index 4fd85b6..5fc9e35 100644 (file)
@@ -4472,7 +4472,7 @@ public class Editor {
 
     private class CorrectionHighlighter {
         private final Path mPath = new Path();
-        private final Paint mPaint = new Paint();
+        private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         private int mStart, mEnd;
         private long mFadingStartTime;
         private RectF mTempRectF;
index ff587c2..356df31 100644 (file)
@@ -214,7 +214,7 @@ public class Switch extends CompoundButton {
     public Switch(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
         super(context, attrs, defStyleAttr, defStyleRes);
 
-        mTextPaint = new TextPaint();
+        mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
 
         final Resources res = getResources();
         mTextPaint.density = res.getDisplayMetrics().density;
index 68c49cd..574f24b 100644 (file)
@@ -669,11 +669,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
         final Resources res = getResources();
         final CompatibilityInfo compat = res.getCompatibilityInfo();
 
-        mTextPaint = new TextPaint();
+        mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
         mTextPaint.density = res.getDisplayMetrics().density;
         mTextPaint.setCompatibilityScaling(compat.applicationScale);
 
-        mHighlightPaint = new Paint();
+        mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         mHighlightPaint.setCompatibilityScaling(compat.applicationScale);
 
         mMovement = getDefaultMovementMethod();
index a0d0b20..7d56e9e 100644 (file)
@@ -66,7 +66,7 @@ public class ImageUtils {
                         COMPACT_BITMAP_SIZE, COMPACT_BITMAP_SIZE, Bitmap.Config.ARGB_8888
                 );
                 mTempCompactBitmapCanvas = new Canvas(mTempCompactBitmap);
-                mTempCompactBitmapPaint = new Paint();
+                mTempCompactBitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
                 mTempCompactBitmapPaint.setFilterBitmap(true);
             }
             mTempMatrix.reset();
index dc9aa67..4c2817c 100644 (file)
@@ -133,7 +133,7 @@ public class GradientDrawable extends Drawable {
 
     private GradientState mGradientState;
 
-    private final Paint mFillPaint = new Paint();
+    private final Paint mFillPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
     private Rect mPadding;
     private Paint mStrokePaint;   // optional, set by the caller
     private ColorFilter mColorFilter;   // optional, set by the caller
@@ -323,7 +323,7 @@ public class GradientDrawable extends Drawable {
 
     private void setStrokeInternal(int width, int color, float dashWidth, float dashGap) {
         if (mStrokePaint == null)  {
-            mStrokePaint = new Paint();
+            mStrokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
             mStrokePaint.setStyle(Paint.Style.STROKE);
         }
         mStrokePaint.setStrokeWidth(width);
@@ -1802,7 +1802,7 @@ public class GradientDrawable extends Drawable {
         mPadding = state.mPadding;
 
         if (state.mStrokeWidth >= 0) {
-            mStrokePaint = new Paint();
+            mStrokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
             mStrokePaint.setStyle(Paint.Style.STROKE);
             mStrokePaint.setStrokeWidth(state.mStrokeWidth);
 
index caa0787..334b3bd 100644 (file)
@@ -501,7 +501,7 @@ public class ShapeDrawable extends Drawable {
             if (mShapeState.mPaint != null) {
                 mShapeState.mPaint = new Paint(mShapeState.mPaint);
             } else {
-                mShapeState.mPaint = new Paint();
+                mShapeState.mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
             }
             if (mShapeState.mPadding != null) {
                 mShapeState.mPadding = new Rect(mShapeState.mPadding);
@@ -555,7 +555,7 @@ public class ShapeDrawable extends Drawable {
                 mAlpha = orig.mAlpha;
                 mShaderFactory = orig.mShaderFactory;
             } else {
-                mPaint = new Paint();
+                mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
             }
         }
 
index 3fbc76b..0d331d1 100755 (executable)
@@ -225,23 +225,23 @@ public class BatteryMeterView extends View implements DemoMode,
         mSubpixelSmoothingRight = context.getResources().getFraction(
                 R.fraction.battery_subpixel_smoothing_right, 1, 1);
 
-        mFramePaint = new Paint();
+        mFramePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         mFramePaint.setColor(frameColor);
         mFramePaint.setDither(true);
         mFramePaint.setStrokeWidth(0);
         mFramePaint.setStyle(Paint.Style.FILL_AND_STROKE);
 
-        mBatteryPaint = new Paint();
+        mBatteryPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         mBatteryPaint.setDither(true);
         mBatteryPaint.setStrokeWidth(0);
         mBatteryPaint.setStyle(Paint.Style.FILL_AND_STROKE);
 
-        mTextPaint = new Paint();
+        mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         Typeface font = Typeface.create("sans-serif-condensed", Typeface.BOLD);
         mTextPaint.setTypeface(font);
         mTextPaint.setTextAlign(Paint.Align.CENTER);
 
-        mWarningTextPaint = new Paint();
+        mWarningTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         mWarningTextPaint.setColor(mColors[1]);
         font = Typeface.create("sans-serif", Typeface.BOLD);
         mWarningTextPaint.setTypeface(font);
@@ -249,7 +249,7 @@ public class BatteryMeterView extends View implements DemoMode,
 
         mChargeColor = context.getColor(R.color.batterymeter_charge_color);
 
-        mBoltPaint = new Paint();
+        mBoltPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         mBoltPaint.setColor(context.getColor(R.color.batterymeter_bolt_color));
         mBoltPoints = loadBoltPoints(res);
 
index ba3ce36..e226e3d 100644 (file)
@@ -84,7 +84,7 @@ class Watermark {
         int fontSize = WindowManagerService.getPropertyInt(tokens, 1,
                 TypedValue.COMPLEX_UNIT_DIP, 20, dm);
 
-        mTextPaint = new Paint();
+        mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
         mTextPaint.setTextSize(fontSize);
         mTextPaint.setTypeface(Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD));