summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-02-13 11:40:52 -0800
committerJohn Hoford <hoford@google.com>2013-02-13 13:04:07 -0800
commitda7b84da52579cc967816e11f10acd9d9b3c714b (patch)
tree6e873673476a87bbbb12077becd11ac91d9bda64 /src/com/android/gallery3d/filtershow/filters
parentc81c9a87075e89acb940ff6cb1293b48ac7b1cb0 (diff)
downloadandroid_packages_apps_Snap-da7b84da52579cc967816e11f10acd9d9b3c714b.tar.gz
android_packages_apps_Snap-da7b84da52579cc967816e11f10acd9d9b3c714b.tar.bz2
android_packages_apps_Snap-da7b84da52579cc967816e11f10acd9d9b3c714b.zip
fix draw to support rotation/crop
Change-Id: Iea1db9e42f1fa2b86a452bf1d40b1663b69d03e2
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
index 9fa4ce97e..4b21d3595 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
@@ -27,6 +27,7 @@ import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.Rect;
import android.util.Log;
import com.android.gallery3d.R;
@@ -266,13 +267,12 @@ public class ImageFilterDraw extends ImageFilter {
public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
- short[] rect = new short[4];
-
- Matrix m = new Matrix();
- m.setScale(scaleFactor, scaleFactor);
+ ImagePreset imgPreset = getImagePreset();
+ Rect bounds = imgPreset.getImageLoader().getOriginalBounds();
+ Matrix m = imgPreset.mGeoData.getOriginalToScreen(true,
+ bounds.width(),
+ bounds.height(), w, h);
drawData(new Canvas(bitmap), m, quality);
-
-
return bitmap;
}