am ef93ca05: Merge "Fix use of dead APIs." into klp-dev

* commit 'ef93ca055b8dfaeff2304784c376cbb0a6c5f073':
  Fix use of dead APIs.
This commit is contained in:
Jason Sams
2013-09-24 13:25:47 -07:00
committed by Android Git Automerger

View File

@@ -22,6 +22,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.os.Bundle; import android.os.Bundle;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface;
import android.renderscript.Allocation; import android.renderscript.Allocation;
import android.renderscript.Matrix3f; import android.renderscript.Matrix3f;
import android.renderscript.RenderScript; import android.renderscript.RenderScript;
@@ -211,18 +212,22 @@ public class LevelsRSActivity extends Activity
@Override @Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
mOutPixelsAllocation.setSurfaceTexture(surface); if (surface != null) {
mOutPixelsAllocation.setSurface(new Surface(surface));
}
filter(); filter();
} }
@Override @Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
mOutPixelsAllocation.setSurfaceTexture(surface); if (surface != null) {
mOutPixelsAllocation.setSurface(new Surface(surface));
}
} }
@Override @Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
mOutPixelsAllocation.setSurfaceTexture(null); mOutPixelsAllocation.setSurface(null);
return true; return true;
} }