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

Commit 26caa0f5 authored by John Reck's avatar John Reck
Browse files

Use public APIs instead of private ones

Test: builds
Change-Id: I4a8f289a1ac2ee6819bde5cd7c8edb98184c3c27
parent 4603406a
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -21,13 +21,11 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.GraphicBuffer;
import android.graphics.Picture;
import android.os.Bundle;
import android.os.Handler;
import android.os.IRemoteCallback;
import android.os.RemoteException;
import android.view.DisplayListCanvas;
import android.view.RenderNode;
import android.view.ThreadedRenderer;
import android.view.View;

import java.util.function.Consumer;
@@ -108,12 +106,10 @@ public class RecentsTransition {
     *         null if we were unable to allocate a hardware bitmap.
     */
    public static Bitmap createHardwareBitmap(int width, int height, Consumer<Canvas> consumer) {
        RenderNode node = RenderNode.create("RecentsTransition", null);
        node.setLeftTopRightBottom(0, 0, width, height);
        node.setClipToBounds(false);
        DisplayListCanvas c = node.start(width, height);
        consumer.accept(c);
        node.end(c);
        return ThreadedRenderer.createHardwareBitmap(node, width, height);
        final Picture picture = new Picture();
        final Canvas canvas = picture.beginRecording(width, height);
        consumer.accept(canvas);
        picture.endRecording();
        return Bitmap.createBitmap(picture);
    }
}