summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@android.com>2015-02-24 00:39:50 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-24 00:39:50 (GMT)
commit46ca918db82c1fca3f370ec6a9b936bf7268aa85 (patch)
tree86c96f06c1e225c8e23a5858b60c423cc89b872a
parentf924719d491c2b1a1c42234a0a174d975691b483 (diff)
parent482fc563fa9783cce1dee882e8d4cd4d2d92b1c6 (diff)
downloadandroid_frameworks_ex-46ca918db82c1fca3f370ec6a9b936bf7268aa85.zip
android_frameworks_ex-46ca918db82c1fca3f370ec6a9b936bf7268aa85.tar.gz
android_frameworks_ex-46ca918db82c1fca3f370ec6a9b936bf7268aa85.tar.bz2
am 482fc563: Merge "Make WebP in FrameSequence optional"
* commit '482fc563fa9783cce1dee882e8d4cd4d2d92b1c6': Make WebP in FrameSequence optional
-rw-r--r--framesequence/jni/Android.mk12
-rw-r--r--framesequence/samples/FrameSequenceSamples/Android.mk (renamed from framesequence/samples/RastermillSamples/Android.mk)2
-rw-r--r--framesequence/samples/FrameSequenceSamples/AndroidManifest.xml (renamed from framesequence/samples/RastermillSamples/AndroidManifest.xml)4
-rw-r--r--framesequence/samples/FrameSequenceSamples/build.xml (renamed from framesequence/samples/RastermillSamples/build.xml)0
-rw-r--r--framesequence/samples/FrameSequenceSamples/proguard.flags (renamed from framesequence/samples/RastermillSamples/proguard.flags)0
-rw-r--r--framesequence/samples/FrameSequenceSamples/project.properties (renamed from framesequence/samples/RastermillSamples/project.properties)0
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/drawable-hdpi/ic_launcher.png (renamed from framesequence/samples/RastermillSamples/res/drawable-hdpi/ic_launcher.png)bin9397 -> 9397 bytes
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/drawable-mdpi/ic_launcher.png (renamed from framesequence/samples/RastermillSamples/res/drawable-mdpi/ic_launcher.png)bin5237 -> 5237 bytes
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/drawable-xhdpi/ic_launcher.png (renamed from framesequence/samples/RastermillSamples/res/drawable-xhdpi/ic_launcher.png)bin14383 -> 14383 bytes
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/layout/basic_test_activity.xml (renamed from framesequence/samples/RastermillSamples/res/layout/basic_test_activity.xml)0
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/raw/animated_gif.gif (renamed from framesequence/samples/RastermillSamples/res/raw/animated.gif)bin34978 -> 34978 bytes
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/raw/animated_webp.webpbin0 -> 380850 bytes
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/values/strings.xml (renamed from framesequence/samples/RastermillSamples/res/values/strings.xml)2
-rw-r--r--framesequence/samples/FrameSequenceSamples/res/values/styles.xml (renamed from framesequence/samples/RastermillSamples/res/values/styles.xml)0
-rw-r--r--framesequence/samples/FrameSequenceSamples/src/com/android/framesequence/samples/FrameSequenceTest.java (renamed from framesequence/samples/RastermillSamples/src/com/android/rastermill/samples/AnimatedGifTest.java)11
-rw-r--r--framesequence/samples/FrameSequenceSamples/src/com/android/framesequence/samples/SamplesList.java (renamed from framesequence/samples/RastermillSamples/src/com/android/rastermill/samples/SamplesList.java)15
-rw-r--r--framesequence/src/android/support/rastermill/FrameSequenceDrawable.java3
17 files changed, 30 insertions, 19 deletions
diff --git a/framesequence/jni/Android.mk b/framesequence/jni/Android.mk
index e9d0ec5..7353436 100644
--- a/framesequence/jni/Android.mk
+++ b/framesequence/jni/Android.mk
@@ -19,13 +19,12 @@ include $(CLEAR_VARS)
## Main library
-LOCAL_STATIC_LIBRARIES += libgif libwebp-decode
+LOCAL_STATIC_LIBRARIES = libgif
LOCAL_LDFLAGS := -llog -ljnigraphics
LOCAL_C_INCLUDES := \
- external/giflib \
- external/webp/include
+ external/giflib
LOCAL_MODULE := libframesequence
LOCAL_SRC_FILES := \
@@ -33,11 +32,16 @@ LOCAL_SRC_FILES := \
FrameSequence.cpp \
FrameSequenceJNI.cpp \
FrameSequence_gif.cpp \
- FrameSequence_webp.cpp \
JNIHelpers.cpp \
Registry.cpp \
Stream.cpp
+ifeq ($(FRAMESEQUENCE_INCLUDE_WEBP),true)
+ LOCAL_C_INCLUDES += external/webp/include
+ LOCAL_SRC_FILES += FrameSequence_webp.cpp
+ LOCAL_STATIC_LIBRARIES += libwebp-decode
+endif
+
LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Wno-unused-variable -Wno-overloaded-virtual
LOCAL_CFLAGS += -fvisibility=hidden
diff --git a/framesequence/samples/RastermillSamples/Android.mk b/framesequence/samples/FrameSequenceSamples/Android.mk
index bb8920f..fff4a15 100644
--- a/framesequence/samples/RastermillSamples/Android.mk
+++ b/framesequence/samples/FrameSequenceSamples/Android.mk
@@ -35,6 +35,6 @@ LOCAL_SDK_VERSION := 19
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, res)
LOCAL_AAPT_FLAGS := --auto-add-overlay
-LOCAL_AAPT_FLAGS += --extra-packages com.android.rastermill.samples
+LOCAL_AAPT_FLAGS += --extra-packages com.android.framesequence.samples
include $(BUILD_PACKAGE)
diff --git a/framesequence/samples/RastermillSamples/AndroidManifest.xml b/framesequence/samples/FrameSequenceSamples/AndroidManifest.xml
index b554021..d614631 100644
--- a/framesequence/samples/RastermillSamples/AndroidManifest.xml
+++ b/framesequence/samples/FrameSequenceSamples/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.rastermill.samples"
+ package="com.android.framesequence.samples"
android:versionCode="1"
android:versionName="1.0" >
@@ -20,7 +20,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name=".AnimatedGifTest" />
+ <activity android:name=".FrameSequenceTest" />
</application>
</manifest>
diff --git a/framesequence/samples/RastermillSamples/build.xml b/framesequence/samples/FrameSequenceSamples/build.xml
index 5e55b4e..5e55b4e 100644
--- a/framesequence/samples/RastermillSamples/build.xml
+++ b/framesequence/samples/FrameSequenceSamples/build.xml
diff --git a/framesequence/samples/RastermillSamples/proguard.flags b/framesequence/samples/FrameSequenceSamples/proguard.flags
index 4acde2d..4acde2d 100644
--- a/framesequence/samples/RastermillSamples/proguard.flags
+++ b/framesequence/samples/FrameSequenceSamples/proguard.flags
diff --git a/framesequence/samples/RastermillSamples/project.properties b/framesequence/samples/FrameSequenceSamples/project.properties
index ce39f2d..ce39f2d 100644
--- a/framesequence/samples/RastermillSamples/project.properties
+++ b/framesequence/samples/FrameSequenceSamples/project.properties
diff --git a/framesequence/samples/RastermillSamples/res/drawable-hdpi/ic_launcher.png b/framesequence/samples/FrameSequenceSamples/res/drawable-hdpi/ic_launcher.png
index 96a442e..96a442e 100644
--- a/framesequence/samples/RastermillSamples/res/drawable-hdpi/ic_launcher.png
+++ b/framesequence/samples/FrameSequenceSamples/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/framesequence/samples/RastermillSamples/res/drawable-mdpi/ic_launcher.png b/framesequence/samples/FrameSequenceSamples/res/drawable-mdpi/ic_launcher.png
index 359047d..359047d 100644
--- a/framesequence/samples/RastermillSamples/res/drawable-mdpi/ic_launcher.png
+++ b/framesequence/samples/FrameSequenceSamples/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/framesequence/samples/RastermillSamples/res/drawable-xhdpi/ic_launcher.png b/framesequence/samples/FrameSequenceSamples/res/drawable-xhdpi/ic_launcher.png
index 71c6d76..71c6d76 100644
--- a/framesequence/samples/RastermillSamples/res/drawable-xhdpi/ic_launcher.png
+++ b/framesequence/samples/FrameSequenceSamples/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/framesequence/samples/RastermillSamples/res/layout/basic_test_activity.xml b/framesequence/samples/FrameSequenceSamples/res/layout/basic_test_activity.xml
index 0b9a2df..0b9a2df 100644
--- a/framesequence/samples/RastermillSamples/res/layout/basic_test_activity.xml
+++ b/framesequence/samples/FrameSequenceSamples/res/layout/basic_test_activity.xml
diff --git a/framesequence/samples/RastermillSamples/res/raw/animated.gif b/framesequence/samples/FrameSequenceSamples/res/raw/animated_gif.gif
index 51baf15..51baf15 100644
--- a/framesequence/samples/RastermillSamples/res/raw/animated.gif
+++ b/framesequence/samples/FrameSequenceSamples/res/raw/animated_gif.gif
Binary files differ
diff --git a/framesequence/samples/FrameSequenceSamples/res/raw/animated_webp.webp b/framesequence/samples/FrameSequenceSamples/res/raw/animated_webp.webp
new file mode 100644
index 0000000..25c6a4d
--- /dev/null
+++ b/framesequence/samples/FrameSequenceSamples/res/raw/animated_webp.webp
Binary files differ
diff --git a/framesequence/samples/RastermillSamples/res/values/strings.xml b/framesequence/samples/FrameSequenceSamples/res/values/strings.xml
index 811c979..dc0962e 100644
--- a/framesequence/samples/RastermillSamples/res/values/strings.xml
+++ b/framesequence/samples/FrameSequenceSamples/res/values/strings.xml
@@ -3,7 +3,7 @@
<!-- NOTE: all strings should be marked as translatable=false,
since this sample app is for testing, and won't be shipped -->
- <string name="app_name" translatable="false">Rastermill Samples</string>
+ <string name="app_name" translatable="false">FrameSequence Samples</string>
<string name="action_settings" translatable="false">Settings</string>
<string name="start" translatable="false">start</string>
diff --git a/framesequence/samples/RastermillSamples/res/values/styles.xml b/framesequence/samples/FrameSequenceSamples/res/values/styles.xml
index 737bdc3..737bdc3 100644
--- a/framesequence/samples/RastermillSamples/res/values/styles.xml
+++ b/framesequence/samples/FrameSequenceSamples/res/values/styles.xml
diff --git a/framesequence/samples/RastermillSamples/src/com/android/rastermill/samples/AnimatedGifTest.java b/framesequence/samples/FrameSequenceSamples/src/com/android/framesequence/samples/FrameSequenceTest.java
index 2328975..5587dc6 100644
--- a/framesequence/samples/RastermillSamples/src/com/android/rastermill/samples/AnimatedGifTest.java
+++ b/framesequence/samples/FrameSequenceSamples/src/com/android/framesequence/samples/FrameSequenceTest.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.rastermill.samples;
+package com.android.framesequence.samples;
import android.app.Activity;
import android.graphics.Bitmap;
@@ -27,8 +27,9 @@ import android.widget.Toast;
import java.io.InputStream;
import java.util.HashSet;
-public class AnimatedGifTest extends Activity {
+public class FrameSequenceTest extends Activity {
FrameSequenceDrawable mDrawable;
+ int mResourceId;
// This provider is entirely unnecessary, just here to validate the acquire/release process
private class CheckingProvider implements FrameSequenceDrawable.BitmapProvider {
@@ -59,6 +60,8 @@ public class AnimatedGifTest extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ mResourceId = getIntent().getIntExtra("resourceId", R.raw.animated_gif);
+
setContentView(R.layout.basic_test_activity);
findViewById(R.id.start).setOnClickListener(new View.OnClickListener() {
@Override
@@ -91,7 +94,7 @@ public class AnimatedGifTest extends Activity {
super.onResume();
ImageView imageView = (ImageView) findViewById(R.id.imageview);
- InputStream is = getResources().openRawResource(R.raw.animated);
+ InputStream is = getResources().openRawResource(mResourceId);
FrameSequence fs = FrameSequence.decodeStream(is);
mDrawable = new FrameSequenceDrawable(fs, mProvider);
@@ -99,7 +102,7 @@ public class AnimatedGifTest extends Activity {
@Override
public void onFinished(FrameSequenceDrawable drawable) {
Toast.makeText(getApplicationContext(),
- "THE ANIMATION HAS FINISHED", Toast.LENGTH_SHORT).show();
+ "The animation has finished", Toast.LENGTH_SHORT).show();
}
});
imageView.setImageDrawable(mDrawable);
diff --git a/framesequence/samples/RastermillSamples/src/com/android/rastermill/samples/SamplesList.java b/framesequence/samples/FrameSequenceSamples/src/com/android/framesequence/samples/SamplesList.java
index 0447537..c67b83c 100644
--- a/framesequence/samples/RastermillSamples/src/com/android/rastermill/samples/SamplesList.java
+++ b/framesequence/samples/FrameSequenceSamples/src/com/android/framesequence/samples/SamplesList.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.rastermill.samples;
+package com.android.framesequence.samples;
import android.app.ListActivity;
import android.content.Intent;
@@ -31,17 +31,20 @@ public class SamplesList extends ListActivity {
static final String KEY_NAME = "name";
static final String KEY_CLASS = "clazz";
+ static final String KEY_RESOURCE = "res";
- static Map<String,?> makeSample(String name, Class<?> activity) {
+ static Map<String,?> makeSample(String name, Class<?> activity, int resourceId) {
Map<String,Object> ret = new HashMap<String,Object>();
ret.put(KEY_NAME, name);
ret.put(KEY_CLASS, activity);
+ ret.put(KEY_RESOURCE, resourceId);
return ret;
}
@SuppressWarnings("serial")
static final ArrayList<Map<String,?>> SAMPLES = new ArrayList<Map<String,?>>() {{
- add(makeSample("Animation Test", AnimatedGifTest.class));
+ add(makeSample("GIF animation", FrameSequenceTest.class, R.raw.animated_gif));
+ add(makeSample("WEBP animation", FrameSequenceTest.class, R.raw.animated_webp));
}};
@Override
@@ -55,7 +58,11 @@ public class SamplesList extends ListActivity {
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
Class<?> clazz = (Class<?>) SAMPLES.get(position).get(KEY_CLASS);
- startActivity(new Intent(this, clazz));
+ int resourceId = ((Integer) SAMPLES.get(position).get(KEY_RESOURCE)).intValue();
+
+ Intent intent = new Intent(this, clazz);
+ intent.putExtra("resourceId", resourceId);
+ startActivity(intent);
}
}
diff --git a/framesequence/src/android/support/rastermill/FrameSequenceDrawable.java b/framesequence/src/android/support/rastermill/FrameSequenceDrawable.java
index cda0cfe..351b8a3 100644
--- a/framesequence/src/android/support/rastermill/FrameSequenceDrawable.java
+++ b/framesequence/src/android/support/rastermill/FrameSequenceDrawable.java
@@ -270,9 +270,6 @@ public class FrameSequenceDrawable extends Drawable implements Animatable, Runna
protected void finalize() throws Throwable {
try {
mFrameSequenceState.destroy();
- if (!mDestroyed) {
- destroy();
- }
} finally {
super.finalize();
}