summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-04-17 08:37:22 -0700
committernicolasroard <nicolasroard@google.com>2013-04-17 08:42:42 -0700
commit6698821d6dd80f2e2a6615d4ab4806b241f7a30e (patch)
tree1da54558ecec89013cf25c6137ac7ee79305e561 /src
parent219cbae90daf14c17d715489e94148b21448e5db (diff)
downloadandroid_packages_apps_Snap-6698821d6dd80f2e2a6615d4ab4806b241f7a30e.tar.gz
android_packages_apps_Snap-6698821d6dd80f2e2a6615d4ab4806b241f7a30e.tar.bz2
android_packages_apps_Snap-6698821d6dd80f2e2a6615d4ab4806b241f7a30e.zip
Fix border apply if no filter applied
Change-Id: Ic5b319625b42adb298094c4ad202d6c161538644
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/presets/ImagePreset.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
index bd2f494cd..48975a1e8 100644
--- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
@@ -457,6 +457,10 @@ public class ImagePreset {
return bitmap;
}
+ public int nbFilters() {
+ return mFilters.size();
+ }
+
public Bitmap applyFilters(Bitmap bitmap, int from, int to, FilterEnvironment environment) {
if (mDoApplyFilters) {
if (from < 0) {
@@ -478,17 +482,23 @@ public class ImagePreset {
return bitmap;
}
- public void applyBorder(Allocation in, Allocation out, FilterEnvironment environment) {
+ public void applyBorder(Allocation in, Allocation out,
+ boolean copyOut, FilterEnvironment environment) {
if (mBorder != null && mDoApplyGeometry) {
mBorder.synchronizeRepresentation();
// TODO: should keep the bitmap around
- Allocation bitmapIn = Allocation.createTyped(CachingPipeline.getRenderScriptContext(), in.getType());
- bitmapIn.copyFrom(out);
+ Allocation bitmapIn = in;
+ if (copyOut) {
+ bitmapIn = Allocation.createTyped(
+ CachingPipeline.getRenderScriptContext(), in.getType());
+ bitmapIn.copyFrom(out);
+ }
environment.applyRepresentation(mBorder, bitmapIn, out);
}
}
- public void applyFilters(int from, int to, Allocation in, Allocation out, FilterEnvironment environment) {
+ public void applyFilters(int from, int to, Allocation in, Allocation out,
+ FilterEnvironment environment) {
if (mDoApplyFilters) {
if (from < 0) {
from = 0;