summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/pipeline')
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/Buffer.java4
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java8
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java2
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java12
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java4
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java2
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java5
7 files changed, 24 insertions, 13 deletions
diff --git a/src/com/android/gallery3d/filtershow/pipeline/Buffer.java b/src/com/android/gallery3d/filtershow/pipeline/Buffer.java
index c378eb994..a487a5d8d 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/Buffer.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/Buffer.java
@@ -18,8 +18,8 @@ package com.android.gallery3d.filtershow.pipeline;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.RenderScript;
+import android.renderscript.Allocation;
+import android.renderscript.RenderScript;
import android.util.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
import com.android.gallery3d.filtershow.imageshow.MasterImage;
diff --git a/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java b/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java
index 8ae9a7c7b..06ce9e9df 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java
@@ -24,8 +24,9 @@ import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.RenderScript;
+
+import android.renderscript.Allocation;
+import android.renderscript.RenderScript;
import android.util.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
@@ -175,6 +176,9 @@ public class CachingPipeline implements PipelineInterface {
}
public void setOriginal(Bitmap bitmap) {
+ if (mOriginalBitmap != null) {
+ mOriginalBitmap.recycle();
+ }
mOriginalBitmap = bitmap;
Log.v(LOGTAG,"setOriginal, size " + bitmap.getWidth() + " x " + bitmap.getHeight());
ImagePreset preset = MasterImage.getImage().getPreset();
diff --git a/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java b/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java
index ebf83b720..0b84f5203 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java
@@ -18,7 +18,7 @@ package com.android.gallery3d.filtershow.pipeline;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
import com.android.gallery3d.app.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
index 4765a5990..1460ad434 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
@@ -18,7 +18,7 @@ package com.android.gallery3d.filtershow.pipeline;
import android.graphics.Bitmap;
import android.graphics.Rect;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
import android.util.JsonReader;
import android.util.JsonWriter;
import android.util.Log;
@@ -67,9 +67,11 @@ public class ImagePreset {
}
public ImagePreset(ImagePreset source) {
- for (int i = 0; i < source.mFilters.size(); i++) {
- FilterRepresentation sourceRepresentation = source.mFilters.elementAt(i);
- mFilters.add(sourceRepresentation.copy());
+ if (source != null && source.mFilters != null) {
+ for (int i = 0; i < source.mFilters.size(); i++) {
+ FilterRepresentation sourceRepresentation = source.mFilters.elementAt(i);
+ mFilters.add(sourceRepresentation.copy());
+ }
}
}
@@ -237,7 +239,7 @@ public class ImagePreset {
FilterRepresentation a = preset.mFilters.elementAt(i);
FilterRepresentation b = mFilters.elementAt(i);
- if (!a.same(b)) {
+ if (!a.equals(b)) {
return false;
}
}
diff --git a/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java b/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java
index d53768c95..ad59e0c44 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java
@@ -18,8 +18,8 @@ package com.android.gallery3d.filtershow.pipeline;
import android.content.res.Resources;
import android.graphics.Bitmap;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.RenderScript;
+import android.renderscript.Allocation;
+import android.renderscript.RenderScript;
public interface PipelineInterface {
public String getName();
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java b/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java
index e5736d43c..e334e8798 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ProcessingService.java
@@ -304,12 +304,14 @@ public class ProcessingService extends Service {
filtersManager.addBorders(this);
filtersManager.addTools(this);
filtersManager.addEffects();
+ filtersManager.addMakeups(this);
FiltersManager highresFiltersManager = FiltersManager.getHighresManager();
highresFiltersManager.addLooks(this);
highresFiltersManager.addBorders(this);
highresFiltersManager.addTools(this);
highresFiltersManager.addEffects();
+// highresFiltersManager.addMakeups(this);
}
private void tearDownPipeline() {
diff --git a/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java b/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java
index 61ee8eb71..a55abca3d 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java
@@ -57,8 +57,11 @@ public class UpdatePreviewTask extends ProcessingTask {
SharedBuffer buffer = MasterImage.getImage().getPreviewBuffer();
SharedPreset preset = MasterImage.getImage().getPreviewPreset();
ImagePreset renderingPreset = preset.dequeuePreset();
- if (renderingPreset != null) {
+ if ( (buffer != null) && (renderingPreset != null)) {
mPreviewPipeline.compute(buffer, renderingPreset, 0);
+ if ( buffer.getProducer() == null) {
+ return null;
+ }
// set the preset we used in the buffer for later inspection UI-side
buffer.getProducer().setPreset(renderingPreset);
buffer.getProducer().sync();