Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2021-03-30 20:14:37 +00:00
|
|
|
#include "tools/flags/CommonFlagsConfig.h"
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkImageInfo.h"
|
2021-08-12 14:51:48 +00:00
|
|
|
#include "include/core/SkStringView.h"
|
2021-03-30 20:14:37 +00:00
|
|
|
#include "include/core/SkSurfaceProps.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/private/SkTHash.h"
|
|
|
|
#include "src/core/SkColorSpacePriv.h"
|
2021-04-19 23:40:40 +00:00
|
|
|
#include "src/core/SkSurfacePriv.h"
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
2021-08-12 14:51:48 +00:00
|
|
|
#include <unordered_map>
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
2016-03-31 01:56:19 +00:00
|
|
|
using sk_gpu_test::GrContextFactory;
|
|
|
|
|
2017-03-20 12:54:16 +00:00
|
|
|
#if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_IOS)
|
2019-03-20 15:50:33 +00:00
|
|
|
#define DEFAULT_GPU_CONFIG "gles"
|
2017-03-20 12:54:16 +00:00
|
|
|
#else
|
2019-03-20 15:50:33 +00:00
|
|
|
#define DEFAULT_GPU_CONFIG "gl"
|
2017-03-20 12:54:16 +00:00
|
|
|
#endif
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
static const char defaultConfigs[] = "8888 " DEFAULT_GPU_CONFIG
|
|
|
|
" nonrendering "
|
2019-07-09 18:44:12 +00:00
|
|
|
#if SK_ANGLE && defined(SK_BUILD_FOR_WIN)
|
2019-03-20 15:50:33 +00:00
|
|
|
" angle_d3d11_es2"
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
#endif
|
2019-03-20 15:50:33 +00:00
|
|
|
;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
2017-03-20 12:54:16 +00:00
|
|
|
#undef DEFAULT_GPU_CONFIG
|
|
|
|
|
2018-07-11 19:32:05 +00:00
|
|
|
// clang-format off
|
2016-09-20 15:06:30 +00:00
|
|
|
static const struct {
|
|
|
|
const char* predefinedConfig;
|
|
|
|
const char* backend;
|
|
|
|
const char* options;
|
2018-03-09 14:01:53 +00:00
|
|
|
} gPredefinedConfigs[] = {
|
2016-10-18 15:28:20 +00:00
|
|
|
{ "gl", "gpu", "api=gl" },
|
2017-03-17 18:32:05 +00:00
|
|
|
{ "gles", "gpu", "api=gles" },
|
2020-08-26 19:27:03 +00:00
|
|
|
{ "glesfakev2", "gpu", "api=glesfakev2" },
|
2021-03-18 03:10:17 +00:00
|
|
|
{ "gldmsaa", "gpu", "api=gl,dmsaa=true" },
|
|
|
|
{ "glesdmsaa", "gpu", "api=gles,dmsaa=true" },
|
2016-10-18 15:28:20 +00:00
|
|
|
{ "glmsaa4", "gpu", "api=gl,samples=4" },
|
2017-03-20 15:10:21 +00:00
|
|
|
{ "glmsaa8" , "gpu", "api=gl,samples=8" },
|
2017-03-17 18:32:05 +00:00
|
|
|
{ "glesmsaa4", "gpu", "api=gles,samples=4" },
|
2018-03-09 14:01:53 +00:00
|
|
|
{ "glbetex", "gpu", "api=gl,surf=betex" },
|
|
|
|
{ "glesbetex", "gpu", "api=gles,surf=betex" },
|
|
|
|
{ "glbert", "gpu", "api=gl,surf=bert" },
|
|
|
|
{ "glesbert", "gpu", "api=gles,surf=bert" },
|
2017-07-17 15:31:31 +00:00
|
|
|
{ "gl4444", "gpu", "api=gl,color=4444" },
|
2018-05-30 19:36:38 +00:00
|
|
|
{ "gles4444", "gpu", "api=gles,color=4444" },
|
2017-07-17 15:31:31 +00:00
|
|
|
{ "gl565", "gpu", "api=gl,color=565" },
|
2018-03-22 14:01:16 +00:00
|
|
|
{ "gl888x", "gpu", "api=gl,color=888x" },
|
2018-05-30 19:36:38 +00:00
|
|
|
{ "gles888x", "gpu", "api=gles,color=888x" },
|
2018-03-02 16:01:10 +00:00
|
|
|
{ "gl1010102", "gpu", "api=gl,color=1010102" },
|
2018-05-30 19:36:38 +00:00
|
|
|
{ "gles1010102", "gpu", "api=gles,color=1010102" },
|
|
|
|
{ "glf16", "gpu", "api=gl,color=f16" },
|
2019-03-06 18:40:40 +00:00
|
|
|
{ "glf16norm", "gpu", "api=gl,color=f16norm" },
|
2018-06-28 17:52:02 +00:00
|
|
|
{ "glesf16", "gpu", "api=gles,color=f16" },
|
2017-05-08 19:02:07 +00:00
|
|
|
{ "glnostencils", "gpu", "api=gl,stencils=false" },
|
2017-03-17 18:32:05 +00:00
|
|
|
{ "gldft", "gpu", "api=gl,dit=true" },
|
|
|
|
{ "glesdft", "gpu", "api=gles,dit=true" },
|
2017-08-30 14:02:10 +00:00
|
|
|
{ "gltestthreading", "gpu", "api=gl,testThreading=true" },
|
2019-04-03 17:04:16 +00:00
|
|
|
{ "gltestpersistentcache", "gpu", "api=gl,testPersistentCache=1" },
|
|
|
|
{ "gltestglslcache", "gpu", "api=gl,testPersistentCache=2" },
|
2019-09-06 18:42:43 +00:00
|
|
|
{ "gltestprecompile", "gpu", "api=gl,testPrecompile=true" },
|
2019-09-16 16:38:04 +00:00
|
|
|
{ "glestestprecompile", "gpu", "api=gles,testPrecompile=true" },
|
2020-02-19 19:14:47 +00:00
|
|
|
{ "glddl", "gpu", "api=gl,useDDLSink=true" },
|
2020-06-15 17:12:32 +00:00
|
|
|
{ "glooprddl", "gpu", "api=gl,OOPRish=true" },
|
2021-04-09 15:57:59 +00:00
|
|
|
{ "glreducedshaders", "gpu", "api=gl,reducedShaders=true" },
|
|
|
|
{ "glesreducedshaders", "gpu", "api=gles,reducedShaders=true" },
|
2016-10-18 15:28:20 +00:00
|
|
|
{ "angle_d3d11_es2", "gpu", "api=angle_d3d11_es2" },
|
2017-01-10 18:31:33 +00:00
|
|
|
{ "angle_d3d11_es3", "gpu", "api=angle_d3d11_es3" },
|
2016-10-18 15:28:20 +00:00
|
|
|
{ "angle_d3d9_es2", "gpu", "api=angle_d3d9_es2" },
|
|
|
|
{ "angle_d3d11_es2_msaa4", "gpu", "api=angle_d3d11_es2,samples=4" },
|
2017-03-24 15:15:09 +00:00
|
|
|
{ "angle_d3d11_es2_msaa8", "gpu", "api=angle_d3d11_es2,samples=8" },
|
2021-07-18 23:33:25 +00:00
|
|
|
{ "angle_d3d11_es2_dmsaa", "gpu", "api=angle_d3d11_es2,dmsaa=true" },
|
2017-06-22 13:56:24 +00:00
|
|
|
{ "angle_d3d11_es3_msaa4", "gpu", "api=angle_d3d11_es3,samples=4" },
|
|
|
|
{ "angle_d3d11_es3_msaa8", "gpu", "api=angle_d3d11_es3,samples=8" },
|
2021-07-16 22:59:02 +00:00
|
|
|
{ "angle_d3d11_es3_dmsaa", "gpu", "api=angle_d3d11_es3,dmsaa=true" },
|
2016-10-18 15:28:20 +00:00
|
|
|
{ "angle_gl_es2", "gpu", "api=angle_gl_es2" },
|
2017-01-10 18:31:33 +00:00
|
|
|
{ "angle_gl_es3", "gpu", "api=angle_gl_es3" },
|
2021-03-15 15:34:26 +00:00
|
|
|
{ "angle_gl_es2_msaa4", "gpu", "api=angle_gl_es2,samples=4" },
|
2018-04-19 19:49:18 +00:00
|
|
|
{ "angle_gl_es2_msaa8", "gpu", "api=angle_gl_es2,samples=8" },
|
2021-07-18 23:33:25 +00:00
|
|
|
{ "angle_gl_es2_dmsaa", "gpu", "api=angle_gl_es2,dmsaa=true" },
|
2021-03-15 15:34:26 +00:00
|
|
|
{ "angle_gl_es3_msaa4", "gpu", "api=angle_gl_es3,samples=4" },
|
2018-04-19 19:49:18 +00:00
|
|
|
{ "angle_gl_es3_msaa8", "gpu", "api=angle_gl_es3,samples=8" },
|
2021-07-16 22:59:02 +00:00
|
|
|
{ "angle_gl_es3_dmsaa", "gpu", "api=angle_gl_es3,dmsaa=true" },
|
2021-06-28 14:43:08 +00:00
|
|
|
{ "cmdbuffer_es2", "gpu", "api=cmdbuffer_es2" },
|
2021-07-08 06:30:21 +00:00
|
|
|
{ "cmdbuffer_es2_dmsaa", "gpu", "api=cmdbuffer_es2,dmsaa=true" },
|
2021-06-28 14:43:08 +00:00
|
|
|
{ "cmdbuffer_es3", "gpu", "api=cmdbuffer_es3" },
|
2018-12-19 18:12:10 +00:00
|
|
|
{ "mock", "gpu", "api=mock" },
|
2019-07-18 15:43:45 +00:00
|
|
|
#ifdef SK_DAWN
|
|
|
|
{ "dawn", "gpu", "api=dawn" },
|
|
|
|
#endif
|
2016-09-20 15:06:30 +00:00
|
|
|
#ifdef SK_VULKAN
|
2018-12-19 18:12:10 +00:00
|
|
|
{ "vk", "gpu", "api=vulkan" },
|
|
|
|
{ "vknostencils", "gpu", "api=vulkan,stencils=false" },
|
|
|
|
{ "vk1010102", "gpu", "api=vulkan,color=1010102" },
|
|
|
|
{ "vkf16", "gpu", "api=vulkan,color=f16" },
|
|
|
|
{ "vkmsaa4", "gpu", "api=vulkan,samples=4" },
|
|
|
|
{ "vkmsaa8", "gpu", "api=vulkan,samples=8" },
|
|
|
|
{ "vkbetex", "gpu", "api=vulkan,surf=betex" },
|
|
|
|
{ "vkbert", "gpu", "api=vulkan,surf=bert" },
|
2019-04-03 17:04:16 +00:00
|
|
|
{ "vktestpersistentcache", "gpu", "api=vulkan,testPersistentCache=1" },
|
2020-02-19 19:14:47 +00:00
|
|
|
{ "vkddl", "gpu", "api=vulkan,useDDLSink=true" },
|
2020-06-15 17:12:32 +00:00
|
|
|
{ "vkooprddl", "gpu", "api=vulkan,OOPRish=true" },
|
2016-09-20 15:06:30 +00:00
|
|
|
#endif
|
2017-07-13 19:34:56 +00:00
|
|
|
#ifdef SK_METAL
|
2018-12-19 18:12:10 +00:00
|
|
|
{ "mtl", "gpu", "api=metal" },
|
|
|
|
{ "mtl1010102", "gpu", "api=metal,color=1010102" },
|
|
|
|
{ "mtlmsaa4", "gpu", "api=metal,samples=4" },
|
|
|
|
{ "mtlmsaa8", "gpu", "api=metal,samples=8" },
|
2020-02-19 19:14:47 +00:00
|
|
|
{ "mtlddl", "gpu", "api=metal,useDDLSink=true" },
|
2020-06-15 17:12:32 +00:00
|
|
|
{ "mtlooprddl", "gpu", "api=metal,OOPRish=true" },
|
2021-02-26 19:42:11 +00:00
|
|
|
{ "mtltestprecompile", "gpu", "api=metal,testPrecompile=true" },
|
2021-04-09 15:57:59 +00:00
|
|
|
{ "mtlreducedshaders", "gpu", "api=metal,reducedShaders=true" },
|
2017-07-13 19:34:56 +00:00
|
|
|
#endif
|
2020-02-19 19:57:58 +00:00
|
|
|
#ifdef SK_DIRECT3D
|
|
|
|
{ "d3d", "gpu", "api=direct3d" },
|
2020-07-07 19:36:41 +00:00
|
|
|
{ "d3dmsaa4", "gpu", "api=direct3d,samples=4" },
|
|
|
|
{ "d3dmsaa8", "gpu", "api=direct3d,samples=8" },
|
2020-02-19 19:57:58 +00:00
|
|
|
#endif
|
2016-09-20 15:06:30 +00:00
|
|
|
};
|
2018-07-11 19:32:05 +00:00
|
|
|
// clang-format on
|
2016-09-20 15:06:30 +00:00
|
|
|
|
|
|
|
static const char configHelp[] =
|
2021-08-12 14:51:48 +00:00
|
|
|
"Options: 565 4444 8888 rgba bgra rgbx 1010102 101010x bgra1010102 bgr101010x f16 f16norm "
|
|
|
|
"f32 nonrendering null pdf pdfa pdf300 skp svg xps";
|
2016-09-20 15:06:30 +00:00
|
|
|
|
|
|
|
static const char* config_help_fn() {
|
|
|
|
static SkString helpString;
|
|
|
|
helpString.set(configHelp);
|
|
|
|
for (const auto& config : gPredefinedConfigs) {
|
|
|
|
helpString.appendf(" %s", config.predefinedConfig);
|
|
|
|
}
|
2016-09-28 19:40:22 +00:00
|
|
|
helpString.append(" or use extended form 'backend[option=value,...]'.\n");
|
2016-09-20 15:06:30 +00:00
|
|
|
return helpString.c_str();
|
|
|
|
}
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
|
|
|
static const char configExtendedHelp[] =
|
2018-07-11 19:32:05 +00:00
|
|
|
"Extended form: 'backend(option=value,...)'\n\n"
|
|
|
|
"Possible backends and options:\n"
|
|
|
|
"\n"
|
2021-03-18 03:10:17 +00:00
|
|
|
"gpu[api=string,color=string,dit=bool,dmsaa=bool,samples=int]\n"
|
2018-07-11 19:32:05 +00:00
|
|
|
"\tapi\ttype: string\trequired\n"
|
|
|
|
"\t Select graphics API to use with gpu backend.\n"
|
|
|
|
"\t Options:\n"
|
|
|
|
"\t\tgl \t\t\tUse OpenGL.\n"
|
|
|
|
"\t\tgles \t\t\tUse OpenGL ES.\n"
|
2020-08-26 19:27:03 +00:00
|
|
|
"\t\tglesfakev2 \t\t\tUse OpenGL ES with version faked as 2.0.\n"
|
2018-07-11 19:32:05 +00:00
|
|
|
"\t\tnullgl \t\t\tUse null OpenGL.\n"
|
|
|
|
"\t\tangle_d3d9_es2\t\tUse OpenGL ES2 on the ANGLE Direct3D9 backend.\n"
|
|
|
|
"\t\tangle_d3d11_es2\t\tUse OpenGL ES2 on the ANGLE Direct3D11 backend.\n"
|
|
|
|
"\t\tangle_d3d11_es3\t\tUse OpenGL ES3 on the ANGLE Direct3D11 backend.\n"
|
|
|
|
"\t\tangle_gl_es2\t\tUse OpenGL ES2 on the ANGLE OpenGL backend.\n"
|
|
|
|
"\t\tangle_gl_es3\t\tUse OpenGL ES3 on the ANGLE OpenGL backend.\n"
|
|
|
|
"\t\tcommandbuffer\t\tUse command buffer.\n"
|
|
|
|
"\t\tmock\t\t\tUse mock context.\n"
|
2016-04-11 21:21:33 +00:00
|
|
|
#ifdef SK_VULKAN
|
2018-07-11 19:32:05 +00:00
|
|
|
"\t\tvulkan\t\t\tUse Vulkan.\n"
|
2017-07-13 19:34:56 +00:00
|
|
|
#endif
|
|
|
|
#ifdef SK_METAL
|
2018-07-11 19:32:05 +00:00
|
|
|
"\t\tmetal\t\t\tUse Metal.\n"
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
#endif
|
2018-07-11 19:32:05 +00:00
|
|
|
"\tcolor\ttype: string\tdefault: 8888.\n"
|
|
|
|
"\t Select framebuffer color format.\n"
|
|
|
|
"\t Options:\n"
|
|
|
|
"\t\t8888\t\t\tLinear 8888.\n"
|
|
|
|
"\t\t888x\t\t\tLinear 888x.\n"
|
|
|
|
"\t\t4444\t\t\tLinear 4444.\n"
|
|
|
|
"\t\t565\t\t\tLinear 565.\n"
|
|
|
|
"\t\t1010102\t\t\tLinear 1010102.\n"
|
2021-08-12 14:51:48 +00:00
|
|
|
"\t\tf16\t\t\t16-bit floating point.\n"
|
2018-07-11 19:32:05 +00:00
|
|
|
"\tdit\ttype: bool\tdefault: false.\n"
|
|
|
|
"\t Use device independent text.\n"
|
2021-03-18 03:10:17 +00:00
|
|
|
"\tdmsaa\ttype: bool\tdefault: false.\n"
|
|
|
|
"\t Use internal MSAA to render to non-MSAA surfaces.\n"
|
2018-07-11 19:32:05 +00:00
|
|
|
"\tsamples\ttype: int\tdefault: 0.\n"
|
|
|
|
"\t Use multisampling with N samples.\n"
|
|
|
|
"\tstencils\ttype: bool\tdefault: true.\n"
|
|
|
|
"\t Allow the use of stencil buffers.\n"
|
|
|
|
"\ttestThreading\ttype: bool\tdefault: false.\n"
|
|
|
|
"\t Run with and without worker threads, check that results match.\n"
|
2019-04-03 17:04:16 +00:00
|
|
|
"\ttestPersistentCache\ttype: int\tdefault: 0.\n"
|
|
|
|
"\t 1: Run using a pre-warmed binary GrContextOptions::fPersistentCache.\n"
|
|
|
|
"\t 2: Run using a pre-warmed GLSL GrContextOptions::fPersistentCache.\n"
|
2018-07-11 19:32:05 +00:00
|
|
|
"\tsurf\ttype: string\tdefault: default.\n"
|
|
|
|
"\t Controls the type of backing store for SkSurfaces.\n"
|
|
|
|
"\t Options:\n"
|
|
|
|
"\t\tdefault\t\t\tA renderable texture created in Skia's resource cache.\n"
|
|
|
|
"\t\tbetex\t\t\tA wrapped backend texture.\n"
|
|
|
|
"\t\tbert\t\t\tA wrapped backend render target\n"
|
|
|
|
"\n"
|
|
|
|
"Predefined configs:\n\n"
|
|
|
|
// Help text for pre-defined configs is auto-generated from gPredefinedConfigs
|
|
|
|
;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
2016-09-20 15:06:30 +00:00
|
|
|
static const char* config_extended_help_fn() {
|
|
|
|
static SkString helpString;
|
|
|
|
helpString.set(configExtendedHelp);
|
|
|
|
for (const auto& config : gPredefinedConfigs) {
|
|
|
|
helpString.appendf("\t%-10s\t= gpu(%s)\n", config.predefinedConfig, config.options);
|
|
|
|
}
|
|
|
|
return helpString.c_str();
|
|
|
|
}
|
2016-04-11 21:21:33 +00:00
|
|
|
|
2016-09-20 15:06:30 +00:00
|
|
|
DEFINE_extended_string(config, defaultConfigs, config_help_fn(), config_extended_help_fn());
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
2021-08-12 14:51:48 +00:00
|
|
|
SkCommandLineConfig::SkCommandLineConfig(const SkString& tag,
|
|
|
|
const SkString& backend,
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
const SkTArray<SkString>& viaParts)
|
2021-08-12 14:51:48 +00:00
|
|
|
: fTag(tag), fBackend(backend) {
|
|
|
|
|
|
|
|
static std::unordered_map<skstd::string_view, sk_sp<SkColorSpace>> kColorSpaces = {
|
|
|
|
// 'narrow' has a gamut narrower than sRGB, and different transfer function.
|
|
|
|
{ "narrow", SkColorSpace::MakeRGB(SkNamedTransferFn::k2Dot2, gNarrow_toXYZD50) },
|
|
|
|
{ "srgb", SkColorSpace::MakeSRGB() },
|
|
|
|
{ "linear", SkColorSpace::MakeSRGBLinear() },
|
|
|
|
{ "p3", SkColorSpace::MakeRGB(SkNamedTransferFn::kSRGB, SkNamedGamut::kDisplayP3) },
|
|
|
|
{ "spin", SkColorSpace::MakeSRGB()->makeColorSpin() },
|
|
|
|
{ "rec2020", SkColorSpace::MakeRGB(SkNamedTransferFn::kRec2020, SkNamedGamut::kRec2020) },
|
|
|
|
};
|
|
|
|
|
|
|
|
// Strip off any via parts that refer to color spaces (and remember the last one we see)
|
|
|
|
for (const SkString& via : viaParts) {
|
|
|
|
auto it = kColorSpaces.find(via.c_str());
|
|
|
|
if (it == kColorSpaces.end()) {
|
|
|
|
fViaParts.push_back(via);
|
|
|
|
} else {
|
|
|
|
fColorSpace = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfig::~SkCommandLineConfig() {}
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
|
|
|
static bool parse_option_int(const SkString& value, int* outInt) {
|
|
|
|
if (value.isEmpty()) {
|
|
|
|
return false;
|
|
|
|
}
|
2019-03-20 15:50:33 +00:00
|
|
|
char* endptr = nullptr;
|
|
|
|
long intValue = strtol(value.c_str(), &endptr, 10);
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
if (*endptr != '\0') {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*outInt = static_cast<int>(intValue);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static bool parse_option_bool(const SkString& value, bool* outBool) {
|
|
|
|
if (value.equals("true")) {
|
|
|
|
*outBool = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("false")) {
|
|
|
|
*outBool = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2019-03-20 15:50:33 +00:00
|
|
|
static bool parse_option_gpu_api(const SkString& value,
|
2020-08-26 19:27:03 +00:00
|
|
|
SkCommandLineConfigGpu::ContextType* outContextType,
|
|
|
|
bool* outFakeGLESVersion2) {
|
|
|
|
*outFakeGLESVersion2 = false;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
if (value.equals("gl")) {
|
2016-04-05 18:06:27 +00:00
|
|
|
*outContextType = GrContextFactory::kGL_ContextType;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("gles")) {
|
2016-04-05 18:06:27 +00:00
|
|
|
*outContextType = GrContextFactory::kGLES_ContextType;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-08-26 19:27:03 +00:00
|
|
|
if (value.equals("glesfakev2")) {
|
|
|
|
*outContextType = GrContextFactory::kGLES_ContextType;
|
|
|
|
*outFakeGLESVersion2 = true;
|
|
|
|
return true;
|
|
|
|
}
|
2016-10-14 15:13:48 +00:00
|
|
|
if (value.equals("angle_d3d9_es2")) {
|
|
|
|
*outContextType = GrContextFactory::kANGLE_D3D9_ES2_ContextType;
|
2016-09-29 16:49:06 +00:00
|
|
|
return true;
|
|
|
|
}
|
2016-10-14 15:13:48 +00:00
|
|
|
if (value.equals("angle_d3d11_es2")) {
|
|
|
|
*outContextType = GrContextFactory::kANGLE_D3D11_ES2_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("angle_d3d11_es3")) {
|
|
|
|
*outContextType = GrContextFactory::kANGLE_D3D11_ES3_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("angle_gl_es2")) {
|
|
|
|
*outContextType = GrContextFactory::kANGLE_GL_ES2_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("angle_gl_es3")) {
|
|
|
|
*outContextType = GrContextFactory::kANGLE_GL_ES3_ContextType;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-06-28 14:43:08 +00:00
|
|
|
if (value.equals("cmdbuffer_es2")) {
|
|
|
|
*outContextType = GrContextFactory::kCommandBuffer_ES2_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("cmdbuffer_es3")) {
|
|
|
|
*outContextType = GrContextFactory::kCommandBuffer_ES3_ContextType;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
2017-07-07 16:56:11 +00:00
|
|
|
if (value.equals("mock")) {
|
|
|
|
*outContextType = GrContextFactory::kMock_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
2016-04-11 21:21:33 +00:00
|
|
|
#ifdef SK_VULKAN
|
|
|
|
if (value.equals("vulkan")) {
|
|
|
|
*outContextType = GrContextFactory::kVulkan_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
2017-07-13 19:34:56 +00:00
|
|
|
#endif
|
|
|
|
#ifdef SK_METAL
|
|
|
|
if (value.equals("metal")) {
|
|
|
|
*outContextType = GrContextFactory::kMetal_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
2019-07-18 15:43:45 +00:00
|
|
|
#endif
|
2020-02-19 19:57:58 +00:00
|
|
|
#ifdef SK_DIRECT3D
|
|
|
|
if (value.equals("direct3d")) {
|
|
|
|
*outContextType = GrContextFactory::kDirect3D_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
2019-07-18 15:43:45 +00:00
|
|
|
#ifdef SK_DAWN
|
|
|
|
if (value.equals("dawn")) {
|
|
|
|
*outContextType = GrContextFactory::kDawn_ContextType;
|
|
|
|
return true;
|
|
|
|
}
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
#endif
|
|
|
|
return false;
|
|
|
|
}
|
2018-03-09 14:01:53 +00:00
|
|
|
|
2021-08-23 17:37:53 +00:00
|
|
|
static bool parse_option_gpu_color(const SkString& value,
|
|
|
|
SkColorType* outColorType,
|
|
|
|
SkAlphaType* alphaType) {
|
2017-07-17 15:31:31 +00:00
|
|
|
// We always use premul unless the color type is 565.
|
|
|
|
*alphaType = kPremul_SkAlphaType;
|
|
|
|
|
2016-03-10 15:49:08 +00:00
|
|
|
if (value.equals("8888")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kRGBA_8888_SkColorType;
|
2018-03-22 14:01:16 +00:00
|
|
|
} else if (value.equals("888x")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kRGB_888x_SkColorType;
|
2019-03-21 17:00:11 +00:00
|
|
|
} else if (value.equals("bgra8")) {
|
|
|
|
*outColorType = kBGRA_8888_SkColorType;
|
2017-07-17 15:31:31 +00:00
|
|
|
} else if (value.equals("4444")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kARGB_4444_SkColorType;
|
2017-07-17 15:31:31 +00:00
|
|
|
} else if (value.equals("565")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kRGB_565_SkColorType;
|
|
|
|
*alphaType = kOpaque_SkAlphaType;
|
2018-03-02 16:01:10 +00:00
|
|
|
} else if (value.equals("1010102")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kRGBA_1010102_SkColorType;
|
2018-05-30 19:36:38 +00:00
|
|
|
} else if (value.equals("f16")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kRGBA_F16_SkColorType;
|
2019-03-06 18:40:40 +00:00
|
|
|
} else if (value.equals("f16norm")) {
|
2019-03-20 15:50:33 +00:00
|
|
|
*outColorType = kRGBA_F16Norm_SkColorType;
|
2018-05-30 19:36:38 +00:00
|
|
|
} else {
|
|
|
|
return false;
|
2016-03-10 15:49:08 +00:00
|
|
|
}
|
2018-05-30 19:36:38 +00:00
|
|
|
return true;
|
2016-03-10 15:49:08 +00:00
|
|
|
}
|
2018-03-09 14:01:53 +00:00
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
static bool parse_option_gpu_surf_type(const SkString& value,
|
2018-03-09 14:01:53 +00:00
|
|
|
SkCommandLineConfigGpu::SurfType* surfType) {
|
|
|
|
if (value.equals("default")) {
|
|
|
|
*surfType = SkCommandLineConfigGpu::SurfType::kDefault;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("betex")) {
|
|
|
|
*surfType = SkCommandLineConfigGpu::SurfType::kBackendTexture;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (value.equals("bert")) {
|
|
|
|
*surfType = SkCommandLineConfigGpu::SurfType::kBackendRenderTarget;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2018-03-02 21:54:21 +00:00
|
|
|
|
|
|
|
// Extended options take form --config item[key1=value1,key2=value2,...]
|
|
|
|
// Example: --config gpu[api=gl,color=8888]
|
|
|
|
class ExtendedOptions {
|
|
|
|
public:
|
|
|
|
ExtendedOptions(const SkString& optionsString, bool* outParseSucceeded) {
|
|
|
|
SkTArray<SkString> optionParts;
|
|
|
|
SkStrSplit(optionsString.c_str(), ",", kStrict_SkStrSplitMode, &optionParts);
|
|
|
|
for (int i = 0; i < optionParts.count(); ++i) {
|
|
|
|
SkTArray<SkString> keyValueParts;
|
|
|
|
SkStrSplit(optionParts[i].c_str(), "=", kStrict_SkStrSplitMode, &keyValueParts);
|
|
|
|
if (keyValueParts.count() != 2) {
|
|
|
|
*outParseSucceeded = false;
|
|
|
|
return;
|
|
|
|
}
|
2019-03-20 15:50:33 +00:00
|
|
|
const SkString& key = keyValueParts[0];
|
2018-03-02 21:54:21 +00:00
|
|
|
const SkString& value = keyValueParts[1];
|
|
|
|
if (fOptionsMap.find(key) == nullptr) {
|
|
|
|
fOptionsMap.set(key, value);
|
|
|
|
} else {
|
|
|
|
// Duplicate values are not allowed.
|
|
|
|
*outParseSucceeded = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*outParseSucceeded = true;
|
|
|
|
}
|
|
|
|
|
2021-08-12 14:51:48 +00:00
|
|
|
bool get_option_gpu_color(const char* optionKey,
|
|
|
|
SkColorType* outColorType,
|
|
|
|
SkAlphaType* alphaType,
|
|
|
|
bool optional = true) const {
|
2018-03-02 21:54:21 +00:00
|
|
|
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
|
|
|
|
if (optionValue == nullptr) {
|
|
|
|
return optional;
|
|
|
|
}
|
2021-08-12 14:51:48 +00:00
|
|
|
return parse_option_gpu_color(*optionValue, outColorType, alphaType);
|
2018-03-02 21:54:21 +00:00
|
|
|
}
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
bool get_option_gpu_api(const char* optionKey,
|
2018-03-02 21:54:21 +00:00
|
|
|
SkCommandLineConfigGpu::ContextType* outContextType,
|
2020-08-26 19:27:03 +00:00
|
|
|
bool* outFakeGLESVersion2,
|
2019-03-20 15:50:33 +00:00
|
|
|
bool optional = true) const {
|
2018-03-02 21:54:21 +00:00
|
|
|
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
|
|
|
|
if (optionValue == nullptr) {
|
|
|
|
return optional;
|
|
|
|
}
|
2020-08-26 19:27:03 +00:00
|
|
|
return parse_option_gpu_api(*optionValue, outContextType, outFakeGLESVersion2);
|
2018-03-02 21:54:21 +00:00
|
|
|
}
|
2018-03-09 14:01:53 +00:00
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
bool get_option_gpu_surf_type(const char* optionKey,
|
2018-03-09 14:01:53 +00:00
|
|
|
SkCommandLineConfigGpu::SurfType* outSurfType,
|
2019-03-20 15:50:33 +00:00
|
|
|
bool optional = true) const {
|
2018-03-09 14:01:53 +00:00
|
|
|
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
|
|
|
|
if (optionValue == nullptr) {
|
|
|
|
return optional;
|
|
|
|
}
|
|
|
|
return parse_option_gpu_surf_type(*optionValue, outSurfType);
|
|
|
|
}
|
2018-03-02 21:54:21 +00:00
|
|
|
|
|
|
|
bool get_option_int(const char* optionKey, int* outInt, bool optional = true) const {
|
|
|
|
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
|
|
|
|
if (optionValue == nullptr) {
|
|
|
|
return optional;
|
|
|
|
}
|
|
|
|
return parse_option_int(*optionValue, outInt);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool get_option_bool(const char* optionKey, bool* outBool, bool optional = true) const {
|
|
|
|
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
|
|
|
|
if (optionValue == nullptr) {
|
|
|
|
return optional;
|
|
|
|
}
|
|
|
|
return parse_option_bool(*optionValue, outBool);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkTHashMap<SkString, SkString> fOptionsMap;
|
|
|
|
};
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfigGpu::SkCommandLineConfigGpu(const SkString& tag,
|
|
|
|
const SkTArray<SkString>& viaParts,
|
|
|
|
ContextType contextType,
|
2020-08-26 19:27:03 +00:00
|
|
|
bool fakeGLESVersion2,
|
2021-03-17 02:49:15 +00:00
|
|
|
uint32_t surfaceFlags,
|
2019-03-20 15:50:33 +00:00
|
|
|
int samples,
|
|
|
|
SkColorType colorType,
|
|
|
|
SkAlphaType alphaType,
|
|
|
|
bool useStencilBuffers,
|
|
|
|
bool testThreading,
|
2019-04-03 17:04:16 +00:00
|
|
|
int testPersistentCache,
|
2019-09-06 18:42:43 +00:00
|
|
|
bool testPrecompile,
|
2020-02-19 19:14:47 +00:00
|
|
|
bool useDDLSink,
|
2020-06-15 17:12:32 +00:00
|
|
|
bool OOPRish,
|
2021-04-09 15:57:59 +00:00
|
|
|
bool reducedShaders,
|
2019-03-20 15:50:33 +00:00
|
|
|
SurfType surfType)
|
2018-03-02 21:54:21 +00:00
|
|
|
: SkCommandLineConfig(tag, SkString("gpu"), viaParts)
|
|
|
|
, fContextType(contextType)
|
|
|
|
, fContextOverrides(ContextOverrides::kNone)
|
2021-03-17 02:49:15 +00:00
|
|
|
, fSurfaceFlags(surfaceFlags)
|
2018-03-02 21:54:21 +00:00
|
|
|
, fSamples(samples)
|
|
|
|
, fColorType(colorType)
|
|
|
|
, fAlphaType(alphaType)
|
2018-03-09 14:01:53 +00:00
|
|
|
, fTestThreading(testThreading)
|
2018-07-11 19:32:05 +00:00
|
|
|
, fTestPersistentCache(testPersistentCache)
|
2019-09-06 18:42:43 +00:00
|
|
|
, fTestPrecompile(testPrecompile)
|
2020-02-19 19:14:47 +00:00
|
|
|
, fUseDDLSink(useDDLSink)
|
2020-06-15 17:12:32 +00:00
|
|
|
, fOOPRish(OOPRish)
|
2021-04-09 15:57:59 +00:00
|
|
|
, fReducedShaders(reducedShaders)
|
2018-03-09 14:01:53 +00:00
|
|
|
, fSurfType(surfType) {
|
2018-03-02 21:54:21 +00:00
|
|
|
if (!useStencilBuffers) {
|
|
|
|
fContextOverrides |= ContextOverrides::kAvoidStencilBuffers;
|
|
|
|
}
|
2020-08-26 19:27:03 +00:00
|
|
|
if (fakeGLESVersion2) {
|
|
|
|
fContextOverrides |= ContextOverrides::kFakeGLESVersionAs2;
|
|
|
|
}
|
2021-04-09 15:57:59 +00:00
|
|
|
if (reducedShaders) {
|
|
|
|
fContextOverrides |= ContextOverrides ::kReducedShaders;
|
|
|
|
}
|
2018-03-02 21:54:21 +00:00
|
|
|
}
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
const SkTArray<SkString>& vias,
|
2019-03-20 15:50:33 +00:00
|
|
|
const SkString& options) {
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
// Defaults for GPU backend.
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kGL_ContextType;
|
|
|
|
bool useDIText = false;
|
2021-03-18 03:10:17 +00:00
|
|
|
bool useDMSAA = false;
|
2019-03-20 15:50:33 +00:00
|
|
|
int samples = 1;
|
|
|
|
SkColorType colorType = kRGBA_8888_SkColorType;
|
|
|
|
SkAlphaType alphaType = kPremul_SkAlphaType;
|
|
|
|
bool useStencils = true;
|
|
|
|
bool testThreading = false;
|
2019-04-03 17:04:16 +00:00
|
|
|
int testPersistentCache = 0;
|
2019-09-06 18:42:43 +00:00
|
|
|
bool testPrecompile = false;
|
2020-02-19 19:14:47 +00:00
|
|
|
bool useDDLs = false;
|
2020-06-15 17:12:32 +00:00
|
|
|
bool ooprish = false;
|
2021-04-09 15:57:59 +00:00
|
|
|
bool reducedShaders = false;
|
2020-08-26 19:27:03 +00:00
|
|
|
bool fakeGLESVersion2 = false;
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfigGpu::SurfType surfType = SkCommandLineConfigGpu::SurfType::kDefault;
|
|
|
|
|
|
|
|
bool parseSucceeded = false;
|
2018-03-02 21:54:21 +00:00
|
|
|
ExtendedOptions extendedOptions(options, &parseSucceeded);
|
|
|
|
if (!parseSucceeded) {
|
|
|
|
return nullptr;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
}
|
2018-03-02 21:54:21 +00:00
|
|
|
|
|
|
|
bool validOptions =
|
2020-08-26 19:27:03 +00:00
|
|
|
extendedOptions.get_option_gpu_api("api", &contextType, &fakeGLESVersion2, false) &&
|
2018-03-02 21:54:21 +00:00
|
|
|
extendedOptions.get_option_bool("dit", &useDIText) &&
|
|
|
|
extendedOptions.get_option_int("samples", &samples) &&
|
2021-03-18 03:10:17 +00:00
|
|
|
extendedOptions.get_option_bool("dmsaa", &useDMSAA) &&
|
2021-08-12 14:51:48 +00:00
|
|
|
extendedOptions.get_option_gpu_color("color", &colorType, &alphaType) &&
|
2018-03-02 21:54:21 +00:00
|
|
|
extendedOptions.get_option_bool("stencils", &useStencils) &&
|
2018-03-09 14:01:53 +00:00
|
|
|
extendedOptions.get_option_bool("testThreading", &testThreading) &&
|
2019-04-03 17:04:16 +00:00
|
|
|
extendedOptions.get_option_int("testPersistentCache", &testPersistentCache) &&
|
2019-09-06 18:42:43 +00:00
|
|
|
extendedOptions.get_option_bool("testPrecompile", &testPrecompile) &&
|
2020-02-26 15:27:07 +00:00
|
|
|
extendedOptions.get_option_bool("useDDLSink", &useDDLs) &&
|
2020-06-15 17:12:32 +00:00
|
|
|
extendedOptions.get_option_bool("OOPRish", &ooprish) &&
|
2021-04-09 15:57:59 +00:00
|
|
|
extendedOptions.get_option_bool("reducedShaders", &reducedShaders) &&
|
2018-03-09 14:01:53 +00:00
|
|
|
extendedOptions.get_option_gpu_surf_type("surf", &surfType);
|
2018-03-02 21:54:21 +00:00
|
|
|
|
2018-07-11 19:32:05 +00:00
|
|
|
// testing threading and the persistent cache are mutually exclusive.
|
2019-04-03 17:04:16 +00:00
|
|
|
if (!validOptions || (testThreading && (testPersistentCache != 0))) {
|
2017-03-20 12:54:16 +00:00
|
|
|
return nullptr;
|
|
|
|
}
|
2018-03-02 21:54:21 +00:00
|
|
|
|
2021-03-17 02:49:15 +00:00
|
|
|
uint32_t surfaceFlags = 0;
|
|
|
|
if (useDIText) {
|
|
|
|
surfaceFlags |= SkSurfaceProps::kUseDeviceIndependentFonts_Flag;
|
|
|
|
}
|
2021-04-19 23:40:40 +00:00
|
|
|
if (useDMSAA) {
|
2021-07-13 17:54:22 +00:00
|
|
|
surfaceFlags |= SkSurfaceProps::kDynamicMSAA_Flag;
|
2021-04-19 23:40:40 +00:00
|
|
|
}
|
2021-03-17 02:49:15 +00:00
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
return new SkCommandLineConfigGpu(tag,
|
|
|
|
vias,
|
|
|
|
contextType,
|
2020-08-26 19:27:03 +00:00
|
|
|
fakeGLESVersion2,
|
2021-03-17 02:49:15 +00:00
|
|
|
surfaceFlags,
|
2019-03-20 15:50:33 +00:00
|
|
|
samples,
|
|
|
|
colorType,
|
|
|
|
alphaType,
|
|
|
|
useStencils,
|
|
|
|
testThreading,
|
|
|
|
testPersistentCache,
|
2019-09-06 18:42:43 +00:00
|
|
|
testPrecompile,
|
2020-02-19 19:14:47 +00:00
|
|
|
useDDLs,
|
2020-06-15 17:12:32 +00:00
|
|
|
ooprish,
|
2021-04-09 15:57:59 +00:00
|
|
|
reducedShaders,
|
2019-03-20 15:50:33 +00:00
|
|
|
surfType);
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
}
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfigSvg::SkCommandLineConfigSvg(const SkString& tag,
|
|
|
|
const SkTArray<SkString>& viaParts,
|
|
|
|
int pageIndex)
|
2018-03-02 21:54:21 +00:00
|
|
|
: SkCommandLineConfig(tag, SkString("svg"), viaParts), fPageIndex(pageIndex) {}
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
SkCommandLineConfigSvg* parse_command_line_config_svg(const SkString& tag,
|
2018-03-02 21:54:21 +00:00
|
|
|
const SkTArray<SkString>& vias,
|
2019-03-20 15:50:33 +00:00
|
|
|
const SkString& options) {
|
2018-03-02 21:54:21 +00:00
|
|
|
// Defaults for SVG backend.
|
|
|
|
int pageIndex = 0;
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
bool parseSucceeded = false;
|
2018-03-02 21:54:21 +00:00
|
|
|
ExtendedOptions extendedOptions(options, &parseSucceeded);
|
|
|
|
if (!parseSucceeded) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool validOptions = extendedOptions.get_option_int("page", &pageIndex);
|
|
|
|
|
|
|
|
if (!validOptions) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new SkCommandLineConfigSvg(tag, vias, pageIndex);
|
|
|
|
}
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
void ParseConfigs(const CommandLineFlags::StringArray& configs,
|
|
|
|
SkCommandLineConfigArray* outResult) {
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
outResult->reset();
|
|
|
|
for (int i = 0; i < configs.count(); ++i) {
|
2019-03-20 15:50:33 +00:00
|
|
|
SkString extendedBackend;
|
|
|
|
SkString extendedOptions;
|
|
|
|
SkString simpleBackend;
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
SkTArray<SkString> vias;
|
|
|
|
|
2019-03-20 15:50:33 +00:00
|
|
|
SkString tag(configs[i]);
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
SkTArray<SkString> parts;
|
2016-09-28 19:40:22 +00:00
|
|
|
SkStrSplit(tag.c_str(), "[", kStrict_SkStrSplitMode, &parts);
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
if (parts.count() == 2) {
|
|
|
|
SkTArray<SkString> parts2;
|
2016-09-28 19:40:22 +00:00
|
|
|
SkStrSplit(parts[1].c_str(), "]", kStrict_SkStrSplitMode, &parts2);
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
if (parts2.count() == 2 && parts2[1].isEmpty()) {
|
|
|
|
SkStrSplit(parts[0].c_str(), "-", kStrict_SkStrSplitMode, &vias);
|
|
|
|
if (vias.count()) {
|
|
|
|
extendedBackend = vias[vias.count() - 1];
|
|
|
|
vias.pop_back();
|
|
|
|
} else {
|
|
|
|
extendedBackend = parts[0];
|
|
|
|
}
|
|
|
|
extendedOptions = parts2[0];
|
2016-09-28 19:40:22 +00:00
|
|
|
simpleBackend.printf("%s[%s]", extendedBackend.c_str(), extendedOptions.c_str());
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (extendedBackend.isEmpty()) {
|
|
|
|
simpleBackend = tag;
|
|
|
|
SkStrSplit(tag.c_str(), "-", kStrict_SkStrSplitMode, &vias);
|
|
|
|
if (vias.count()) {
|
|
|
|
simpleBackend = vias[vias.count() - 1];
|
|
|
|
vias.pop_back();
|
|
|
|
}
|
|
|
|
for (auto& predefinedConfig : gPredefinedConfigs) {
|
|
|
|
if (simpleBackend.equals(predefinedConfig.predefinedConfig)) {
|
|
|
|
extendedBackend = predefinedConfig.backend;
|
|
|
|
extendedOptions = predefinedConfig.options;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SkCommandLineConfig* parsedConfig = nullptr;
|
|
|
|
if (extendedBackend.equals("gpu")) {
|
|
|
|
parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOptions);
|
|
|
|
}
|
2018-03-02 21:54:21 +00:00
|
|
|
if (extendedBackend.equals("svg")) {
|
|
|
|
parsedConfig = parse_command_line_config_svg(tag, vias, extendedOptions);
|
|
|
|
}
|
Add config options to run different GPU APIs to dm and nanobench
Add extended config specification form that can be used to run different
gpu backend with different APIs.
The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)
This replaces and removes the --gpuAPI flag.
All existing configs should still work.
Adds following documentation:
out/Debug/dm --help config
Flags:
--config: type: string default: 565 8888 gpu nonrendering
Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
xps or use extended form 'backend(option=value,...)'.
Extended form: 'backend(option=value,...)'
Possible backends and options:
gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
api type: string default: native.
Select graphics API to use with gpu backend.
Options:
native Use platform default OpenGL or OpenGL ES backend.
gl Use OpenGL.
gles Use OpenGL ES.
debug Use debug OpenGL.
null Use null OpenGL.
dit type: bool default: false.
Use device independent text.
nvpr type: bool default: false.
Use NV_path_rendering OpenGL and OpenGL ES extension.
samples type: int default: 0.
Use multisampling with N samples.
Predefined configs:
gpu = gpu()
msaa4 = gpu(samples=4)
msaa16 = gpu(samples=16)
nvprmsaa4 = gpu(nvpr=true,samples=4)
nvprmsaa16 = gpu(nvpr=true,samples=16)
gpudft = gpu(dit=true)
gpudebug = gpu(api=debug)
gpunull = gpu(api=null)
debug = gpu(api=debug)
nullgpu = gpu(api=null)
BUG=skia:2992
Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd
Review URL: https://codereview.chromium.org/1490113005
2015-12-23 09:33:00 +00:00
|
|
|
if (!parsedConfig) {
|
|
|
|
parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias);
|
|
|
|
}
|
|
|
|
outResult->emplace_back(parsedConfig);
|
|
|
|
}
|
|
|
|
}
|