summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2013-01-16 17:54:08 -0800
committerStephen Hines <srhines@google.com>2013-01-22 18:06:10 -0800
commit0746ce0977cde616d25ce35fee0d8d554235a21c (patch)
tree5b4a867d3b96bd250510f03292d964e97e8a1d73
parentb49e480479c71ed1906ee00423e8c44c7224da91 (diff)
downloadandroid_packages_apps_Gallery2-0746ce0977cde616d25ce35fee0d8d554235a21c.tar.gz
android_packages_apps_Gallery2-0746ce0977cde616d25ce35fee0d8d554235a21c.tar.bz2
android_packages_apps_Gallery2-0746ce0977cde616d25ce35fee0d8d554235a21c.zip
Switch Gallery over to RS compatibility library.
Change-Id: If6eaea15a12a1448b402fb00dfd770b3749471ad
-rw-r--r--Android.mk11
-rw-r--r--proguard.flags2
-rw-r--r--src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java8
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java6
4 files changed, 15 insertions, 12 deletions
diff --git a/Android.mk b/Android.mk
index a5efe5500..1ef2fab10 100644
--- a/Android.mk
+++ b/Android.mk
@@ -8,12 +8,17 @@ LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2
LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit
LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
+LOCAL_STATIC_JAVA_LIBRARIES += android.support.v8.renderscript
+
+LOCAL_RENDERSCRIPT_TARGET_API := 18
+LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
+LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=android.support.v8.renderscript
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
LOCAL_SRC_FILES += $(call all-java-files-under, ../Camera/src)
-LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
+LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += packages/apps/Camera/res
LOCAL_AAPT_FLAGS := --auto-add-overlay \
@@ -29,9 +34,9 @@ LOCAL_SDK_VERSION := current
# the libraries in the APK, otherwise just put them in /system/lib and
# leave them out of the APK
ifneq (,$(TARGET_BUILD_APPS))
- LOCAL_JNI_SHARED_LIBRARIES := libjni_mosaic libjni_eglfence libjni_filtershow_filters
+ LOCAL_JNI_SHARED_LIBRARIES := libjni_mosaic libjni_eglfence libjni_filtershow_filters librsjni
else
- LOCAL_REQUIRED_MODULES := libjni_mosaic libjni_eglfence libjni_filtershow_filters
+ LOCAL_REQUIRED_MODULES := libjni_mosaic libjni_eglfence libjni_filtershow_filters librsjni
endif
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
diff --git a/proguard.flags b/proguard.flags
index b54b0c791..dce9d077d 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -45,6 +45,8 @@
# Disable the warnings of using dynamic method calls in EffectsRecorder
-dontnote com.android.camera.EffectsRecorder
+-keep class android.support.v8.renderscript.** { *; }
+
# Required for ActionBarSherlock
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
diff --git a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
index a1dbe8e52..802b556f9 100644
--- a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
+++ b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
@@ -19,9 +19,7 @@ package com.android.gallery3d.filtershow.cache;
import android.graphics.Bitmap;
import android.os.*;
import android.os.Process;
-import android.renderscript.Allocation;
-import android.renderscript.Allocation.MipmapControl;
-import android.renderscript.RenderScript;
+import android.support.v8.renderscript.*;
import android.util.Log;
import com.android.gallery3d.filtershow.filters.ImageFilterRS;
@@ -144,13 +142,13 @@ public class FilteringPipeline implements Handler.Callback {
mFiltersOnlyOriginalAllocation.destroy();
}
mFiltersOnlyOriginalAllocation = Allocation.createFromBitmap(RS, mOriginalBitmap,
- MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
+ Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
if (mOriginalAllocation != null) {
mOriginalAllocation.destroy();
}
mResizedOriginalBitmap = preset.applyGeometry(mOriginalBitmap);
mOriginalAllocation = Allocation.createFromBitmap(RS, mResizedOriginalBitmap,
- MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
+ Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
mPreviousGeometry = new GeometryMetadata(geometry);
return true;
}
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
index 63dc82c34..368e29a78 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
@@ -18,9 +18,7 @@ package com.android.gallery3d.filtershow.filters;
import android.app.Activity;
import android.graphics.Bitmap;
-import android.renderscript.Allocation;
-import android.renderscript.Allocation.MipmapControl;
-import android.renderscript.RenderScript;
+import android.support.v8.renderscript.*;
import android.util.Log;
public class ImageFilterRS extends ImageFilter {
@@ -48,7 +46,7 @@ public class ImageFilterRS extends ImageFilter {
}
Bitmap bitmapBuffer = bitmap.copy(mBitmapConfig, true);
mOutPixelsAllocation = Allocation.createFromBitmap(mRS, bitmapBuffer,
- MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
+ Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
mInPixelsAllocation = Allocation.createTyped(mRS,
mOutPixelsAllocation.getType());
sOldBitmap = bitmap;