aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXusong Wang <xusongw@google.com>2022-03-30 18:14:20 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-30 18:14:20 +0000
commit1c845a7e173db5e7a410e2aeaa7f063946396974 (patch)
tree2d937e148884937fb0ec1002899ae8343277e984
parentf34d06204783bb64ab4fe39c1a7e99122bbbff08 (diff)
parentd668e127f35ceb98f9b185abff402dfe999fba42 (diff)
downloadrenderscript-intrinsics-replacement-toolkit-1c845a7e173db5e7a410e2aeaa7f063946396974.tar.gz
Merge "Add build rules for renderscript toolkit." am: 06307d9d7f am: d668e127f3
Original change: https://android-review.googlesource.com/c/platform/external/renderscript-intrinsics-replacement-toolkit/+/2046496 Change-Id: I7b3ac751c8a0cb038f4a2eacd4b6416e703abe46 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp46
-rw-r--r--renderscript-toolkit/src/main/cpp/Android.bp105
2 files changed, 151 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..79cb861
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_library {
+ name: "renderscript_toolkit",
+ sdk_version: "current",
+ min_sdk_version: "14",
+ srcs: [
+ "renderscript-toolkit/src/main/java/**/*.kt",
+ ],
+ manifest: "renderscript-toolkit/src/main/AndroidManifest.xml",
+}
+
+android_app {
+ name: "renderscript_toolkit_test_app",
+ sdk_version: "current",
+ min_sdk_version: "21",
+ srcs: ["test-app/src/main/java/**/*.kt"],
+ jni_libs: ["librenderscript-toolkit"],
+ manifest: "test-app/src/main/AndroidManifest.xml",
+ resource_dirs: ["test-app/src/main/res"],
+ static_libs: [
+ "androidx.appcompat_appcompat",
+ "androidx.core_core-ktx",
+ "com.google.android.material_material",
+ "renderscript_toolkit",
+ ],
+ use_embedded_native_libs: true,
+}
diff --git a/renderscript-toolkit/src/main/cpp/Android.bp b/renderscript-toolkit/src/main/cpp/Android.bp
new file mode 100644
index 0000000..9acad4f
--- /dev/null
+++ b/renderscript-toolkit/src/main/cpp/Android.bp
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+cc_defaults {
+ name: "renderscripttoolkit_native_defaults",
+ sdk_version: "current",
+ static_libs: [
+ "cpufeatures",
+ ],
+ shared_libs: [
+ "libjnigraphics",
+ "liblog",
+ ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ "-Wno-unused-parameter",
+ "-Wno-unused-variable",
+ "-Wthread-safety",
+ ],
+ stl: "libc++_static",
+}
+
+cc_library_static {
+ name: "librenderscripttoolkit_native_static",
+ defaults: ["renderscripttoolkit_native_defaults"],
+ srcs: [
+ "Blend.cpp",
+ "Blur.cpp",
+ "ColorMatrix.cpp",
+ "Convolve3x3.cpp",
+ "Convolve5x5.cpp",
+ "Histogram.cpp",
+ "Lut.cpp",
+ "Lut3d.cpp",
+ "RenderScriptToolkit.cpp",
+ "Resize.cpp",
+ "TaskProcessor.cpp",
+ "Utils.cpp",
+ "YuvToRgb.cpp",
+ ],
+ arch: {
+ arm64: {
+ cflags: [
+ "-DARCH_ARM64_HAVE_NEON",
+ "-DARCH_ARM64_USE_INTRINSICS",
+ "-DARCH_ARM_USE_INTRINSICS",
+ ],
+ srcs: [
+ "Blend_advsimd.S",
+ "Blur_advsimd.S",
+ "ColorMatrix_advsimd.S",
+ "Convolve_advsimd.S",
+ "Lut3d_advsimd.S",
+ "Resize_advsimd.S",
+ "YuvToRgb_advsimd.S",
+ ],
+ },
+ arm: {
+ cflags: [
+ "-DARCH_ARM_HAVE_VFP",
+ "-DARCH_ARM_USE_INTRINSICS",
+ ],
+ srcs: [
+ "Blend_neon.S",
+ "Blur_neon.S",
+ "ColorMatrix_neon.S",
+ "Convolve_neon.S",
+ "Lut3d_neon.S",
+ "Resize_neon.S",
+ "YuvToRgb_neon.S",
+ ],
+ asflags: ["-mfpu=neon"],
+ neon: {
+ cflags: [
+ "-DARCH_ARM_HAVE_NEON",
+ ],
+ },
+ },
+ },
+}
+
+cc_library_shared {
+ name: "librenderscript-toolkit",
+ defaults: ["renderscripttoolkit_native_defaults"],
+ srcs: ["JniEntryPoints.cpp"],
+ static_libs: [
+ "librenderscripttoolkit_native_static",
+ ],
+ header_libs: ["jni_headers"],
+}