summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorhuiyan <huiyan@codeaurora.org>2016-05-25 17:20:02 +0800
committerLikai Ding <likaid@codeaurora.org>2016-06-14 14:55:17 +0800
commit84087c05602f1de2c35cd329c1defc5e25003aa7 (patch)
treed49b3198c59ffb59822f4e7dd3effa3c6b9d7321 /src/com
parent2b08697bfefadf0cac06b109d2cf07ae35e37ec8 (diff)
downloadandroid_packages_apps_Gallery2-84087c05602f1de2c35cd329c1defc5e25003aa7.tar.gz
android_packages_apps_Gallery2-84087c05602f1de2c35cd329c1defc5e25003aa7.tar.bz2
android_packages_apps_Gallery2-84087c05602f1de2c35cd329c1defc5e25003aa7.zip
Gallery2: Fix the picture display error after doing rotate operation.
After rotating the image, use previous canvas to draw the new content, but the canvas is not erased the previous content before using to draw. So if the format of the image is png which alpha is set, the previous content can be seen by the transparent part. Before drawing the new content, the canvas erase the previous content to make the canvas clean. Change-Id: I9f5c3196eed28470673d90d02ce9fdc3fca62727 CRs-Fixed: 996568
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java b/src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java
index f236675df..c3a517c66 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java
@@ -18,6 +18,7 @@ package com.android.gallery3d.filtershow.imageshow;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
@@ -319,6 +320,7 @@ public final class GeometryMathUtils {
BitmapCache bitmapCache = MasterImage.getImage().getBitmapCache();
Bitmap temp = bitmapCache.getBitmap(frame.width(),
frame.height(), BitmapCache.UTIL_GEOMETRY);
+ temp.eraseColor(Color.TRANSPARENT);
Canvas canvas = new Canvas(temp);
Paint paint = new Paint();
paint.setAntiAlias(true);