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: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/tests/gl_tests/CopyTextureTest.cpp b/src/tests/gl_tests/CopyTextureTest.cpp
index 6b8e008..529dad1 100644
--- a/src/tests/gl_tests/CopyTextureTest.cpp
+++ b/src/tests/gl_tests/CopyTextureTest.cpp
@@ -112,15 +112,15 @@
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);
}
}