summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/imageshow
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-03-22 21:20:03 -0700
committerRuben Brunk <rubenbrunk@google.com>2013-03-22 21:20:03 -0700
commite09b8f4e1d3b2d1fb99e79f07312d06db87f652d (patch)
tree7af5e06b768b172ab852a32923d0bb25917bc2d8 /src/com/android/gallery3d/filtershow/imageshow
parent955e5c57ec592003abea8e6b8f0bc2bfb3e201bc (diff)
downloadandroid_packages_apps_Snap-e09b8f4e1d3b2d1fb99e79f07312d06db87f652d.tar.gz
android_packages_apps_Snap-e09b8f4e1d3b2d1fb99e79f07312d06db87f652d.tar.bz2
android_packages_apps_Snap-e09b8f4e1d3b2d1fb99e79f07312d06db87f652d.zip
Refactoring: removed unnecessary apply calls.
Change-Id: Ic592a00a8487f6a2499c34929b0ec8afad2a73b6
Diffstat (limited to 'src/com/android/gallery3d/filtershow/imageshow')
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/MasterImage.java51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
index 680d1f7d2..993f5d5ec 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
@@ -52,7 +52,6 @@ public class MasterImage implements RenderingRequestCaller {
private Bitmap mGeometryOnlyBitmap = null;
private Bitmap mFiltersOnlyBitmap = null;
private Bitmap mPartialBitmap = null;
- private Bitmap mThumbnailBitmap = null;
private ImageLoader mLoader = null;
private HistoryAdapter mHistory = null;
@@ -402,59 +401,11 @@ public class MasterImage implements RenderingRequestCaller {
public void hasNewGeometry() {
updatePresets(true);
- computeThumbnailBitmap();
for (GeometryListener listener : mGeometryListeners) {
listener.geometryChanged();
}
}
- private Bitmap createSquareImage(Bitmap dst, Bitmap image, Rect destination) {
- if (image != null) {
- Canvas canvas = new Canvas(dst);
- int iw = image.getWidth();
- int ih = image.getHeight();
- int x = 0;
- int y = 0;
- int size = 0;
- Rect source = null;
- if (iw > ih) {
- size = ih;
- x = (int) ((iw - size) / 2.0f);
- y = 0;
- } else {
- size = iw;
- x = 0;
- y = (int) ((ih - size) / 2.0f);
- }
- source = new Rect(x, y, x + size, y + size);
- canvas.drawBitmap(image, source, destination, new Paint());
- }
- return dst;
- }
-
- public void computeThumbnailBitmap() {
- Bitmap bmap = mLoader.getOriginalBitmapSmall();
- if (bmap == null) {
- return;
- }
- ImagePreset geoPreset = new ImagePreset(MasterImage.getImage().getGeometryPreset());
- geoPreset.setupEnvironment();
- bmap = geoPreset.applyGeometry(bmap);
- float w = bmap.getWidth();
- float h = bmap.getHeight();
- float s = Math.min(w, h);
- float f = sIconSeedSize / s;
- w = w * f;
- h = h * f;
- s = Math.min(w, h);
- Bitmap bmap2 = Bitmap.createScaledBitmap(bmap, (int) s, (int) s, true);
- bmap = createSquareImage(bmap2, bmap, new Rect(0, 0, (int) s, (int) s));
- if (DEBUG) {
- Log.v(LOGTAG, "Create thumbnail of size " + bmap.getWidth() + " x " + bmap.getHeight()
- + " seed size: " + sIconSeedSize);
- }
- mThumbnailBitmap = bmap;
- }
public float getScaleFactor() {
return mScaleFactor;
@@ -494,7 +445,7 @@ public class MasterImage implements RenderingRequestCaller {
}
public Bitmap getThumbnailBitmap() {
- return mThumbnailBitmap;
+ return mLoader.getOriginalBitmapSmall();
}
public float getMaxScaleFactor() {