• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2014 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 #pragma once
8 
9 #include "include/core/SkString.h"
10 #include "include/private/SkTArray.h"
11 #include "tools/flags/CommandLineFlags.h"
12 
13 namespace CommonFlags {
14 /**
15  *  Helper to assist in collecting image paths from |dir| specified through a command line
16  * flag.
17  *
18  *  Populates |output|, an array of strings with paths to images to test.
19  *
20  *  Returns true if each argument to the images flag is meaningful:
21  *  - If the file/directory does not exist, return false.
22  *  - If |dir| does not have any supported images (based on file type), return false.
23  *  - If |dir| is a single file, assume the user is deliberately testing this image,
24  *    regardless of file type.
25  */
26 bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output);
27 
28 /**
29  *  Helper to set GrContextOptions from common GPU flags, including
30  *     --gpuThreads
31  *     --cachePathMasks
32  *     --allPathsVolatile
33  *     --(no)gs
34  *     --(no)ts
35  *     --maxTessellationSegments
36  *     --pr
37  *     --internalSamples
38  *     --disableDriverCorrectnessWorkarounds
39  *     --reduceOpsTaskSplitting
40  *     --dontReduceOpsTaskSplitting
41  */
42 void SetCtxOptions(struct GrContextOptions*);
43 
44 /**
45  *  Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA.
46  */
47 void SetAnalyticAA();
48 
49 /**
50  *  Turn on portable (--nonativeFonts) or GDI font rendering (--gdi).
51  */
52 void SetDefaultFontMgr();
53 
54 }  // namespace CommonFlags
55