Merge "WindowManagerService: Handle transparent region on client" into sc-dev
This commit is contained in:
@@ -122,14 +122,6 @@ interface IWindowSession {
|
||||
*/
|
||||
boolean outOfMemory(IWindow window);
|
||||
|
||||
/**
|
||||
* Give the window manager a hint of the part of the window that is
|
||||
* completely transparent, allowing it to work with the surface flinger
|
||||
* to optimize compositing of this part of the window.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
oneway void setTransparentRegion(IWindow window, in Region region);
|
||||
|
||||
/**
|
||||
* Tell the window manager about the content and visible insets of the
|
||||
* given window, which can be used to adjust the <var>outContentInsets</var>
|
||||
|
||||
@@ -3064,11 +3064,14 @@ public final class ViewRootImpl implements ViewParent,
|
||||
if (!mTransparentRegion.equals(mPreviousTransparentRegion)) {
|
||||
mPreviousTransparentRegion.set(mTransparentRegion);
|
||||
mFullRedrawNeeded = true;
|
||||
// reconfigure window manager
|
||||
try {
|
||||
mWindowSession.setTransparentRegion(mWindow, mTransparentRegion);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
// TODO: Ideally we would do this in prepareSurfaces,
|
||||
// but prepareSurfaces is currently working under
|
||||
// the assumption that we paused the render thread
|
||||
// via the WM relayout code path. We probably eventually
|
||||
// want to synchronize transparent region hint changes
|
||||
// with draws.
|
||||
mTransaction.setTransparentRegionHint(getSurfaceControl(),
|
||||
mTransparentRegion).apply();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -313,10 +313,6 @@ public class WindowlessWindowManager implements IWindowSession {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransparentRegion(android.view.IWindow window, android.graphics.Region region) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInsets(android.view.IWindow window, int touchableInsets,
|
||||
android.graphics.Rect contentInsets, android.graphics.Rect visibleInsets,
|
||||
|
||||
@@ -247,11 +247,6 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
|
||||
return mService.outOfMemoryWindow(this, window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransparentRegion(IWindow window, Region region) {
|
||||
mService.setTransparentRegionWindow(this, window, region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInsets(IWindow window, int touchableInsets,
|
||||
Rect contentInsets, Rect visibleInsets, Region touchableArea) {
|
||||
|
||||
@@ -2150,23 +2150,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
Slog.i(tag, s, e);
|
||||
}
|
||||
|
||||
void setTransparentRegionWindow(Session session, IWindow client, Region region) {
|
||||
final long origId = Binder.clearCallingIdentity();
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
WindowState w = windowForClientLocked(session, client, false);
|
||||
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE transparentRegionHint=%s: %s",
|
||||
region, w);
|
||||
|
||||
if ((w != null) && w.mHasSurface) {
|
||||
w.mWinAnimator.setTransparentRegionHintLocked(region);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(origId);
|
||||
}
|
||||
}
|
||||
|
||||
void setInsetsWindow(Session session, IWindow client, int touchableInsets, Rect contentInsets,
|
||||
Rect visibleInsets, Region touchableRegion) {
|
||||
int uid = Binder.getCallingUid();
|
||||
|
||||
@@ -678,14 +678,6 @@ class WindowStateAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
void setTransparentRegionHintLocked(final Region region) {
|
||||
if (mSurfaceController == null) {
|
||||
Slog.w(TAG, "setTransparentRegionHint: null mSurface after mHasSurface true");
|
||||
return;
|
||||
}
|
||||
mSurfaceController.setTransparentRegionHint(region);
|
||||
}
|
||||
|
||||
boolean setWallpaperOffset(int dx, int dy, float scale) {
|
||||
if (mXOffset == dx && mYOffset == dy && Float.compare(mWallpaperScale, scale) == 0) {
|
||||
return false;
|
||||
|
||||
@@ -194,22 +194,6 @@ class WindowSurfaceController {
|
||||
return true;
|
||||
}
|
||||
|
||||
void setTransparentRegionHint(final Region region) {
|
||||
if (mSurfaceControl == null) {
|
||||
Slog.w(TAG, "setTransparentRegionHint: null mSurface after mHasSurface true");
|
||||
return;
|
||||
}
|
||||
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setTransparentRegion");
|
||||
mService.openSurfaceTransaction();
|
||||
try {
|
||||
getGlobalTransaction().setTransparentRegionHint(mSurfaceControl, region);
|
||||
} finally {
|
||||
mService.closeSurfaceTransaction("setTransparentRegion");
|
||||
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
|
||||
"<<< CLOSE TRANSACTION setTransparentRegion");
|
||||
}
|
||||
}
|
||||
|
||||
void setOpaque(boolean isOpaque) {
|
||||
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isOpaque=%b: %s", isOpaque, title);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user