diff options
author | Brian Salomon <bsalomon@google.com> | 2017-03-20 08:54:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-20 13:31:49 +0000 |
commit | 6405e71279e99731f89db69325c6763ec62a98e1 (patch) | |
tree | f1ce7b3cc37ec3e9f9f4f135655376fd30174753 /tools/flags/SkCommonFlagsConfig.cpp | |
parent | 5e21e0991968271ee37f446de7e08620ad1b50bb (diff) |
Remove gpu configs that don't have explicit API.
DOCS_PREVIEW= https://skia.org/?cl=9871
Change-Id: I510473cf91d8bee38d1e33424b1ae7b30dc86968
Reviewed-on: https://skia-review.googlesource.com/9871
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/flags/SkCommonFlagsConfig.cpp')
-rw-r--r-- | tools/flags/SkCommonFlagsConfig.cpp | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp index 46aec7dcc6..b827e89665 100644 --- a/tools/flags/SkCommonFlagsConfig.cpp +++ b/tools/flags/SkCommonFlagsConfig.cpp @@ -15,20 +15,27 @@ using sk_gpu_test::GrContextFactory; #endif +#if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_IOS) +# define DEFAULT_GPU_CONFIG "gles" +#else +# define DEFAULT_GPU_CONFIG "gl" +#endif + static const char defaultConfigs[] = - "8888 gpu nonrendering" + "8888 " DEFAULT_GPU_CONFIG " nonrendering " #if defined(SK_BUILD_FOR_WIN) " angle_d3d11_es2" #endif ; +#undef DEFAULT_GPU_CONFIG + static const struct { const char* predefinedConfig; const char* backend; const char* options; } gPredefinedConfigs[] ={ #if SK_SUPPORT_GPU - { "gpu", "gpu", "" }, { "gl", "gpu", "api=gl" }, { "gles", "gpu", "api=gles" }, { "glmsaa4", "gpu", "api=gl,samples=4" }, @@ -48,22 +55,22 @@ static const struct { { "glesinst", "gpu", "api=gles,inst=true" }, { "glesinst4", "gpu", "api=gles,inst=true,samples=4" }, { "glesinstdit4", "gpu", "api=gles,inst=true,samples=4,dit=true" }, - { "gpuf16", "gpu", "color=f16" }, - { "gpusrgb", "gpu", "color=srgb" }, - { "gpusrgbnl", "gpu", "color=srgbnl" }, + { "glf16", "gpu", "api=gl,color=f16" }, + { "glsrgb", "gpu", "api=gl,color=srgb" }, + { "glsrgbnl", "gpu", "api=gl,color=srgbnl" }, + { "glesf16", "gpu", "api=gles,color=f16" }, + { "glessrgb", "gpu", "api=gles,color=srgb" }, + { "glessrgbnl", "gpu", "api=gles,color=srgbnl" }, { "glsrgb", "gpu", "api=gl,color=srgb" }, { "glwide", "gpu", "api=gl,color=f16_wide" }, { "glnarrow", "gpu", "api=gl,color=f16_narrow" }, { "glessrgb", "gpu", "api=gles,color=srgb" }, { "gleswide", "gpu", "api=gles,color=f16_wide" }, { "glesnarrow", "gpu", "api=gles,color=f16_narrow" }, - { "gpudft", "gpu", "dit=true" }, { "gldft", "gpu", "api=gl,dit=true" }, { "glesdft", "gpu", "api=gles,dit=true" }, - { "gpudebug", "gpu", "api=debug" }, - { "gpunull", "gpu", "api=null" }, - { "debug", "gpu", "api=debug" }, - { "nullgpu", "gpu", "api=null" }, + { "debuggl", "gpu", "api=debuggl" }, + { "nullgl", "gpu", "api=nullgl" }, { "angle_d3d11_es2", "gpu", "api=angle_d3d11_es2" }, { "angle_d3d11_es3", "gpu", "api=angle_d3d11_es3" }, { "angle_d3d9_es2", "gpu", "api=angle_d3d9_es2" }, @@ -106,14 +113,14 @@ static const char configExtendedHelp[] = #if SK_SUPPORT_GPU "\n" "gpu[api=string,color=string,dit=bool,nvpr=bool,inst=bool,samples=int]\n" - "\tapi\ttype: string\tdefault: native.\n" + "\tapi\ttype: string\trequired\n" "\t Select graphics API to use with gpu backend.\n" "\t Options:\n" "\t\tnative\t\t\tUse platform default OpenGL or OpenGL ES backend.\n" "\t\tgl \t\t\tUse OpenGL.\n" "\t\tgles \t\t\tUse OpenGL ES.\n" - "\t\tdebug \t\t\tUse debug OpenGL.\n" - "\t\tnull \t\t\tUse null OpenGL.\n" + "\t\tdebuggl \t\t\tUse debug OpenGL.\n" + "\t\tnullgl \t\t\tUse null OpenGL.\n" "\t\tangle_d3d9_es2\t\t\tUse OpenGL ES2 on the ANGLE Direct3D9 backend.\n" "\t\tangle_d3d11_es2\t\t\tUse OpenGL ES2 on the ANGLE Direct3D11 backend.\n" "\t\tangle_d3d11_es3\t\t\tUse OpenGL ES3 on the ANGLE Direct3D11 backend.\n" @@ -236,11 +243,11 @@ static bool parse_option_gpu_api(const SkString& value, *outContextType = GrContextFactory::kGLES_ContextType; return true; } - if (value.equals("debug")) { + if (value.equals("debuggl")) { *outContextType = GrContextFactory::kDebugGL_ContextType; return true; } - if (value.equals("null")) { + if (value.equals("nullgl")) { *outContextType = GrContextFactory::kNullGL_ContextType; return true; } @@ -354,7 +361,7 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, const SkString& options) { // Defaults for GPU backend. bool seenAPI = false; - SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeGL_ContextType; + SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kGL_ContextType; bool seenUseNVPR = false; bool useNVPR = false; bool seenUseInstanced = false; @@ -401,6 +408,9 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, return nullptr; } } + if (!seenAPI) { + return nullptr; + } return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useInstanced, useDIText, samples, colorType, colorSpace); } |