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

Commit 5857bcea authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Clear the bitmap from the canvas in a lot of places."

parents e10bcdb3 6311d0a0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2503,6 +2503,7 @@ public final class ActivityThread {
                    mAvailThumbnailBitmap = thumbnail;
                    thumbnail = null;
                }
                cv.setBitmap(null);
            }

        } catch (Exception e) {
+2 −0
Original line number Diff line number Diff line
@@ -314,6 +314,7 @@ public abstract class LauncherActivity extends ListActivity {
                    icon.draw(canvas);
                    icon.setBounds(mOldBounds);
                    icon = new BitmapDrawable(getResources(), thumb);
                    canvas.setBitmap(null);
                } else if (iconWidth < width && iconHeight < height) {
                    final Bitmap.Config c = Bitmap.Config.ARGB_8888;
                    final Bitmap thumb = Bitmap.createBitmap(mIconWidth, mIconHeight, c);
@@ -326,6 +327,7 @@ public abstract class LauncherActivity extends ListActivity {
                    icon.draw(canvas);
                    icon.setBounds(mOldBounds);
                    icon = new BitmapDrawable(getResources(), thumb);
                    canvas.setBitmap(null);
                }
            }

+2 −1
Original line number Diff line number Diff line
@@ -10221,6 +10221,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
            }
            canvas.restoreToCount(restoreCount);
            canvas.setBitmap(null);
            if (attachInfo != null) {
                // Restore the cached Canvas for our siblings
@@ -10289,9 +10290,9 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        mPrivateFlags = flags;
        canvas.restoreToCount(restoreCount);
        canvas.setBitmap(null);
        if (attachInfo != null) {
            canvas.setBitmap(null);
            // Restore the cached Canvas for our siblings
            attachInfo.mCanvas = canvas;
        }
+3 −0
Original line number Diff line number Diff line
@@ -1094,6 +1094,9 @@ public class ViewDebug {
                            }

                            public void post(Object... data) {
                                if (data[1] != null) {
                                    ((Canvas) data[1]).setBitmap(null);
                                }
                                if (data[0] != null) {
                                    ((Bitmap) data[0]).recycle();
                                }
+2 −0
Original line number Diff line number Diff line
@@ -1406,6 +1406,7 @@ public class StackView extends AdapterViewAnimator {
            v.setTranslationX(translationX);

            drawOutline(mCanvas, bitmap);
            mCanvas.setBitmap(null);
            return bitmap;
        }

@@ -1417,6 +1418,7 @@ public class StackView extends AdapterViewAnimator {
            dest.drawColor(0, PorterDuff.Mode.CLEAR);
            dest.setMatrix(mIdentityMatrix);
            dest.drawBitmap(mask, xy[0], xy[1], mHolographicPaint);
            mMaskCanvas.setBitmap(null);
            mask.recycle();
        }
    }
Loading