Loading core/jni/android_view_SurfaceControl.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -24,7 +24,9 @@ #include <memory> #include <aidl/android/hardware/graphics/common/PixelFormat.h> #include <android-base/chrono_utils.h> #include <android/graphics/properties.h> #include <android/graphics/region.h> #include <android/gui/BnScreenCaptureListener.h> #include <android/hardware/display/IDeviceProductInfoConstants.h> Loading Loading @@ -1888,6 +1890,11 @@ static jobject nativeGetDisplayDecorationSupport(JNIEnv* env, jclass clazz, return nullptr; } using aidl::android::hardware::graphics::common::PixelFormat; if (support.value().format == PixelFormat::R_8 && !hwui_uses_vulkan()) { return nullptr; } jobject jDisplayDecorationSupport = env->NewObject(gDisplayDecorationSupportInfo.clazz, gDisplayDecorationSupportInfo.ctor); if (jDisplayDecorationSupport == nullptr) { Loading libs/hwui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ cc_defaults { "apex/android_matrix.cpp", "apex/android_paint.cpp", "apex/android_region.cpp", "apex/properties.cpp", ], header_libs: ["android_graphics_apex_headers"], Loading libs/hwui/apex/include/android/graphics/properties.h 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright 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. */ #ifndef ANDROID_GRAPHICS_PROPERTIES_H #define ANDROID_GRAPHICS_PROPERTIES_H #include <cutils/compiler.h> #include <sys/cdefs.h> __BEGIN_DECLS /** * Returns true if libhwui is using the vulkan backend. */ ANDROID_API bool hwui_uses_vulkan(); __END_DECLS #endif // ANDROID_GRAPHICS_PROPERTIES_H libs/hwui/apex/properties.cpp 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * 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. */ #include "android/graphics/properties.h" #include <Properties.h> bool hwui_uses_vulkan() { return android::uirenderer::Properties::peekRenderPipelineType() == android::uirenderer::RenderPipelineType::SkiaVulkan; } libs/hwui/libhwui.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ LIBHWUI { # platform-only /* HWUI isn't current a module, so all of these are st ARegionIterator_next; ARegionIterator_getRect; ARegionIterator_getTotalBounds; hwui_uses_vulkan; local: *; }; Loading Loading
core/jni/android_view_SurfaceControl.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -24,7 +24,9 @@ #include <memory> #include <aidl/android/hardware/graphics/common/PixelFormat.h> #include <android-base/chrono_utils.h> #include <android/graphics/properties.h> #include <android/graphics/region.h> #include <android/gui/BnScreenCaptureListener.h> #include <android/hardware/display/IDeviceProductInfoConstants.h> Loading Loading @@ -1888,6 +1890,11 @@ static jobject nativeGetDisplayDecorationSupport(JNIEnv* env, jclass clazz, return nullptr; } using aidl::android::hardware::graphics::common::PixelFormat; if (support.value().format == PixelFormat::R_8 && !hwui_uses_vulkan()) { return nullptr; } jobject jDisplayDecorationSupport = env->NewObject(gDisplayDecorationSupportInfo.clazz, gDisplayDecorationSupportInfo.ctor); if (jDisplayDecorationSupport == nullptr) { Loading
libs/hwui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ cc_defaults { "apex/android_matrix.cpp", "apex/android_paint.cpp", "apex/android_region.cpp", "apex/properties.cpp", ], header_libs: ["android_graphics_apex_headers"], Loading
libs/hwui/apex/include/android/graphics/properties.h 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright 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. */ #ifndef ANDROID_GRAPHICS_PROPERTIES_H #define ANDROID_GRAPHICS_PROPERTIES_H #include <cutils/compiler.h> #include <sys/cdefs.h> __BEGIN_DECLS /** * Returns true if libhwui is using the vulkan backend. */ ANDROID_API bool hwui_uses_vulkan(); __END_DECLS #endif // ANDROID_GRAPHICS_PROPERTIES_H
libs/hwui/apex/properties.cpp 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * 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. */ #include "android/graphics/properties.h" #include <Properties.h> bool hwui_uses_vulkan() { return android::uirenderer::Properties::peekRenderPipelineType() == android::uirenderer::RenderPipelineType::SkiaVulkan; }
libs/hwui/libhwui.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ LIBHWUI { # platform-only /* HWUI isn't current a module, so all of these are st ARegionIterator_next; ARegionIterator_getRect; ARegionIterator_getTotalBounds; hwui_uses_vulkan; local: *; }; Loading