Loading core/java/android/view/TextureView.java +14 −9 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ public class TextureView extends View { if (opaque != mOpaque) { mOpaque = opaque; if (mLayer != null) { updateLayer(); updateLayerAndInvalidate(); } } } Loading Loading @@ -310,6 +310,7 @@ public class TextureView extends View { super.onSizeChanged(w, h, oldw, oldh); if (mSurface != null) { nSetDefaultBufferSize(mSurface, getWidth(), getHeight()); updateLayer(); if (mListener != null) { mListener.onSurfaceTextureSizeChanged(mSurface, getWidth(), getHeight()); } Loading Loading @@ -352,9 +353,7 @@ public class TextureView extends View { public void onFrameAvailable(SurfaceTexture surfaceTexture) { // Per SurfaceTexture's documentation, the callback may be invoked // from an arbitrary thread synchronized (mLock) { mUpdateLayer = true; } updateLayer(); if (Looper.myLooper() == Looper.getMainLooper()) { invalidate(); Loading @@ -379,9 +378,7 @@ public class TextureView extends View { // Since we are updating the layer, force an update to ensure its // parameters are correct (width, height, transform, etc.) synchronized (mLock) { mUpdateLayer = true; } updateLayer(); mMatrixChanged = true; mAttachInfo.mHardwareRenderer.setSurfaceTexture(mLayer, mSurface); Loading @@ -404,7 +401,7 @@ public class TextureView extends View { // updates listener if (visibility == VISIBLE) { mSurface.setOnFrameAvailableListener(mUpdateListener); updateLayer(); updateLayerAndInvalidate(); } else { mSurface.setOnFrameAvailableListener(null); } Loading @@ -412,7 +409,15 @@ public class TextureView extends View { } private void updateLayer() { synchronized (mLock) { mUpdateLayer = true; } } private void updateLayerAndInvalidate() { synchronized (mLock) { mUpdateLayer = true; } invalidate(); } Loading Loading
core/java/android/view/TextureView.java +14 −9 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ public class TextureView extends View { if (opaque != mOpaque) { mOpaque = opaque; if (mLayer != null) { updateLayer(); updateLayerAndInvalidate(); } } } Loading Loading @@ -310,6 +310,7 @@ public class TextureView extends View { super.onSizeChanged(w, h, oldw, oldh); if (mSurface != null) { nSetDefaultBufferSize(mSurface, getWidth(), getHeight()); updateLayer(); if (mListener != null) { mListener.onSurfaceTextureSizeChanged(mSurface, getWidth(), getHeight()); } Loading Loading @@ -352,9 +353,7 @@ public class TextureView extends View { public void onFrameAvailable(SurfaceTexture surfaceTexture) { // Per SurfaceTexture's documentation, the callback may be invoked // from an arbitrary thread synchronized (mLock) { mUpdateLayer = true; } updateLayer(); if (Looper.myLooper() == Looper.getMainLooper()) { invalidate(); Loading @@ -379,9 +378,7 @@ public class TextureView extends View { // Since we are updating the layer, force an update to ensure its // parameters are correct (width, height, transform, etc.) synchronized (mLock) { mUpdateLayer = true; } updateLayer(); mMatrixChanged = true; mAttachInfo.mHardwareRenderer.setSurfaceTexture(mLayer, mSurface); Loading @@ -404,7 +401,7 @@ public class TextureView extends View { // updates listener if (visibility == VISIBLE) { mSurface.setOnFrameAvailableListener(mUpdateListener); updateLayer(); updateLayerAndInvalidate(); } else { mSurface.setOnFrameAvailableListener(null); } Loading @@ -412,7 +409,15 @@ public class TextureView extends View { } private void updateLayer() { synchronized (mLock) { mUpdateLayer = true; } } private void updateLayerAndInvalidate() { synchronized (mLock) { mUpdateLayer = true; } invalidate(); } Loading