summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Obregon <robregon@ti.com>2010-11-22 16:52:11 -0600
committerRodrigo Obregon <robregon@ti.com>2010-11-22 17:12:29 -0600
commita6c42e0a9263b19efbc556b5291544ee9e09b0d3 (patch)
tree6e7c908d0a152911587a93b3e08323840531d1bb
parent4b47e1bb8512b46555bc0bb863a72c593dbc3735 (diff)
downloadGallery3D-a6c42e0a9263b19efbc556b5291544ee9e09b0d3.tar.gz
Gallery3D: Add depth component to icon animation
When the Gallery application positions the thumbnails in a GridView, they are placed in the same z-plane. When a configuration change occurs the icons present a z-fighting visual artifact. This patch adds a z component to the thumbnails when they are animated as to mitigate this effect. This is specially noticeable in a GPU architecture using deferred rendering. Change-Id: Icc9bb782b420697f282ed2b10a699b36d09c7abf Signed-off-by: Rodrigo Obregon <robregon@ti.com>
-rw-r--r--src/com/cooliris/media/GridLayer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/cooliris/media/GridLayer.java b/src/com/cooliris/media/GridLayer.java
index 74aff5d..b8c2f75 100644
--- a/src/com/cooliris/media/GridLayer.java
+++ b/src/com/cooliris/media/GridLayer.java
@@ -82,6 +82,7 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
private final LayoutInterface mLayoutInterface;
private static final LayoutInterface sfullScreenLayoutInterface = new GridLayoutInterface(1);
+ private static final float DEPTH_POSITION = 0.55f;
private MediaFeed mMediaFeed;
private boolean mInAlbum = false;
@@ -116,6 +117,7 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
private String mRequestFocusContentUri;
private int mFrameCount;
private boolean mRequestToEnterSelection;
+ private boolean mLayoutChanged = false;
// private ArrayList<Integer> mBreakSlots = new ArrayList<Integer>();
// private ArrayList<Integer> mOldBreakSlots;
@@ -678,6 +680,13 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
displayItem.set(position, j, false);
displayItem.commit();
} else {
+ boolean isTouchPressed = mInputProcessor.touchPressed();
+ boolean isBarDragged = mHud.getTimeBar().isDragged();
+ if (mState == STATE_GRID_VIEW
+ && mLayoutChanged) {
+ displayItem.mAnimatedPosition.add(
+ 0.0f, 0.0f, (i % 5) * DEPTH_POSITION);
+ }
displayList.setPositionAndStackIndex(displayItem, position, j, true);
}
displayItems[baseIndex + j] = displayItem;
@@ -690,6 +699,7 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
bestItems.clear();
}
}
+ mLayoutChanged = false;
if (mFeedChanged) {
mFeedChanged = false;
if (mInputProcessor != null && mState == STATE_FULL_SCREEN && mRequestFocusContentUri == null) {
@@ -872,6 +882,7 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
deltaAnchorPosition.subtract(currentSlotPosition);
deltaAnchorPosition.y = 0;
deltaAnchorPosition.z = 0;
+ mLayoutChanged = true;
}
mDeltaAnchorPositionUncommited.set(deltaAnchorPosition);
} finally {