Files
frameworks_base/packages/SystemUI/screenshot/Android.bp
Jordan Demeulenaere 170bf9e812 Render View into Bitmap using hardware acceleration (1/2)
This CLs switches the screenshot tests to render using hardware
rendering rather than software rendering. The reason for this is that
some features are not supported in software rendering (like clipping to
an outline).

Even though hardware rendering are not meant to be 100% deterministic
(e.g. shadows and ripples), I'd like us to try to still go for
pixel-perfect matching of screenshots whenever possible, especially
given that we don't really care about testing things like
shadows/elevation. In the future, we might either use software rendering
or more lenient matchers in case we want to test some UIs that are
impossible to make deterministic.

Because the AndroidX View.captureToBitmap() API unfortunately does not
work for dialogs (see b/195673633), I had to fork ViewCapture.kt and
WindowCapture.kt to ensure that we use the correct window we are sending
over to PixelCopy for the hardware rendering.

Bug: 230832101
Test: atest SystemUIGoogleScreenshotTests
Change-Id: I8cb6398c0c446b754d5c1af27296a18d53ce738e
2022-07-18 16:43:44 +02:00

46 lines
1.4 KiB
Plaintext

// Copyright (C) 2022 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 {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_base_packages_SystemUI_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["frameworks_base_packages_SystemUI_license"],
}
android_library {
name: "SystemUIScreenshotLib",
manifest: "AndroidManifest.xml",
srcs: [
"src/**/*.kt",
],
resource_dirs: [
"res",
],
static_libs: [
"SystemUI-core",
"androidx.test.espresso.core",
"androidx.appcompat_appcompat",
"platform-screenshot-diff-core",
"guava",
],
kotlincflags: ["-Xjvm-default=all"],
}