Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 70f5ba08 authored by huiyan's avatar huiyan Committed by Michael Bestas
Browse files

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
parent c98dcb8d
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.gallery3d.filtershow.imageshow;


import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Rect;
@@ -319,6 +320,7 @@ public final class GeometryMathUtils {
        BitmapCache bitmapCache = MasterImage.getImage().getBitmapCache();
        BitmapCache bitmapCache = MasterImage.getImage().getBitmapCache();
        Bitmap temp = bitmapCache.getBitmap(frame.width(),
        Bitmap temp = bitmapCache.getBitmap(frame.width(),
                frame.height(), BitmapCache.UTIL_GEOMETRY);
                frame.height(), BitmapCache.UTIL_GEOMETRY);
        temp.eraseColor(Color.TRANSPARENT);
        Canvas canvas = new Canvas(temp);
        Canvas canvas = new Canvas(temp);
        Paint paint = new Paint();
        Paint paint = new Paint();
        paint.setAntiAlias(true);
        paint.setAntiAlias(true);