Merge "SurfaceView: Update transform hint only if the view is visible" into sc-dev am: 861ba140a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302836 Change-Id: I48261545315b21c41a5c6802f7870e3a946d88ef
This commit is contained in:
@@ -1081,7 +1081,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
|| mWindowSpaceTop != mLocation[1];
|
|| mWindowSpaceTop != mLocation[1];
|
||||||
final boolean layoutSizeChanged = getWidth() != mScreenRect.width()
|
final boolean layoutSizeChanged = getWidth() != mScreenRect.width()
|
||||||
|| getHeight() != mScreenRect.height();
|
|| getHeight() != mScreenRect.height();
|
||||||
final boolean hintChanged = viewRoot.getSurfaceTransformHint() != mTransformHint;
|
final boolean hintChanged = (viewRoot.getSurfaceTransformHint() != mTransformHint)
|
||||||
|
&& mRequestedVisible;
|
||||||
|
|
||||||
if (creating || formatChanged || sizeChanged || visibleChanged ||
|
if (creating || formatChanged || sizeChanged || visibleChanged ||
|
||||||
(mUseAlpha && alphaChanged) || windowVisibleChanged ||
|
(mUseAlpha && alphaChanged) || windowVisibleChanged ||
|
||||||
@@ -1227,7 +1228,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
// Therefore, we must explicitly recreate the {@link Surface} in these
|
// Therefore, we must explicitly recreate the {@link Surface} in these
|
||||||
// cases.
|
// cases.
|
||||||
if (mUseBlastAdapter) {
|
if (mUseBlastAdapter) {
|
||||||
mSurface.transferFrom(mBlastBufferQueue.createSurfaceWithHandle());
|
if (mBlastBufferQueue != null) {
|
||||||
|
mSurface.transferFrom(mBlastBufferQueue.createSurfaceWithHandle());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mSurface.createFrom(mSurfaceControl);
|
mSurface.createFrom(mSurfaceControl);
|
||||||
}
|
}
|
||||||
@@ -1237,7 +1240,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
private void setBufferSize(Transaction transaction) {
|
private void setBufferSize(Transaction transaction) {
|
||||||
if (mUseBlastAdapter) {
|
if (mUseBlastAdapter) {
|
||||||
mBlastSurfaceControl.setTransformHint(mTransformHint);
|
mBlastSurfaceControl.setTransformHint(mTransformHint);
|
||||||
mBlastBufferQueue.update(mBlastSurfaceControl, mSurfaceWidth, mSurfaceHeight, mFormat);
|
if (mBlastBufferQueue != null) {
|
||||||
|
mBlastBufferQueue.update(mBlastSurfaceControl, mSurfaceWidth, mSurfaceHeight,
|
||||||
|
mFormat);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
transaction.setBufferSize(mSurfaceControl, mSurfaceWidth, mSurfaceHeight);
|
transaction.setBufferSize(mSurfaceControl, mSurfaceWidth, mSurfaceHeight);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user