aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TestConfigParsing.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-09-29 09:49:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-29 09:49:06 -0700
commit50094fb489543655df026be4e4f99e09e57a1f49 (patch)
tree5c8a936664ddbf5c51e615533200957871a53b6d /tests/TestConfigParsing.cpp
parent6b1da0a53864530257906e31f0023a7b8ffccd07 (diff)
Explicit control in tools of ANGLE frontend and backend
Update the ANGLE test GL context, GrContextFactory, and config parsing to allow explicit control of ANGLE front/backend. This will allow us to explicitly test ES2 vs ES3 interfaces to ANGLE as well as D3D9, D3D11, and OpenGL backends. Also makes the angle api types valid in all builds (but will just fail when SK_ANGLE=1 or not on windows for the d3d backends). BUG=skia:5804 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2381033002 NOTREECHECKS=true NOTRY=true NOPRESUBMIT=true Review-Url: https://codereview.chromium.org/2381033002
Diffstat (limited to 'tests/TestConfigParsing.cpp')
-rw-r--r--tests/TestConfigParsing.cpp63
1 files changed, 23 insertions, 40 deletions
diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp
index 8435b99ce5..4d7e5cad0e 100644
--- a/tests/TestConfigParsing.cpp
+++ b/tests/TestConfigParsing.cpp
@@ -77,9 +77,9 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
"565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16", "msaa4",
"nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvprdit4", "pdf", "skp",
- "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui", "gpuf16", "gpusrgb",
- "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk", "glinst", "glinst4", "glinstdit4",
- "glinst16", "glinstdit16", "esinst", "esinst4", "esinstdit4", "glwide"
+ "svg", "xps", "angle_d3d11_es2", "angle_gl_es2", "commandbuffer", "mesa", "hwui", "gpuf16",
+ "gpusrgb", "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk", "glinst", "glinst4",
+ "glinstdit4", "glinst16", "glinstdit16", "esinst", "esinst4", "esinstdit4", "glwide"
});
SkCommandLineConfigArray configs;
@@ -167,18 +167,8 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
REPORTER_ASSERT(reporter, configs[40]->asConfigGpu()->getUseInstanced());
REPORTER_ASSERT(reporter, configs[40]->asConfigGpu()->getUseDIText());
REPORTER_ASSERT(reporter, configs[40]->asConfigGpu()->getSamples() == 4);
-
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
REPORTER_ASSERT(reporter, configs[20]->asConfigGpu());
-#else
- REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu());
-#endif
REPORTER_ASSERT(reporter, configs[21]->asConfigGpu());
-#else
- REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu());
- REPORTER_ASSERT(reporter, !configs[21]->asConfigGpu());
-#endif
REPORTER_ASSERT(reporter, configs[22]->asConfigGpu());
#if SK_MESA
REPORTER_ASSERT(reporter, configs[23]->asConfigGpu());
@@ -207,8 +197,8 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
"gpu[nvpr=true,dit=false]",
- "gpu[api=angle]",
- "gpu[api=angle-gl]",
+ "gpu[api=angle_d3d9_es2]",
+ "gpu[api=angle_gl_es3]",
"gpu[api=mesa,samples=77]",
"gpu[dit=true,api=commandbuffer]",
"gpu[]",
@@ -229,19 +219,12 @@ DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) {
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR());
REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu()->getUseDIText());
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0);
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
REPORTER_ASSERT(reporter, configs[1]->asConfigGpu()->getContextType() ==
- GrContextFactory::kANGLE_ContextType);
-#else
- REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
-#endif
+ GrContextFactory::kANGLE_D3D9_ES2_ContextType);
+ REPORTER_ASSERT(reporter, configs[1]->asConfigGpu());
REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()->getContextType() ==
- GrContextFactory::kANGLE_GL_ContextType);
-#else
- REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
- REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
-#endif
+ GrContextFactory::kANGLE_GL_ES3_ContextType);
+ REPORTER_ASSERT(reporter, configs[2]->asConfigGpu());
#if SK_MESA
REPORTER_ASSERT(reporter, configs[3]->asConfigGpu()->getContextType() ==
GrContextFactory::kMESA_ContextType);
@@ -280,7 +263,7 @@ DEF_TEST(ParseConfigs_ExtendedGpuConfigsIncorrect, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
"gpu[nvpr=1]", // Number as bool.
"gpu[api=gl,]", // Trailing in comma.
- "gpu[api=angle-glu]", // Unknown api.
+ "gpu[api=angle_glu]", // Unknown api.
"gpu[api=,samples=0]", // Empty api.
"gpu[samples=true]", // Value true as a number.
"gpu[samples=0,samples=0]", // Duplicate option key.
@@ -329,7 +312,7 @@ DEF_TEST(ParseConfigs_ViaParsing, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
"a-b-c-8888",
"zz-qq-gpu",
- "a-angle-gl"
+ "a-angle_gl_es2"
});
SkCommandLineConfigArray configs;
@@ -340,12 +323,7 @@ DEF_TEST(ParseConfigs_ViaParsing, reporter) {
} expectedConfigs[] = {
{"8888", {"a", "b", "c"}},
{"gpu", {"zz", "qq", nullptr}},
-#if SK_ANGLE
- { "gpu",{ "a", nullptr, nullptr } } // With SK_ANGLE, angle-gl becomes gpu(api=angle-gl)
-#else
- { "angle-gl",{ "a", nullptr, nullptr } } // The angle-gl tag is only tag that contains
- // hyphen.
-#endif
+ {"gpu", { "a", nullptr, nullptr }}
};
for (int i = 0; i < config1.count(); ++i) {
REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
@@ -364,8 +342,9 @@ DEF_TEST(ParseConfigs_ViaParsing, reporter) {
DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
"zz-qq-gpu[api=gles]",
+ "abc-nbc-cbs-gpu[api=angle_d3d9_es2,samples=1]",
"a-gpu[samples=1",
- "abc-def-angle-gl[samples=1]",
+ "abc-def-angle_gl_es2[samples=1]",
});
SkCommandLineConfigArray configs;
@@ -376,13 +355,16 @@ DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) {
} expectedConfigs[] = {
#if SK_SUPPORT_GPU
{"gpu", {"zz", "qq", nullptr}},
+ {"gpu", {"abc", "nbc", "cbs"}},
#else
{"gpu[api=gles]", {"zz", "qq", nullptr}},
+ {"gpu[api=angle_d3d9_es2,samples=1]", {"abc", "nbc", "cbs"}},
#endif
- {"gpu[samples=1", {"a", nullptr, nullptr}}, // This is not extended form, but via still
- // works as expected.
- {"gl[samples=1]", {"abc", "def", "angle"}} // This is not extended form. Also
- // angle-gl is not a "backend" in this case.
+ {"gpu[samples=1", {"a", nullptr, nullptr}}, // Missing bracket makes this is not extended
+ // form but via still works as expected.
+ {"angle_gl_es2[samples=1]", {"abc", "def", nullptr}} // This is not extended form.
+ // angle_gl_es2 is an api type not a
+ // backend.
};
for (int i = 0; i < config1.count(); ++i) {
REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
@@ -399,7 +381,8 @@ DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) {
}
#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
- REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
+ REPORTER_ASSERT(reporter, configs[1]->asConfigGpu());
REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
+ REPORTER_ASSERT(reporter, !configs[3]->asConfigGpu());
#endif
}