From 1ad3cd574da4e998e55e4ff4861ff19e2ea982bd Mon Sep 17 00:00:00 2001 From: nicolasroard Date: Sat, 30 Mar 2013 12:08:58 -0700 Subject: [PATCH] Fixes some state synchronization issues Change-Id: Iea0f2b8d9c885795bddfb0d3001c8a351caed63c --- .../android/gallery3d/filtershow/cache/FilteringPipeline.java | 9 +++------ .../gallery3d/filtershow/filters/FilterRepresentation.java | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java index ce66b5bce..a8c8d7b47 100644 --- a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java +++ b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java @@ -105,12 +105,6 @@ public class FilteringPipeline implements Handler.Callback { case COMPUTE_RENDERING_REQUEST: case COMPUTE_PARTIAL_RENDERING_REQUEST: case COMPUTE_HIGHRES_RENDERING_REQUEST: { - if (msg.what == COMPUTE_PARTIAL_RENDERING_REQUEST - || msg.what == COMPUTE_HIGHRES_RENDERING_REQUEST) { - if (mProcessingHandler.hasMessages(msg.what)) { - return false; - } - } if (DEBUG) { Log.v(LOGTAG, "Compute Request: " + getType(msg.what)); @@ -168,6 +162,9 @@ public class FilteringPipeline implements Handler.Callback { msg.obj = request; if (type == COMPUTE_PARTIAL_RENDERING_REQUEST || type == COMPUTE_HIGHRES_RENDERING_REQUEST) { + if (mProcessingHandler.hasMessages(msg.what)) { + mProcessingHandler.removeMessages(msg.what); + } mProcessingHandler.sendMessageDelayed(msg, HIRES_DELAY); } else { mProcessingHandler.sendMessage(msg); diff --git a/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java index b92460d99..7e0e25d61 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java @@ -63,7 +63,8 @@ public class FilterRepresentation implements Cloneable { representation.setShowEditingControls(showEditingControls()); representation.setShowParameterValue(showParameterValue()); representation.setShowUtilityPanel(showUtilityPanel()); - representation.mTempRepresentation = null; + representation.mTempRepresentation = + mTempRepresentation != null ? mTempRepresentation.clone() : null; if (DEBUG) { Log.v(LOGTAG, "cloning from <" + this + "> to <" + representation + ">"); } -- 2.11.0