diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-19 14:46:17 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-19 14:47:40 -0700 |
commit | f024156f35ecfe1c8104eb871b27ae7ce3dca669 (patch) | |
tree | d21709a2802363275e7181dd909aaf173666363e /src/com/android/gallery3d/filtershow | |
parent | f3c6bd763c84f5a99f57dffe38a345514583dfb1 (diff) | |
download | android_packages_apps_Snap-f024156f35ecfe1c8104eb871b27ae7ce3dca669.tar.gz android_packages_apps_Snap-f024156f35ecfe1c8104eb871b27ae7ce3dca669.tar.bz2 android_packages_apps_Snap-f024156f35ecfe1c8104eb871b27ae7ce3dca669.zip |
Fix some startup issues, performance issues on ICS
Change-Id: Iccbcc5a78bf4feb5614e1c420022ef8440606baf
Diffstat (limited to 'src/com/android/gallery3d/filtershow')
3 files changed, 19 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index aa7aa7123..1e8485387 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -489,6 +489,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, float previewScale = (float) largeBitmap.getWidth() / (float) mImageLoader.getOriginalBounds().width(); pipeline.setPreviewScaleFactor(previewScale); + pipeline.turnOnPipeline(true); MasterImage.getImage().setOriginalGeometry(largeBitmap); mLoadBitmapTask = null; @@ -497,7 +498,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, } else if (mAction == TINY_PLANET_ACTION) { mPanelController.showComponent(findViewById(EditorTinyPlanet.ID)); } - pipeline.turnOnPipeline(true); super.onPostExecute(result); } diff --git a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java index a1845d6f7..c3d049fbd 100644 --- a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java +++ b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java @@ -182,6 +182,9 @@ public class FilteringPipeline implements Handler.Callback { if (mOriginalAllocation == null) { return; } + if (!mPipelineIsOn) { + return; + } int type = COMPUTE_RENDERING_REQUEST; if (request.getType() == RenderingRequest.PARTIAL_RENDERING) { type = COMPUTE_PARTIAL_RENDERING_REQUEST; @@ -331,7 +334,7 @@ public class FilteringPipeline implements Handler.Callback { time = System.currentTimeMillis() - time; time2 = System.currentTimeMillis() - time2; if (DEBUG) { - Log.v(LOGTAG, "Applying " + type + " filters to bitmap " + Log.v(LOGTAG, "Applying type " + type + " filters to bitmap " + bitmap + " (" + bitmap.getWidth() + " x " + bitmap.getHeight() + ") took " + time + " ms, " + time2 + " ms for the filter, on thread " + thread); } diff --git a/src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java b/src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java index b64cf567e..90099939a 100644 --- a/src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java +++ b/src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java @@ -181,19 +181,27 @@ public class GeometryMetadata extends FilterRepresentation { return mPhotoBounds.contains(cropBounds); } + private boolean compareRectF(RectF a, RectF b) { + return ((int) a.left == (int) b.left) + && ((int) a.right == (int) b.right) + && ((int) a.top == (int) b.top) + && ((int) a.bottom == (int) b.bottom); + } + @Override public boolean equals(FilterRepresentation o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) + if (o == null || !(o instanceof GeometryMetadata)) return false; GeometryMetadata d = (GeometryMetadata) o; - return (mScaleFactor == d.mScaleFactor && - mRotation == d.mRotation && - mStraightenRotation == d.mStraightenRotation && - mFlip == d.mFlip && - mCropBounds.equals(d.mCropBounds) && mPhotoBounds.equals(d.mPhotoBounds)); + return (mScaleFactor == d.mScaleFactor + && mRotation == d.mRotation + && mStraightenRotation == d.mStraightenRotation + && mFlip == d.mFlip + && compareRectF(mCropBounds, d.mCropBounds) + && compareRectF(mPhotoBounds, d.mPhotoBounds)); } @Override |