Commit 7098cff5 by Jamie Madill Committed by Commit Bot

Make BUILD.gn targets into templates.

This allows us to "globally" add and remove certain configs as long as we use the new templates. This simplifies the logic of adding configs for stuff like extra warnings and default include dirs. As well it simplifies removing certain common unwanted configs. Generally simplifies the logic in BUILD.gn. Will allow for easily suppressing the clang-plugins config instead of using a global setting in .gn. Then we can enable the additional warnings config-by-config. Also fixes some warnings that turned up after we enabled the extra warnings config in our tests. Also moves the dEQP tests main to be consistent with the other test main files. Bug: angleproject:3069 Change-Id: I5a8166cd0f5a7926822c171fcaf473fc86b3ffc1 Reviewed-on: https://chromium-review.googlesource.com/c/1409871 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent c8be560b
......@@ -152,22 +152,14 @@ if (is_win && target_cpu != "arm64") {
}
}
angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ]
# Holds the shared includes so we only need to list them once.
source_set("includes") {
angle_source_set("includes") {
sources = libangle_includes
}
static_library("preprocessor") {
angle_static_library("preprocessor") {
sources = angle_preprocessor_sources
configs -= angle_undefine_configs
configs += [
":extra_warnings",
":internal_config",
]
public_deps = [
":angle_common",
]
......@@ -196,25 +188,16 @@ config("angle_common_config") {
}
}
source_set("angle_system_utils") {
angle_source_set("angle_system_utils") {
sources = angle_system_utils_sources
configs -= angle_undefine_configs
configs += [
":extra_warnings",
":internal_config",
]
}
static_library("angle_common") {
angle_static_library("angle_common") {
sources = libangle_common_sources
configs -= angle_undefine_configs
configs += [
":angle_common_config",
":debug_annotations_config",
":extra_warnings",
":internal_config",
]
public_deps = [
......@@ -222,7 +205,7 @@ static_library("angle_common") {
":angle_version",
":includes",
]
public_configs = [ ":angle_common_config" ]
public_configs += [ ":angle_common_config" ]
all_dependent_configs = [ ":angle_release_asserts_config" ]
}
......@@ -233,17 +216,9 @@ config("angle_image_util_config") {
]
}
static_library("angle_image_util") {
angle_static_library("angle_image_util") {
sources = libangle_image_util_sources
configs -= angle_undefine_configs
configs += [
":internal_config",
":extra_warnings",
]
public_configs = [ ":angle_image_util_config" ]
public_configs += [ ":angle_image_util_config" ]
public_deps = [
":angle_common",
]
......@@ -270,19 +245,11 @@ config("angle_gpu_info_util_config") {
]
}
static_library("angle_gpu_info_util") {
configs -= angle_undefine_configs
configs += [
":internal_config",
":extra_warnings",
]
public_configs = [ ":angle_gpu_info_util_config" ]
angle_static_library("angle_gpu_info_util") {
public_configs += [ ":angle_gpu_info_util_config" ]
public_deps = [
":angle_common",
]
sources = libangle_gpu_info_util_sources
deps = []
libs = []
......@@ -329,7 +296,7 @@ static_library("angle_gpu_info_util") {
}
}
static_library("translator") {
angle_static_library("translator") {
sources = angle_translator_sources
defines = []
......@@ -353,12 +320,7 @@ static_library("translator") {
defines += [ "ANGLE_ENABLE_VULKAN" ]
}
configs -= angle_undefine_configs
configs += [
":internal_config",
":extra_warnings",
]
public_configs = [ ":external_config" ]
public_configs += [ ":external_config" ]
if (use_fuzzing_engine) {
all_dependent_configs = [ ":translator_disable_pool_alloc" ]
}
......@@ -379,7 +341,7 @@ static_library("translator") {
}
}
source_set("translator_fuzzer") {
angle_source_set("translator_fuzzer") {
sources = [
"src/compiler/fuzz/translator_fuzzer.cpp",
]
......@@ -432,7 +394,7 @@ if (angle_use_commit_id) {
}
}
source_set("angle_version") {
angle_source_set("angle_version") {
sources = [
"src/common/version.h",
]
......@@ -511,7 +473,7 @@ if (angle_enable_vulkan) {
}
}
static_library("libANGLE") {
angle_static_library("libANGLE") {
sources = libangle_sources
include_dirs = []
......@@ -623,15 +585,8 @@ static_library("libANGLE") {
defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
}
configs -= angle_undefine_configs
configs += [
":debug_annotations_config",
":extra_warnings",
":internal_config",
]
public_configs = [ ":libANGLE_config" ]
configs += [ ":debug_annotations_config" ]
public_configs += [ ":libANGLE_config" ]
# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
......@@ -671,33 +626,17 @@ config("angle_static") {
]
}
shared_library("libGLESv2${angle_libs_suffix}") {
angle_shared_library("libGLESv2${angle_libs_suffix}") {
sources = libglesv2_sources
if (is_android) {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ ":build_id_config" ]
}
if (is_win) {
sources += [ "src/libGLESv2/libGLESv2_autogen.def" ]
}
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
public_configs = [ ":shared_library_public_config" ]
}
configs -= angle_undefine_configs
configs += [
":angle_gl_visibility_config",
":debug_annotations_config",
":extra_warnings",
":gl_prototypes",
":internal_config",
]
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
......@@ -712,50 +651,25 @@ shared_library("libGLESv2${angle_libs_suffix}") {
]
}
static_library("libGLESv2_static") {
angle_static_library("libGLESv2_static") {
sources = libglesv2_sources
configs -= angle_undefine_configs
configs += [
":debug_annotations_config",
":extra_warnings",
":internal_config",
]
public_configs = [ ":angle_static" ]
configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_static" ]
deps = [
":includes",
]
public_deps = [
":libANGLE",
]
}
shared_library("libGLESv1_CM${angle_libs_suffix}") {
angle_shared_library("libGLESv1_CM${angle_libs_suffix}") {
sources = libglesv1_cm_sources
if (is_android) {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ ":build_id_config" ]
}
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
public_configs = [ ":shared_library_public_config" ]
}
configs -= angle_undefine_configs
configs += [
":angle_gl_visibility_config",
":debug_annotations_config",
":extra_warnings",
":gl_prototypes",
":internal_config",
]
defines = []
......@@ -766,18 +680,10 @@ shared_library("libGLESv1_CM${angle_libs_suffix}") {
]
}
static_library("libGLESv1_CM_static") {
angle_static_library("libGLESv1_CM_static") {
sources = libglesv1_cm_sources
configs -= angle_undefine_configs
configs += [
":debug_annotations_config",
":extra_warnings",
":internal_config",
]
public_configs = [ ":angle_static" ]
configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_static" ]
deps = [
":includes",
":libGLESv2_static",
......@@ -788,17 +694,15 @@ config("libEGL_egl_loader_config") {
defines = [ "ANGLE_USE_EGL_LOADER" ]
}
source_set("libEGL_egl_loader") {
angle_source_set("libEGL_egl_loader") {
sources = [
"src/libEGL/egl_loader_autogen.cpp",
"src/libEGL/egl_loader_autogen.h",
]
public_configs = [
public_configs += [
":libEGL_egl_loader_config",
":gl_prototypes",
":extra_warnings",
":internal_config",
]
deps = [
......@@ -806,18 +710,11 @@ source_set("libEGL_egl_loader") {
]
}
shared_library("libEGL${angle_libs_suffix}") {
angle_shared_library("libEGL${angle_libs_suffix}") {
sources = libegl_sources
if (is_android) {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ ":build_id_config" ]
}
configs -= angle_undefine_configs
configs += [
":debug_annotations_config",
":extra_warnings",
":internal_config",
":library_name_config",
]
......@@ -832,14 +729,6 @@ shared_library("libEGL${angle_libs_suffix}") {
sources += [ "src/libEGL/libEGL.def" ]
}
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
public_configs = [ ":shared_library_public_config" ]
}
deps = [
":angle_system_utils",
":angle_version",
......@@ -855,18 +744,15 @@ shared_library("libEGL${angle_libs_suffix}") {
]
}
static_library("libEGL_static") {
angle_static_library("libEGL_static") {
sources = libegl_sources
configs -= angle_undefine_configs
configs += [
":debug_annotations_config",
":extra_warnings",
":internal_config",
":library_name_config",
]
public_configs = [ ":angle_static" ]
public_configs += [ ":angle_static" ]
deps = [
":includes",
......@@ -880,7 +766,7 @@ config("angle_util_loader_config") {
defines = [ "ANGLE_USE_UTIL_LOADER" ]
}
source_set("angle_util_loader_headers") {
angle_source_set("angle_util_loader_headers") {
sources = [
"util/egl_loader_autogen.h",
"util/gles_loader_autogen.h",
......@@ -896,7 +782,7 @@ source_set("angle_util_loader_headers") {
]
}
source_set("angle_util_loader") {
angle_source_set("angle_util_loader") {
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
sources = [
......@@ -912,14 +798,11 @@ source_set("angle_util_loader") {
":angle_util_loader_headers",
]
public_configs = [
public_configs += [
":angle_util_config",
":angle_util_loader_config",
":internal_config",
":no_gl_prototypes",
]
configs += [ ":extra_warnings" ]
}
config("angle_util_config") {
......@@ -935,11 +818,11 @@ foreach(is_shared_library,
false,
]) {
if (is_shared_library) {
library_type = "shared_library"
library_type = "angle_shared_library"
library_name = "angle_util"
dep_suffix = "${angle_libs_suffix}"
} else {
library_type = "static_library"
library_type = "angle_static_library"
library_name = "angle_util_static"
dep_suffix = "_static"
}
......@@ -973,10 +856,6 @@ foreach(is_shared_library,
}
if (is_android) {
if (is_shared_library) {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
}
# To prevent linux sources filtering on android
set_sources_assignment_filter([])
sources += util_linux_sources
......@@ -991,15 +870,9 @@ foreach(is_shared_library,
sources += util_ozone_sources
}
configs += [
":debug_annotations_config",
":extra_warnings",
]
configs += [ ":debug_annotations_config" ]
public_configs = [
":angle_util_config",
":internal_config",
]
public_configs += [ ":angle_util_config" ]
deps = [
":angle_common",
......@@ -1009,14 +882,6 @@ foreach(is_shared_library,
if (is_shared_library) {
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/lib${target_name}.dylib",
]
public_configs += [ ":shared_library_public_config" ]
}
if (is_win) {
sources += util_win_shared_sources
}
......@@ -1024,6 +889,13 @@ foreach(is_shared_library,
public_deps = [
":angle_util_loader",
]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/libangle_util.dylib",
]
}
} else {
public_configs += [
":angle_static",
......@@ -1036,7 +908,7 @@ foreach(is_shared_library,
# Convenience targets for some of the samples so they can be built
# with Chromium's toolchain.
executable("angle_shader_translator") {
angle_executable("angle_shader_translator") {
testonly = true
sources = [
......@@ -1059,35 +931,21 @@ config("angle_feature_support_config") {
}
}
shared_library("libfeature_support${angle_libs_suffix}") {
angle_shared_library("libfeature_support${angle_libs_suffix}") {
if (is_android) {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ ":build_id_config" ]
libs = [ "log" ]
}
configs -= angle_undefine_configs
configs += [
":extra_warnings",
":internal_config",
]
public_configs = [
public_configs += [
":angle_feature_support_config",
"third_party/jsoncpp:jsoncpp_config",
]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
public_configs += [ ":shared_library_public_config" ]
}
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
deps = [
":angle_gpu_info_util",
"third_party/jsoncpp:jsoncpp",
......@@ -1116,9 +974,8 @@ if (!is_component_build && is_android && symbol_level != 0) {
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
deps += [
"${angle_root}/third_party/vulkan-validation-layers:${_layer}",
]
deps +=
[ "${angle_root}/third_party/vulkan-validation-layers:${_layer}" ]
}
}
......
......@@ -5,6 +5,7 @@
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni") # import the use_x11 variable
import("//build_overrides/build.gni")
import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
......@@ -86,3 +87,152 @@ declare_args() {
if (is_win) {
import("//build/config/win/visual_studio_version.gni")
}
angle_common_configs = [
angle_root + ":extra_warnings",
angle_root + ":internal_config",
]
angle_remove_configs = [ "//build/config/compiler:default_include_dirs" ]
set_defaults("angle_executable") {
configs = angle_common_configs
public_configs = []
suppressed_configs = []
}
set_defaults("angle_shared_library") {
configs = angle_common_configs
public_configs = []
suppressed_configs = []
}
set_defaults("angle_source_set") {
configs = angle_common_configs
public_configs = []
suppressed_configs = []
}
set_defaults("angle_static_library") {
configs = angle_common_configs
public_configs = []
suppressed_configs = []
}
set_defaults("angle_test") {
configs = angle_common_configs
public_configs = []
suppressed_configs = []
}
template("angle_executable") {
executable(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"suppressed_configs",
"visibility",
])
# Needed because visibility is global.
forward_variables_from(invoker, [ "visibility" ])
configs += invoker.configs
configs -= angle_remove_configs
configs -= invoker.suppressed_configs
}
}
template("angle_shared_library") {
shared_library(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"suppressed_configs",
"visibility",
])
# Needed because visibility is global.
forward_variables_from(invoker, [ "visibility" ])
configs += invoker.configs
configs -= angle_remove_configs
configs -= invoker.suppressed_configs
public_configs += [ angle_root + ":shared_library_public_config" ]
if (is_android) {
configs += [ angle_root + ":build_id_config" ]
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
}
}
}
template("angle_source_set") {
source_set(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"suppressed_configs",
"visibility",
])
# Needed because visibility is global.
forward_variables_from(invoker, [ "visibility" ])
configs += invoker.configs
configs -= angle_remove_configs
configs -= invoker.suppressed_configs
}
}
template("angle_static_library") {
static_library(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"suppressed_configs",
"visibility",
])
# Needed because visibility is global.
forward_variables_from(invoker, [ "visibility" ])
configs += invoker.configs
configs -= angle_remove_configs
configs -= invoker.suppressed_configs
}
}
template("angle_test") {
test(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"suppressed_configs",
"visibility",
])
# Needed because visibility is global.
forward_variables_from(invoker, [ "visibility" ])
configs += invoker.configs
configs -= angle_remove_configs
configs -= invoker.suppressed_configs
if (is_linux && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_android) {
configs += [ angle_root + ":build_id_config" ]
configs -= [ "//build/config/android:hide_all_but_jni" ]
}
}
}
......@@ -4,7 +4,7 @@
import("../gni/angle.gni")
executable("shader_translator") {
angle_executable("shader_translator") {
sources = [
"shader_translator/shader_translator.cpp",
]
......@@ -18,7 +18,7 @@ config("sample_util_config") {
include_dirs = [ "sample_util" ]
}
static_library("sample_util") {
angle_static_library("sample_util") {
sources = [
"sample_util/SampleApplication.cpp",
"sample_util/SampleApplication.h",
......@@ -40,7 +40,6 @@ static_library("sample_util") {
configs += [ "../:library_name_config" ]
public_configs = [
":sample_util_config",
"../:internal_config",
"../:no_gl_prototypes",
]
}
......@@ -55,7 +54,7 @@ template("angle_sample") {
}
}
executable(target_name) {
angle_executable(target_name) {
deps = [
":sample_util",
]
......
......@@ -707,8 +707,8 @@ TEST(MatrixUtilsTest, Mat4Rotate)
{
const auto &input = rotationGoldenInputs[i];
const auto &output = rotationGoldenOutputs[i];
Mat4 r = Mat4::Rotate(input.angle, input.axis);
CheckMatrixCloseToGolden(output, r);
Mat4 rot = Mat4::Rotate(input.angle, input.axis);
CheckMatrixCloseToGolden(output, rot);
}
}
......
......@@ -72,8 +72,10 @@ TEST_F(FenceNVTest, SetAndTestBehavior)
EXPECT_TRUE(mFence->isSet());
// Fake the behavior of testing the fence before and after it's passed.
EXPECT_CALL(*mImpl, test(_, _))
.WillOnce(DoAll(SetArgumentPointee<1>(GL_FALSE), Return(angle::Result::Continue)))
.WillOnce(DoAll(SetArgumentPointee<1>(GL_TRUE), Return(angle::Result::Continue)))
.WillOnce(DoAll(SetArgumentPointee<1>(static_cast<GLboolean>(GL_FALSE)),
Return(angle::Result::Continue)))
.WillOnce(DoAll(SetArgumentPointee<1>(static_cast<GLboolean>(GL_TRUE)),
Return(angle::Result::Continue)))
.RetiresOnSaturation();
GLboolean out;
EXPECT_EQ(angle::Result::Continue, mFence->test(nullptr, &out));
......
......@@ -2,9 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../gni/angle.gni")
import("//build/config/chromecast_build.gni")
import("//testing/test.gni")
import("../../gni/angle.gni")
import("angle_unittests.gni")
declare_args() {
......@@ -33,11 +33,11 @@ if (build_with_chromium) {
]
}
static_library("angle_internal_gtest") {
angle_static_library("angle_internal_gtest") {
sources = [
"//third_party/googletest/src/googletest/src/gtest-all.cc",
]
public_configs = [ ":angle_internal_gtest_config" ]
public_configs += [ ":angle_internal_gtest_config" ]
}
config("angle_internal_gmock_config") {
......@@ -53,11 +53,11 @@ if (build_with_chromium) {
}
}
static_library("angle_internal_gmock") {
angle_static_library("angle_internal_gmock") {
sources = [
"//third_party/googletest/src/googlemock/src/gmock-all.cc",
]
public_configs = [ ":angle_internal_gmock_config" ]
public_configs += [ ":angle_internal_gmock_config" ]
}
group("all") {
......@@ -87,67 +87,45 @@ if (build_with_chromium) {
}
}
source_set("angle_unittests_main") {
testonly = true
public_deps = googletest_deps + [ angle_root + ":includes" ]
public_configs = [ angle_root + ":internal_config" ]
if (build_with_chromium) {
sources = [
"//gpu/angle_unittest_main.cc",
]
} else {
sources = [
"angle_unittests_main.cpp",
# Helper template for including "main" files in Chromium.
template("angle_tests_main") {
source_set(target_name) {
testonly = true
public_deps = googletest_deps
deps = [
angle_root + ":includes",
]
}
}
configs += [ angle_root + ":internal_config" ]
# Ideally we would rename this. But not be worth the hassle.
source_set("angle_end2end_tests_main") {
testonly = true
public_deps = googletest_deps
main = invoker.main
if (build_with_chromium) {
sources = [
"//gpu/angle_end2end_tests_main.cc",
]
} else {
sources = [
"angle_end2end_tests_main.cpp",
]
if (build_with_chromium) {
include_dirs = [ "../.." ]
sources = [
"//gpu/$main.cc",
]
} else {
sources = [
"$main.cpp",
]
}
}
}
source_set("angle_perftests_main") {
testonly = true
public_deps = googletest_deps
if (build_with_chromium) {
sources = [
"//gpu/angle_perftests_main.cc",
]
} else {
sources = [
"angle_perftests_main.cpp",
]
}
# Should fix the naming here once we migrate away from Chromium "main" files.
angle_tests_main("angle_unittests_main") {
main = "angle_unittest_main"
}
# This config adds build-ids to the associated library.
# -Wl is a special option that indicates that clang should pass the associated
# option --build-id to the linker. This will cause a build-id section to be added
# to the associated library. The build-id makes it possible for a debugger to
# find the right symbol file to use.
config("build_id_config") {
if (is_clang) {
ldflags = [ "-Wl,--build-id" ]
}
angle_tests_main("angle_end2end_tests_main") {
main = "angle_end2end_tests_main"
}
test("angle_unittests") {
include_dirs = [ "$angle_root/src" ]
angle_tests_main("angle_perftests_main") {
main = "angle_perftests_main"
}
angle_test("angle_unittests") {
sources = angle_unittests_sources
if (angle_enable_hlsl) {
......@@ -155,11 +133,6 @@ test("angle_unittests") {
defines = [ "ANGLE_ENABLE_HLSL" ]
}
if (is_linux && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
deps = googletest_deps + [
angle_root + ":libANGLE",
angle_root + ":preprocessor",
......@@ -172,13 +145,8 @@ test("angle_unittests") {
if (is_win || is_linux || is_mac || is_android) {
import("angle_end2end_tests.gni")
test("angle_end2end_tests") {
include_dirs = [ "../../src/tests" ]
if (is_android) {
use_native_activity = true
configs += [ ":build_id_config" ]
}
angle_test("angle_end2end_tests") {
include_dirs = [ "." ]
sources = angle_end2end_tests_sources
libs = []
......@@ -198,16 +166,10 @@ if (is_win || is_linux || is_mac || is_android) {
}
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
# Set rpath to find libEGL.so and libGLESv2.so even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
deps = [
angle_root + ":angle_image_util",
angle_root + ":angle_util",
......@@ -220,17 +182,16 @@ if (is_win || is_linux || is_mac || is_android) {
angle_root + ":libGLESv1_CM${angle_libs_suffix}",
angle_root + ":libGLESv2${angle_libs_suffix}",
]
}
import("angle_white_box_tests.gni")
test("angle_white_box_tests") {
include_dirs = [ "." ]
if (is_android) {
use_native_activity = true
}
}
import("angle_white_box_tests.gni")
angle_test("angle_white_box_tests") {
include_dirs = [ "." ]
sources = angle_white_box_tests_sources
if (is_win) {
......@@ -243,16 +204,10 @@ if (is_win || is_linux || is_mac || is_android) {
}
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
# Set rpath to find libEGL.so and libGLESv2.so even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
deps = [
angle_root + ":angle_util_static",
angle_root + ":libANGLE",
......@@ -262,6 +217,10 @@ if (is_win || is_linux || is_mac || is_android) {
angle_root + ":translator",
":angle_end2end_tests_main",
]
if (is_android) {
use_native_activity = true
}
}
}
......@@ -269,12 +228,8 @@ if (is_win || is_linux || is_android || is_mac) {
import("angle_perftests.gni")
# This test suite is for perf tests that use ANGLE's internals in some direct way.
test("angle_white_box_perftests") {
include_dirs = [
".",
"../..",
]
angle_test("angle_white_box_perftests") {
include_dirs = [ "." ]
sources = angle_white_box_perf_tests_sources
deps = [
......@@ -286,11 +241,6 @@ if (is_win || is_linux || is_android || is_mac) {
":angle_perftests_main",
]
if (is_android) {
use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ]
}
if (is_win) {
sources += angle_white_box_perf_tests_win_sources
}
......@@ -298,28 +248,22 @@ if (is_win || is_linux || is_android || is_mac) {
if (angle_enable_vulkan) {
sources += angle_white_box_perf_tests_vulkan_sources
deps += [ "$angle_root/third_party/glslang:glslang" ]
public_configs = [ "$angle_root/third_party/glslang:glslang_config" ]
public_configs += [ "$angle_root/third_party/glslang:glslang_config" ]
}
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
# Set rpath to find *.so files even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
if (is_android) {
use_native_activity = true
}
}
# This test suite is designed to run against a generic GL implementation.
test("angle_perftests") {
include_dirs = [
".",
"../..",
]
angle_test("angle_perftests") {
include_dirs = [ "." ]
sources = angle_perf_tests_sources
deps = [
......@@ -336,20 +280,13 @@ if (is_win || is_linux || is_android || is_mac) {
angle_root + ":libGLESv2${angle_libs_suffix}",
]
if (is_android) {
use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ]
}
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
]
if (is_linux && !is_component_build) {
# Set rpath to find *.so files even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
if (is_android) {
use_native_activity = true
}
}
}
......@@ -395,6 +332,7 @@ if (build_angle_gles1_conform_tests) {
}
}
# This source set is a bit special so we don't use angle_source_set.
source_set("angle_gles1_conformance_no_gtest") {
configs += [
":angle_gles1_conform_support",
......@@ -545,18 +483,13 @@ if (build_angle_gles1_conform_tests) {
]
}
test("angle_gles1_conformance_tests") {
testonly = true
angle_test("angle_gles1_conformance_tests") {
deps = [
":angle_end2end_tests_main",
":angle_gles1_conformance_no_gtest",
]
include_dirs = [
"../../src/tests",
angle_root,
]
include_dirs = [ "." ]
sources = [
"gles1_conformance_tests/ConformanceTests.cpp",
......@@ -570,10 +503,13 @@ if (build_angle_gles1_conform_tests) {
]
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
]
if (is_android) {
use_native_activity = true
}
}
}
......@@ -584,19 +520,8 @@ if (build_angle_gles1_conform_tests) {
if (build_angle_deqp_tests) {
import("deqp.gni")
source_set("angle_deqp_tests_main") {
testonly = true
public_deps = googletest_deps
if (build_with_chromium) {
sources = [
"//gpu/angle_deqp_tests_main.cc",
]
} else {
sources = [
"deqp_support/angle_deqp_gtest_main.cpp",
]
}
angle_tests_main("angle_deqp_tests_main") {
main = "angle_deqp_tests_main"
}
config("angle_deqp_support") {
......@@ -666,6 +591,7 @@ if (build_angle_deqp_tests) {
"//build/config/compiler:chromium_code",
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
angle_root + ":extra_warnings",
]
if (is_win) {
......@@ -676,13 +602,12 @@ if (build_angle_deqp_tests) {
]
}
static_library("angle_deqp_decpp") {
configs -= deqp_undefine_configs
public_configs = [
angle_static_library("angle_deqp_decpp") {
suppressed_configs += deqp_undefine_configs
public_configs += [
":angle_deqp_support",
"//build/config/compiler:exceptions",
"//build/config/compiler:no_chromium_code",
angle_root + ":internal_config",
]
if (is_clang) {
cflags_cc = [
......@@ -711,7 +636,7 @@ if (build_angle_deqp_tests) {
}
}
static_library("angle_deqp_libtester") {
angle_static_library("angle_deqp_libtester") {
public_deps = [
":angle_deqp_decpp",
angle_root + ":angle_common",
......@@ -721,9 +646,9 @@ if (build_angle_deqp_tests) {
"//third_party/libpng:libpng",
]
configs -= deqp_undefine_configs
suppressed_configs += deqp_undefine_configs
configs += [ angle_root + ":library_name_config" ]
public_configs = [ ":angle_deqp_libtester_config" ]
public_configs += [ ":angle_deqp_libtester_config" ]
sources = deqp_libtester_sources
if (is_win) {
sources += deqp_libtester_sources_win
......@@ -741,7 +666,7 @@ if (build_angle_deqp_tests) {
include_dirs = [ "third_party/gpu_test_expectations" ]
}
source_set("angle_deqp_gtest_support") {
angle_source_set("angle_deqp_gtest_support") {
testonly = true
public_deps = [
......@@ -750,7 +675,7 @@ if (build_angle_deqp_tests) {
":angle_deqp_tests_main",
]
public_configs = [ ":angle_deqp_gtest_support_config" ]
public_configs += [ ":angle_deqp_gtest_support_config" ]
sources = deqp_gpu_test_expectations_sources
if (is_mac) {
......@@ -796,18 +721,14 @@ if (build_angle_deqp_tests) {
}
shared_library_name = "angle_deqp_lib${api_name}"
shared_library(shared_library_name) {
angle_shared_library(shared_library_name) {
deps = [
":angle_deqp_libtester",
angle_root + ":angle_util",
]
configs -= deqp_undefine_configs
if (is_android) {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
}
public_configs = [ ":${config_name}" ]
suppressed_configs += deqp_undefine_configs
public_configs += [ ":${config_name}" ]
sources = target_sources[index]
sources += [
......@@ -818,7 +739,7 @@ if (build_angle_deqp_tests) {
}
if (!build_with_chromium) {
executable("angle_deqp_${api_name}_no_gtest") {
angle_executable("angle_deqp_${api_name}_no_gtest") {
sources = [
"deqp_support/angle_deqp_tests_main.cpp",
]
......@@ -829,7 +750,7 @@ if (build_angle_deqp_tests) {
}
test_name = "angle_deqp_${api_name}_tests"
test(test_name) {
angle_test(test_name) {
deps = [
":${shared_library_name}",
":angle_deqp_gtest_support",
......@@ -846,11 +767,6 @@ if (build_angle_deqp_tests) {
"$angle_root/third_party/deqp/src/data/",
]
if (is_linux && !is_component_build) {
# Set rpath to find *.so files even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_android) {
use_native_activity = true
}
......
......@@ -83,7 +83,8 @@ class EGLDirectCompositionTest : public ANGLETest
ComPtr<IVisual> angleVis;
ASSERT_TRUE(SUCCEEDED(mAngleHost.As(&angleVis)));
ASSERT_TRUE(SUCCEEDED(angleVis->put_Size({WINDOWWIDTH, WINDOWHEIGHT})));
ASSERT_TRUE(SUCCEEDED(angleVis->put_Size(
{static_cast<FLOAT>(WINDOWWIDTH), static_cast<FLOAT>(WINDOWHEIGHT)})));
ASSERT_TRUE(SUCCEEDED(angleVis->put_Offset({0, 0, 0})));
......
......@@ -112,15 +112,15 @@ class CopyTextureTest : public ANGLETest
float alpha = color.A / 255.0f;
if (premultiplyAlpha)
{
color.R *= alpha;
color.G *= alpha;
color.B *= alpha;
color.R = static_cast<GLubyte>(static_cast<float>(color.R) * alpha);
color.G = static_cast<GLubyte>(static_cast<float>(color.G) * alpha);
color.B = static_cast<GLubyte>(static_cast<float>(color.B) * alpha);
}
else if (unmultiplyAlpha && color.A != 0)
{
color.R /= alpha;
color.G /= alpha;
color.B /= alpha;
color.R = static_cast<GLubyte>(static_cast<float>(color.R) / alpha);
color.G = static_cast<GLubyte>(static_cast<float>(color.G) / alpha);
color.B = static_cast<GLubyte>(static_cast<float>(color.B) / alpha);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment