From 20d1b668dbb4d4b2fe8df1ec827c891650adbfb3 Mon Sep 17 00:00:00 2001 From: Peiyong Lin Date: Wed, 3 May 2023 16:44:07 +0000 Subject: [PATCH] Split ANGLE supported and enabled into different Makefiles. ANGLE binaries should be added to the PRODUCT_PACKAGES instead. This patch also splits the angle.mk to angle_supported.mk and angle_default.mk so that when a device just wants to ship ANGLE binaries to coexist with native GLES drivers, it only needs to inherit the angle_supported.mk and when a device wants to ship ANGLE as the default system GLES drivers, it only needs to inherit the angle_default.mk. When ANGLE is the default system GLES driver, make sure persist.graphics.egl is defined so that ANGLE is loaded properly. Bug: 270994705 Test: atest CtsAngleIntegrationHostTestCases Change-Id: I3de4a40b62b39c91c8f6df56d68755830b303f10 --- target/product/angle_default.mk | 23 +++++++++++++++++++ .../product/{angle.mk => angle_supported.mk} | 9 ++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 target/product/angle_default.mk rename target/product/{angle.mk => angle_supported.mk} (71%) diff --git a/target/product/angle_default.mk b/target/product/angle_default.mk new file mode 100644 index 0000000000..bea0be6d53 --- /dev/null +++ b/target/product/angle_default.mk @@ -0,0 +1,23 @@ +# +# Copyright 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. +# + +# To enable ANGLE as the default system GLES drivers, add +# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle_enabled.mk) to the Makefile. + +$(call inherit-product, $(SRC_TARGET_DIR)/product/angle_supported.mk) + +PRODUCT_VENDOR_PROPERTIES += \ + persist.graphics.egl=angle diff --git a/target/product/angle.mk b/target/product/angle_supported.mk similarity index 71% rename from target/product/angle.mk rename to target/product/angle_supported.mk index 0d7f8cb1c0..c83ff5fcb2 100644 --- a/target/product/angle.mk +++ b/target/product/angle_supported.mk @@ -14,13 +14,14 @@ # limitations under the License. # -# To include ANGLE drivers into the build, add -# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle.mk) to the Makefile. +# To include ANGLE into the image build, add +# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle_supported.mk) to the Makefile. +# By default, this will allow ANGLE binaries to coexist with native GLES drivers. -PRODUCT_PACKAGES := \ +PRODUCT_PACKAGES += \ libEGL_angle \ libGLESv1_CM_angle \ libGLESv2_angle # Set ro.gfx.angle.supported based on if ANGLE is installed in vendor partition -PRODUCT_VENDOR_PROPERTIES := ro.gfx.angle.supported=true +PRODUCT_VENDOR_PROPERTIES += ro.gfx.angle.supported=true