summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ViewImage.java
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2009-07-20 16:33:41 +0800
committerRay Chen <raychen@google.com>2009-07-29 19:00:13 +0800
commit012d0f38e1fd547436675257c5cd5c62928e2ed5 (patch)
tree884ff5188b25ea36698ac458cdf4e356c91e656c /src/com/android/camera/ViewImage.java
parentb53862357d977643c760c4eaeb0b7dcc841727f6 (diff)
downloadLegacyCamera-012d0f38e1fd547436675257c5cd5c62928e2ed5.zip
LegacyCamera-012d0f38e1fd547436675257c5cd5c62928e2ed5.tar.gz
LegacyCamera-012d0f38e1fd547436675257c5cd5c62928e2ed5.tar.bz2
Defer bitmap rotation until it's drawn on ImageView.
Diffstat (limited to 'src/com/android/camera/ViewImage.java')
-rw-r--r--src/com/android/camera/ViewImage.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java
index 02ef981..6486d2d 100644
--- a/src/com/android/camera/ViewImage.java
+++ b/src/com/android/camera/ViewImage.java
@@ -462,7 +462,9 @@ public class ViewImage extends Activity implements View.OnClickListener {
Bitmap b = mCache.getBitmap(pos);
if (b != null) {
- mImageView.setImageBitmapResetBase(b, true);
+ IImage image = mAllImages.getImageAt(pos);
+ mImageView.setImageRotateBitmapResetBase(
+ new RotateBitmap(b, image.getDegreesRotated()), true);
updateZoomButtonsEnabled();
}
@@ -497,7 +499,7 @@ public class ViewImage extends Activity implements View.OnClickListener {
return sOrderAdjacents;
}
- public void imageLoaded(int pos, int offset, Bitmap bitmap,
+ public void imageLoaded(int pos, int offset, RotateBitmap bitmap,
boolean isThumb) {
// shouldn't get here after onPause()
@@ -508,13 +510,13 @@ public class ViewImage extends Activity implements View.OnClickListener {
}
if (isThumb) {
- mCache.put(pos + offset, bitmap);
+ mCache.put(pos + offset, bitmap.getBitmap());
}
if (offset == 0) {
// isThumb: We always load thumb bitmap first, so we will
// reset the supp matrix for then thumb bitmap, and keep
// the supp matrix when the full bitmap is loaded.
- mImageView.setImageBitmapResetBase(bitmap, isThumb);
+ mImageView.setImageRotateBitmapResetBase(bitmap, isThumb);
updateZoomButtonsEnabled();
}
}
@@ -794,7 +796,7 @@ public class ViewImage extends Activity implements View.OnClickListener {
}
public void imageLoaded(final int pos, final int offset,
- final Bitmap bitmap, final boolean isThumb) {
+ final RotateBitmap bitmap, final boolean isThumb) {
long timeRemaining = Math.max(0,
targetDisplayTime - System.currentTimeMillis());
mHandler.postDelayedGetterCallback(new Runnable() {
@@ -814,7 +816,7 @@ public class ViewImage extends Activity implements View.OnClickListener {
ImageViewTouchBase newView =
mSlideShowImageViews[mSlideShowImageCurrent];
newView.setVisibility(View.VISIBLE);
- newView.setImageBitmapResetBase(bitmap, true);
+ newView.setImageRotateBitmapResetBase(bitmap, true);
newView.bringToFront();
int animation = 0;
@@ -1169,7 +1171,7 @@ class ImageViewTouch extends ImageViewTouchBase {
protected boolean isShiftedToNextImage(boolean left, int maxOffset) {
boolean retval;
- Bitmap bitmap = mBitmapDisplayed;
+ RotateBitmap bitmap = mBitmapDisplayed;
Matrix m = getImageViewMatrix();
if (left) {
float [] t1 = new float[] { 0, 0 };