diff options
| author | Jason Sams <jsams@google.com> | 2013-09-23 16:05:44 -0700 |
|---|---|---|
| committer | Jason Sams <jsams@google.com> | 2013-09-23 16:05:44 -0700 |
| commit | d1e8cb25b5b1a55de0dd5bffe8d3ffee9a7bf348 (patch) | |
| tree | 01ab43dfaf3fc5b225577a75fa4fe3ffe618402e /samples/RenderScript | |
| parent | ff306b6613111765f33de105db750e33dec60f01 (diff) | |
| download | android_development-d1e8cb25b5b1a55de0dd5bffe8d3ffee9a7bf348.tar.gz android_development-d1e8cb25b5b1a55de0dd5bffe8d3ffee9a7bf348.tar.bz2 android_development-d1e8cb25b5b1a55de0dd5bffe8d3ffee9a7bf348.zip | |
Fix use of dead APIs.
bug 10752757
Change-Id: I8e145f141eb573456d62b32cf8c10387f666635b
Diffstat (limited to 'samples/RenderScript')
| -rw-r--r-- | samples/RenderScript/Levels/src/com/android/rs/levels/LevelsRSActivity.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/samples/RenderScript/Levels/src/com/android/rs/levels/LevelsRSActivity.java b/samples/RenderScript/Levels/src/com/android/rs/levels/LevelsRSActivity.java index d63ee4495..49076a529 100644 --- a/samples/RenderScript/Levels/src/com/android/rs/levels/LevelsRSActivity.java +++ b/samples/RenderScript/Levels/src/com/android/rs/levels/LevelsRSActivity.java @@ -22,6 +22,7 @@ import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.os.Bundle; import android.graphics.SurfaceTexture; +import android.view.Surface; import android.renderscript.Allocation; import android.renderscript.Matrix3f; import android.renderscript.RenderScript; @@ -211,18 +212,22 @@ public class LevelsRSActivity extends Activity @Override public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { - mOutPixelsAllocation.setSurfaceTexture(surface); + if (surface != null) { + mOutPixelsAllocation.setSurface(new Surface(surface)); + } filter(); } @Override public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { - mOutPixelsAllocation.setSurfaceTexture(surface); + if (surface != null) { + mOutPixelsAllocation.setSurface(new Surface(surface)); + } } @Override public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { - mOutPixelsAllocation.setSurfaceTexture(null); + mOutPixelsAllocation.setSurface(null); return true; } |
