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

Commit 1320c47a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11111096 from fa492c0d to 24Q1-release

Change-Id: I257a68bed5b8870f2ac675a5c68287362459b56a
parents 02fc267e fa492c0d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ android_ravenwood_libgroup {
        "hoststubgen-helper-framework-runtime.ravenwood",
        "junit",
        "truth",
        "ravenwood-junit",
        "ravenwood-junit-impl",
        "android.test.mock",
    ],
}
+3.41 MiB
Loading image diff...
+43 −0
Original line number Diff line number Diff line
@@ -16,20 +16,29 @@

package android.graphics.perftests;

import static org.junit.Assert.assertTrue;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Color;
import android.graphics.ImageDecoder;
import android.graphics.Paint;
import android.graphics.RecordingCanvas;
import android.graphics.RenderNode;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.LargeTest;

import com.android.perftests.core.R;

import org.junit.Rule;
import org.junit.Test;

import java.io.IOException;

@LargeTest
public class CanvasPerfTest {
    @Rule
@@ -93,4 +102,38 @@ public class CanvasPerfTest {
            node.end(canvas);
        }
    }

    @Test
    public void testCreateScaledBitmap() throws IOException {
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final Context context = InstrumentationRegistry.getContext();
        Bitmap source = ImageDecoder.decodeBitmap(
                ImageDecoder.createSource(context.getResources(), R.drawable.fountain_night),
                (decoder, info, source1) -> {
                    decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE);
                });
        source.setGainmap(null);

        while (state.keepRunning()) {
            Bitmap.createScaledBitmap(source, source.getWidth() / 2, source.getHeight() / 2, true)
                    .recycle();
        }
    }

    @Test
    public void testCreateScaledBitmapWithGainmap() throws IOException {
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final Context context = InstrumentationRegistry.getContext();
        Bitmap source = ImageDecoder.decodeBitmap(
                ImageDecoder.createSource(context.getResources(), R.drawable.fountain_night),
                (decoder, info, source1) -> {
                    decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE);
                });
        assertTrue(source.hasGainmap());

        while (state.keepRunning()) {
            Bitmap.createScaledBitmap(source, source.getWidth() / 2, source.getHeight() / 2, true)
                    .recycle();
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase
                state.addExtraResult("add", elapsedTimeNsOfAdd);

                startTime = SystemClock.elapsedRealtimeNanos();
                session.remove(this);
                session.remove(asBinder());
                final long elapsedTimeNsOfRemove = SystemClock.elapsedRealtimeNanos() - startTime;
                state.addExtraResult("remove", elapsedTimeNsOfRemove);

+32 −0
Original line number Diff line number Diff line
// Copyright (C) 2023 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.

java_binary_host {
    name: "extract-flagged-apis",
    srcs: ["ExtractFlaggedApis.kt"],
    main_class: "android.platform.coverage.ExtractFlaggedApisKt",
    static_libs: [
        "metalava-signature-reader",
        "extract_flagged_apis_proto",
    ],
}

java_library_host {
    name: "extract_flagged_apis_proto",
    srcs: ["extract_flagged_apis.proto"],
    static_libs: ["libprotobuf-java-full"],
    proto: {
        type: "full",
    },
}
Loading