summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@google.com>2015-01-12 18:40:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-12 18:40:56 +0000
commit4212bf1fad7ab15b10926b30038aae380697aaa3 (patch)
tree4c355db7bf3458578e7cd669432c88bef436e442
parent39b167a644f3859a59e814662295c9247b77f0b9 (diff)
parentb71f9f96f7f464267c59a80add495388338ced04 (diff)
downloadframeworks_base-4212bf1fad7ab15b10926b30038aae380697aaa3.zip
frameworks_base-4212bf1fad7ab15b10926b30038aae380697aaa3.tar.gz
frameworks_base-4212bf1fad7ab15b10926b30038aae380697aaa3.tar.bz2
am b71f9f96: Merge "Improve the circularMask for round displays" into lmp-mr1-dev
* commit 'b71f9f96f7f464267c59a80add495388338ced04': Improve the circularMask for round displays
-rw-r--r--services/core/java/com/android/server/wm/CircularDisplayMask.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/wm/CircularDisplayMask.java b/services/core/java/com/android/server/wm/CircularDisplayMask.java
index a7d41fa..9fdfc47 100644
--- a/services/core/java/com/android/server/wm/CircularDisplayMask.java
+++ b/services/core/java/com/android/server/wm/CircularDisplayMask.java
@@ -24,6 +24,7 @@ import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.view.Display;
import android.view.Surface;
@@ -35,7 +36,6 @@ import android.util.Slog;
class CircularDisplayMask {
private static final String TAG = "CircularDisplayMask";
- private static final int STROKE_WIDTH = 2;
// size of the chin
private int mScreenOffset = 0;
// Display dimensions
@@ -82,9 +82,7 @@ class CircularDisplayMask {
mDrawNeeded = true;
mPaint = new Paint();
mPaint.setAntiAlias(true);
- mPaint.setStyle(Paint.Style.STROKE);
- mPaint.setColor(Color.BLACK);
- mPaint.setStrokeWidth(STROKE_WIDTH);
+ mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
mScreenOffset = screenOffset;
}
@@ -104,7 +102,6 @@ class CircularDisplayMask {
if (c == null) {
return;
}
- c.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);
switch (mRotation) {
case Surface.ROTATION_0:
case Surface.ROTATION_90:
@@ -122,7 +119,10 @@ class CircularDisplayMask {
}
int circleRadius = mScreenSize.x / 2;
- c.drawCircle(circleRadius, circleRadius, circleRadius, mPaint);
+ c.drawColor(Color.BLACK);
+
+ // The radius is reduced by 1 to provide an anti aliasing effect on the display edges.
+ c.drawCircle(circleRadius, circleRadius, circleRadius - 1, mPaint);
mSurface.unlockCanvasAndPost(c);
}