diff options
| author | Romain Guy <romainguy@google.com> | 2011-06-17 17:45:59 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2011-06-17 17:45:59 -0700 |
| commit | d6b2a00dd43257d1498b09175bff63663f6cb861 (patch) | |
| tree | 458956fbcc18eb53ddc81fd7a4d1bf64ee3c7a92 /core/java/android/view/TextureView.java | |
| parent | 98029c825b9234e6b90721d910cc180885fcab1d (diff) | |
Add error checking to LayerRenderer::copyLayer
This method is invoked by TextureView.getBitmap() and failures must be
caught to avoid leaving the GL context in a potentially bad state.
Change-Id: I620de395ba1bc20154de58c81963223dc55cac78
Diffstat (limited to 'core/java/android/view/TextureView.java')
| -rw-r--r-- | core/java/android/view/TextureView.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java index 164c6578cc71..042120587dea 100644 --- a/core/java/android/view/TextureView.java +++ b/core/java/android/view/TextureView.java @@ -306,6 +306,8 @@ public class TextureView extends View { * <p><strong>Do not</strong> invoke this method from a drawing method * ({@link #onDraw(android.graphics.Canvas)} for instance).</p> * + * <p>If an error occurs during the copy, an empty bitmap will be returned.</p> + * * @return A valid {@link Bitmap.Config#ARGB_8888} bitmap, or null if the surface * texture is not available or the width <= 0 or the height <= 0 * @@ -328,6 +330,8 @@ public class TextureView extends View { * <p><strong>Do not</strong> invoke this method from a drawing method * ({@link #onDraw(android.graphics.Canvas)} for instance).</p> * + * <p>If an error occurs during the copy, an empty bitmap will be returned.</p> + * * @param width The width of the bitmap to create * @param height The height of the bitmap to create * @@ -354,6 +358,8 @@ public class TextureView extends View { * <p><strong>Do not</strong> invoke this method from a drawing method * ({@link #onDraw(android.graphics.Canvas)} for instance).</p> * + * <p>If an error occurs, the bitmap is left unchanged.</p> + * * @param bitmap The bitmap to copy the content of the surface texture into, * cannot be null, all configurations are supported * @@ -447,5 +453,6 @@ public class TextureView extends View { public void onSurfaceTextureDestroyed(SurfaceTexture surface); } - private static native void nSetDefaultBufferSize(SurfaceTexture surfaceTexture, int width, int height); + private static native void nSetDefaultBufferSize(SurfaceTexture surfaceTexture, + int width, int height); } |
