summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java5
-rw-r--r--src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java15
-rw-r--r--src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java9
3 files changed, 27 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 874a7c9..92ce230 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -365,10 +365,14 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
filterBorder.setResources(res);
filterBorder = (ImageFilterBorder) FiltersManager.getPreviewManager().getFilter(ImageFilterBorder.class);
filterBorder.setResources(res);
+ filterBorder = (ImageFilterBorder) FiltersManager.getHighresManager().getFilter(ImageFilterBorder.class);
+ filterBorder.setResources(res);
ImageFilterFx filterFx = (ImageFilterFx) FiltersManager.getManager().getFilter(ImageFilterFx.class);
filterFx.setResources(res);
filterFx = (ImageFilterFx) FiltersManager.getPreviewManager().getFilter(ImageFilterFx.class);
filterFx.setResources(res);
+ filterFx = (ImageFilterFx) FiltersManager.getHighresManager().getFilter(ImageFilterFx.class);
+ filterFx.setResources(res);
ImageShow.setDefaultBackgroundColor(res.getColor(R.color.background_screen));
// TODO: get those values from XML.
@@ -554,6 +558,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
ImageFilter.resetStatics();
FiltersManager.getPreviewManager().freeRSFilterScripts();
FiltersManager.getManager().freeRSFilterScripts();
+ FiltersManager.getHighresManager().freeRSFilterScripts();
FiltersManager.reset();
CachingPipeline.destroyRenderScriptContext();
super.onDestroy();
diff --git a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
index a8c8d7b..a295647 100644
--- a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
+++ b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
@@ -34,12 +34,13 @@ public class FilteringPipeline implements Handler.Callback {
private static final String LOGTAG = "FilteringPipeline";
private boolean DEBUG = false;
- private static long HIRES_DELAY = 100; // in ms
+ private static long HIRES_DELAY = 300; // in ms
private volatile boolean mPipelineIsOn = false;
private CachingPipeline mAccessoryPipeline = null;
private CachingPipeline mPreviewPipeline = null;
+ private CachingPipeline mHighresPreviewPipeline = null;
private HandlerThread mHandlerThread = null;
private final static int NEW_PRESET = 0;
@@ -111,7 +112,11 @@ public class FilteringPipeline implements Handler.Callback {
}
RenderingRequest request = (RenderingRequest) msg.obj;
- mAccessoryPipeline.render(request);
+ if (msg.what == COMPUTE_HIGHRES_RENDERING_REQUEST) {
+ mHighresPreviewPipeline.render(request);
+ } else {
+ mAccessoryPipeline.render(request);
+ }
Message uimsg = mUIHandler.obtainMessage(NEW_RENDERING_REQUEST);
uimsg.obj = request;
mUIHandler.sendMessage(uimsg);
@@ -128,6 +133,7 @@ public class FilteringPipeline implements Handler.Callback {
mProcessingHandler = new Handler(mHandlerThread.getLooper(), this);
mAccessoryPipeline = new CachingPipeline(FiltersManager.getManager(), "Accessory");
mPreviewPipeline = new CachingPipeline(FiltersManager.getPreviewManager(), "Preview");
+ mHighresPreviewPipeline = new CachingPipeline(FiltersManager.getHighresManager(), "Highres");
}
public synchronized static FilteringPipeline getPipeline() {
@@ -145,6 +151,7 @@ public class FilteringPipeline implements Handler.Callback {
Log.v(LOGTAG,"setOriginal, size " + bitmap.getWidth() + " x " + bitmap.getHeight());
mAccessoryPipeline.setOriginal(bitmap);
mPreviewPipeline.setOriginal(bitmap);
+ mHighresPreviewPipeline.setOriginal(bitmap);
}
public void postRenderingRequest(RenderingRequest request) {
@@ -194,16 +201,19 @@ public class FilteringPipeline implements Handler.Callback {
public void setPreviewScaleFactor(float previewScaleFactor) {
mAccessoryPipeline.setPreviewScaleFactor(previewScaleFactor);
mPreviewPipeline.setPreviewScaleFactor(previewScaleFactor);
+ mHighresPreviewPipeline.setPreviewScaleFactor(previewScaleFactor);
}
public void setHighResPreviewScaleFactor(float highResPreviewScaleFactor) {
mAccessoryPipeline.setHighResPreviewScaleFactor(highResPreviewScaleFactor);
mPreviewPipeline.setHighResPreviewScaleFactor(highResPreviewScaleFactor);
+ mHighresPreviewPipeline.setHighResPreviewScaleFactor(highResPreviewScaleFactor);
}
public static synchronized void reset() {
sPipeline.mAccessoryPipeline.reset();
sPipeline.mPreviewPipeline.reset();
+ sPipeline.mHighresPreviewPipeline.reset();
sPipeline.mHandlerThread.quit();
sPipeline = null;
}
@@ -213,6 +223,7 @@ public class FilteringPipeline implements Handler.Callback {
if (mPipelineIsOn) {
assert(mPreviewPipeline.isInitialized());
assert(mAccessoryPipeline.isInitialized());
+ assert(mHighresPreviewPipeline.isInitialized());
updatePreviewBuffer();
}
}
diff --git a/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java b/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java
index 4b6b1d3..910627a 100644
--- a/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java
+++ b/src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java
@@ -22,6 +22,7 @@ import java.util.Vector;
public class FiltersManager extends BaseFiltersManager {
private static FiltersManager sInstance = null;
private static FiltersManager sPreviewInstance = null;
+ private static FiltersManager sHighresInstance = null;
public FiltersManager() {
init();
@@ -41,9 +42,17 @@ public class FiltersManager extends BaseFiltersManager {
return sInstance;
}
+ public static FiltersManager getHighresManager() {
+ if (sHighresInstance == null) {
+ sHighresInstance = new FiltersManager();
+ }
+ return sHighresInstance;
+ }
+
public static void reset() {
sInstance = null;
sPreviewInstance = null;
+ sHighresInstance = null;
}
}