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

Commit 2d1eb2b9 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Remove DisplayListCanvas

Bug: 152983829
Bug: 119066174
Test: make; flash and boot

This was already renamed to RecordingCanvas, which is in the graphics
package. It was revived in the old location to temporarily support apps
that were relying on the old name. Currently go/nonsdk-dash shows no
usages, neither via runtime logging nor via static analysis.

RecordingCanvas also cannot refer to this hidden class in the view
package once graphics is its own mainline module. Remove the hidden
class, which was the original plan anyway.

Restore RecordingCanvas' constructor back to private, since it had been
changed to protected as part of the revived DisplayListCanvas.

Change-Id: I7ae1fa043811e361efa6c28753a92bb9c30a7198
parent c8d49eff
Loading
Loading
Loading
Loading
+0 −54
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view;

import android.compat.annotation.UnsupportedAppUsage;
import android.graphics.BaseRecordingCanvas;
import android.graphics.CanvasProperty;
import android.graphics.Paint;

/**
 * This class exists temporarily to workaround broken apps
 *
 * b/119066174
 *
 * @hide
 */
public abstract class DisplayListCanvas extends BaseRecordingCanvas {

    /** @hide */
    protected DisplayListCanvas(long nativeCanvas) {
        super(nativeCanvas);
    }

    /**
     * TODO: Public API alternative
     * @hide
     */
    @UnsupportedAppUsage
    public abstract void drawRoundRect(CanvasProperty<Float> left, CanvasProperty<Float> top,
            CanvasProperty<Float> right, CanvasProperty<Float> bottom, CanvasProperty<Float> rx,
            CanvasProperty<Float> ry, CanvasProperty<Paint> paint);

    /**
     * TODO: Public API alternative
     * @hide
     */
    @UnsupportedAppUsage
    public abstract void drawCircle(CanvasProperty<Float> cx, CanvasProperty<Float> cy,
            CanvasProperty<Float> radius, CanvasProperty<Paint> paint);
}
+2 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.graphics;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.Pools.SynchronizedPool;
import android.view.DisplayListCanvas;
import android.view.TextureLayer;

import dalvik.annotation.optimization.CriticalNative;
@@ -35,7 +34,7 @@ import dalvik.annotation.optimization.FastNative;
 * {@link RenderNode#endRecording()} is called. It must not be retained beyond that as it is
 * internally reused.
 */
public final class RecordingCanvas extends DisplayListCanvas {
public final class RecordingCanvas extends BaseRecordingCanvas {
    // The recording canvas pool should be large enough to handle a deeply nested
    // view hierarchy because display lists are generated recursively.
    private static final int POOL_LIMIT = 25;
@@ -90,8 +89,7 @@ public final class RecordingCanvas extends DisplayListCanvas {
    // Constructors
    ///////////////////////////////////////////////////////////////////////////

    /** @hide */
    protected RecordingCanvas(@NonNull RenderNode node, int width, int height) {
    private RecordingCanvas(@NonNull RenderNode node, int width, int height) {
        super(nCreateDisplayListCanvas(node.mNativeRenderNode, width, height));
        mDensity = 0; // disable bitmap density scaling
    }