diff options
| author | Jamie Gennis <jgennis@google.com> | 2012-04-17 16:01:34 -0700 |
|---|---|---|
| committer | Jamie Gennis <jgennis@google.com> | 2012-04-30 13:54:38 -0700 |
| commit | 8a34d6800e70da45bac662873f6951c8d8295a15 (patch) | |
| tree | a4fac07f9fac2b0ce297e0875d4f056654486dc6 /core/java/android/view/TextureView.java | |
| parent | 9e2b578fffee37e717b936d43b52d30b18bf64ce (diff) | |
TextureView: don't call onSTAvailable due to setST
This change makes TextureView skip calling the onSurfaceTextureAvailable
callback when setSurfaceTexture is used to change the TextureView's
SurfaceTexture.
Change-Id: Ie08f72f157c3bfce3215076b21994026ef66d88d
Diffstat (limited to 'core/java/android/view/TextureView.java')
| -rw-r--r-- | core/java/android/view/TextureView.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java index 214dc5c12b74..651be2e9c1e4 100644 --- a/core/java/android/view/TextureView.java +++ b/core/java/android/view/TextureView.java @@ -339,8 +339,7 @@ public class TextureView extends View { mLayer = mAttachInfo.mHardwareRenderer.createHardwareLayer(mOpaque); if (!mUpdateSurface) { - // We already have a SurfaceTexture to use, and we will pass it - // to mLayer below. + // Create a new SurfaceTexture for the layer. mSurface = mAttachInfo.mHardwareRenderer.createSurfaceTexture(mLayer); } nSetDefaultBufferSize(mSurface, getWidth(), getHeight()); @@ -359,7 +358,7 @@ public class TextureView extends View { }; mSurface.setOnFrameAvailableListener(mUpdateListener); - if (mListener != null) { + if (mListener != null && !mUpdateSurface) { mListener.onSurfaceTextureAvailable(mSurface, getWidth(), getHeight()); } } @@ -669,7 +668,9 @@ public class TextureView extends View { * SurfaceTexture} is already being used by this view, it is immediately * released and not be usable any more. The {@link * SurfaceTextureListener#onSurfaceTextureDestroyed} callback is <b>not</b> - * called. + * called for the previous {@link SurfaceTexture}. Similarly, the {@link + * SurfaceTextureListener#onSurfaceTextureAvailable} callback is <b>not</b> + * called for the {@link SurfaceTexture} passed to setSurfaceTexture. * * The {@link SurfaceTexture} object must be detached from all OpenGL ES * contexts prior to calling this method. |
