diff options
author | Prashant Malani <pmalani@google.com> | 2015-02-10 19:09:39 -0800 |
---|---|---|
committer | Prashant Malani <pmalani@google.com> | 2015-03-11 00:34:15 +0000 |
commit | a98c21a662040a8afa75a35bd882c292f7ed8414 (patch) | |
tree | 4b8056752852247d013cb95d1bf3dcb05dd48769 /services/core/java | |
parent | dff0fdb4172a230e4faff7ed93842c21a2d57335 (diff) | |
download | frameworks_base-a98c21a662040a8afa75a35bd882c292f7ed8414.zip frameworks_base-a98c21a662040a8afa75a35bd882c292f7ed8414.tar.gz frameworks_base-a98c21a662040a8afa75a35bd882c292f7ed8414.tar.bz2 |
Make circular mask thickness configurable
Obtain the circular mask thickness as a dimension so that it can
be customized per-device.
Change-Id: Ied88f91424c5cf4f25dd1e78cf22f0fd7ea7b0a4
Signed-off-by: Prashant Malani <pmalani@google.com>
Diffstat (limited to 'services/core/java')
-rw-r--r-- | services/core/java/com/android/server/wm/CircularDisplayMask.java | 8 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/CircularDisplayMask.java b/services/core/java/com/android/server/wm/CircularDisplayMask.java index 9fdfc47..7c2da2d 100644 --- a/services/core/java/com/android/server/wm/CircularDisplayMask.java +++ b/services/core/java/com/android/server/wm/CircularDisplayMask.java @@ -50,9 +50,10 @@ class CircularDisplayMask { private int mRotation; private boolean mVisible; private boolean mDimensionsUnequal = false; + private int mMaskThickness; public CircularDisplayMask(Display display, SurfaceSession session, int zOrder, - int screenOffset) { + int screenOffset, int maskThickness) { mScreenSize = new Point(); display.getSize(mScreenSize); if (mScreenSize.x != mScreenSize.y) { @@ -84,6 +85,7 @@ class CircularDisplayMask { mPaint.setAntiAlias(true); mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); mScreenOffset = screenOffset; + mMaskThickness = maskThickness; } private void drawIfNeeded() { @@ -121,8 +123,8 @@ class CircularDisplayMask { int circleRadius = mScreenSize.x / 2; 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); + // The radius is reduced by mMaskThickness to provide an anti aliasing effect on the display edges. + c.drawCircle(circleRadius, circleRadius, circleRadius - mMaskThickness, mPaint); mSurface.unlockCanvasAndPost(c); } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 5ca9ef7..0cda6fd 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -5944,13 +5944,15 @@ public class WindowManagerService extends IWindowManager.Stub if (mCircularDisplayMask == null) { int screenOffset = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.circular_display_mask_offset); + int maskThickness = mContext.getResources().getDimensionPixelSize( + com.android.internal.R.dimen.circular_display_mask_thickness); mCircularDisplayMask = new CircularDisplayMask( getDefaultDisplayContentLocked().getDisplay(), mFxSession, mPolicy.windowTypeToLayerLw( WindowManager.LayoutParams.TYPE_POINTER) - * TYPE_LAYER_MULTIPLIER + 10, screenOffset); + * TYPE_LAYER_MULTIPLIER + 10, screenOffset, maskThickness); } mCircularDisplayMask.setVisibility(true); } else if (mCircularDisplayMask != null) { |