From fbc9d0928516bff8dd55cccdfff585807e84d4b8 Mon Sep 17 00:00:00 2001 From: huiyan Date: Wed, 25 May 2016 17:20:02 +0800 Subject: 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 --- src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java b/src/com/android/gallery3d/filtershow/imageshow/GeometryMathUtils.java index 614b6485d..60948272e 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); -- cgit v1.2.3