summaryrefslogtreecommitdiffstats
path: root/carousel/java
diff options
context:
space:
mode:
Diffstat (limited to 'carousel/java')
-rw-r--r--carousel/java/com/android/ex/carousel/CarouselRS.java14
-rw-r--r--carousel/java/com/android/ex/carousel/CarouselView.java4
-rw-r--r--carousel/java/com/android/ex/carousel/CarouselViewHelper.java4
3 files changed, 11 insertions, 11 deletions
diff --git a/carousel/java/com/android/ex/carousel/CarouselRS.java b/carousel/java/com/android/ex/carousel/CarouselRS.java
index 8e0c644..74fcb35 100644
--- a/carousel/java/com/android/ex/carousel/CarouselRS.java
+++ b/carousel/java/com/android/ex/carousel/CarouselRS.java
@@ -19,7 +19,7 @@ package com.android.ex.carousel;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.renderscript.*;
-import android.renderscript.RenderScript.RSMessage;
+import android.renderscript.RenderScript.RSMessageHandler;
import android.util.Log;
import static android.renderscript.Element.*;
@@ -175,7 +175,7 @@ public class CarouselRS {
void onAnimationFinished(float carouselRotationAngle);
};
- private RSMessage mRsMessage = new RSMessage() {
+ private RSMessageHandler mRsMessage = new RSMessageHandler() {
public void run() {
if (mCallback == null) return;
switch (mID) {
@@ -241,8 +241,8 @@ public class CarouselRS {
mRes = res;
// create the script object
- mScript = new ScriptC_carousel(mRS, mRes, resId, true);
- mRS.mMessageCallback = mRsMessage;
+ mScript = new ScriptC_carousel(mRS, mRes, resId);
+ mRS.setMessageHandler(mRsMessage);
initProgramStore();
initFragmentProgram();
initRasterProgram();
@@ -526,7 +526,7 @@ public class CarouselRS {
} else if (bitmap != null) {
if (bitmap.getWidth() == allocation.getType().getX()
&& bitmap.getHeight() == allocation.getType().getY()) {
- allocation.updateFromBitmap(bitmap);
+ allocation.copyFrom(bitmap);
allocation.uploadToTexture(0);
} else {
Log.v(TAG, "Warning, bitmap has different size. Taking slow path");
@@ -695,11 +695,11 @@ public class CarouselRS {
public void pauseRendering() {
// Used to update multiple states at once w/o redrawing for each.
- mRS.contextBindRootScript(null);
+ mRS.bindRootScript(null);
}
public void resumeRendering() {
- mRS.contextBindRootScript(mScript);
+ mRS.bindRootScript(mScript);
}
public void doLongPress() {
diff --git a/carousel/java/com/android/ex/carousel/CarouselView.java b/carousel/java/com/android/ex/carousel/CarouselView.java
index 5bc6896..cd1a919 100644
--- a/carousel/java/com/android/ex/carousel/CarouselView.java
+++ b/carousel/java/com/android/ex/carousel/CarouselView.java
@@ -144,7 +144,7 @@ public abstract class CarouselView extends RSSurfaceView {
if (USE_DEPTH_BUFFER) {
sc.setDepth(16, 24);
}
- mRS = createRenderScript(sc);
+ mRS = createRenderScriptGL(sc);
}
if (mRenderScript == null) {
mRenderScript = new CarouselRS(mRS, mContext.getResources(),
@@ -523,7 +523,7 @@ public abstract class CarouselView extends RSSurfaceView {
mRenderScript = null;
if (mRS != null) {
mRS = null;
- destroyRenderScript();
+ destroyRenderScriptGL();
}
mController.setRS(mRS, mRenderScript);
}
diff --git a/carousel/java/com/android/ex/carousel/CarouselViewHelper.java b/carousel/java/com/android/ex/carousel/CarouselViewHelper.java
index 4acf99a..a8a2c82 100644
--- a/carousel/java/com/android/ex/carousel/CarouselViewHelper.java
+++ b/carousel/java/com/android/ex/carousel/CarouselViewHelper.java
@@ -269,11 +269,11 @@ public class CarouselViewHelper implements CarouselCallback {
}
public void onResume() {
- mCarouselView.onResume();
+ mCarouselView.resume();
}
public void onPause() {
- mCarouselView.onPause();
+ mCarouselView.pause();
}
public void onDestroy() {