Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85afd1b6 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Implement new window cropping.

The window manager now performs the crop internally, evaluating
it every animation from, to be able to update it along with
the surface position.

Change-Id: I960a2161b9defb6fba4840fa35aee4e411c39b32
parent dca5fb9e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ public abstract class WallpaperService extends Service {
        int mCurWindowPrivateFlags = mWindowPrivateFlags;
        final Rect mVisibleInsets = new Rect();
        final Rect mWinFrame = new Rect();
        final Rect mSystemInsets = new Rect();
        final Rect mContentInsets = new Rect();
        final Configuration mConfiguration = new Configuration();
        
@@ -254,7 +253,7 @@ public abstract class WallpaperService extends Service {

        final BaseIWindow mWindow = new BaseIWindow() {
            @Override
            public void resized(int w, int h, Rect systemInsets, Rect contentInsets,
            public void resized(int w, int h, Rect contentInsets,
                    Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
                Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0);
@@ -621,7 +620,7 @@ public abstract class WallpaperService extends Service {

                    final int relayoutResult = mSession.relayout(
                        mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
                            View.VISIBLE, 0, mWinFrame, mSystemInsets, mContentInsets,
                            View.VISIBLE, 0, mWinFrame, mContentInsets,
                            mVisibleInsets, mConfiguration, mSurfaceHolder.mSurface);

                    if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ oneway interface IWindow {
     */
    void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor);

    void resized(int w, int h, in Rect systemInsets, in Rect contentInsets,
    void resized(int w, int h, in Rect contentInsets,
            in Rect visibleInsets, boolean reportDraw, in Configuration newConfig);
    void dispatchAppVisibility(boolean visible);
    void dispatchGetNewSurface();
+1 −5
Original line number Diff line number Diff line
@@ -58,10 +58,6 @@ interface IWindowSession {
     * {@link WindowManagerImpl#RELAYOUT_DEFER_SURFACE_DESTROY}.
     * @param outFrame Rect in which is placed the new position/size on
     * screen.
     * @param outSystemInsets Rect in which is placed the offsets from
     * <var>outFrame</var> over which any core system UI elements are
     * currently covering the window.  This is not generally used for
     * layout, but just to know where the window is obscured.
     * @param outContentInsets Rect in which is placed the offsets from
     * <var>outFrame</var> in which the content of the window should be
     * placed.  This can be used to modify the window layout to ensure its
@@ -83,7 +79,7 @@ interface IWindowSession {
     */
    int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs,
            int requestedWidth, int requestedHeight, int viewVisibility,
            int flags, out Rect outFrame, out Rect outSystemInsets,
            int flags, out Rect outFrame,
            out Rect outContentInsets, out Rect outVisibleInsets,
            out Configuration outConfig, out Surface outSurface);

+2 −3
Original line number Diff line number Diff line
@@ -98,7 +98,6 @@ public class SurfaceView extends View {
    MyWindow mWindow;
    final Rect mVisibleInsets = new Rect();
    final Rect mWinFrame = new Rect();
    final Rect mSystemInsets = new Rect();
    final Rect mContentInsets = new Rect();
    final Configuration mConfiguration = new Configuration();
    
@@ -472,7 +471,7 @@ public class SurfaceView extends View {
                        mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
                            visible ? VISIBLE : GONE,
                            WindowManagerImpl.RELAYOUT_DEFER_SURFACE_DESTROY,
                            mWinFrame, mSystemInsets, mContentInsets,
                            mWinFrame, mContentInsets,
                            mVisibleInsets, mConfiguration, mNewSurface);
                    if ((relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0) {
                        mReportDrawNeeded = true;
@@ -606,7 +605,7 @@ public class SurfaceView extends View {
            mSurfaceView = new WeakReference<SurfaceView>(surfaceView);
        }

        public void resized(int w, int h, Rect systemInsets, Rect contentInsets,
        public void resized(int w, int h, Rect contentInsets,
                Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
            SurfaceView surfaceView = mSurfaceView.get();
            if (surfaceView != null) {
+0 −6
Original line number Diff line number Diff line
@@ -17160,12 +17160,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
         */
        boolean mUse32BitDrawingCache;
        /**
         * Describes the parts of the window that are currently completely
         * obscured by system UI elements.
         */
        final Rect mSystemInsets = new Rect();
        /**
         * For windows that are full-screen but using insets to layout inside
         * of the screen decorations, these are the current insets for the
Loading