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 /**
14  *  Helper to assist in collecting image paths from |dir| specified through a command line
15  * flag.
16  *
17  *  Populates |output|, an array of strings with paths to images to test.
18  *
19  *  Returns true if each argument to the images flag is meaningful:
20  *  - If the file/directory does not exist, return false.
21  *  - If |dir| does not have any supported images (based on file type), return false.
22  *  - If |dir| is a single file, assume the user is deliberately testing this image,
23  *    regardless of file type.
24  */
25 bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output);
26 
27 /**
28  *  Helper to set GrContextOptions from common GPU flags, including
29  *     --gpuThreads
30  *     --cachePathMasks
31  *     --allPathsVolatile
32  *     --(no)gs
33  *     --(no)ts
34  *     --maxTessellationSegments
35  *     --pr
36  *     --internalSamples
37  *     --disableDriverCorrectnessWorkarounds
38  *     --reduceOpsTaskSplitting
39  *     --dontReduceOpsTaskSplitting
40  */
41 void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
42 
43 /**
44  *  Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA.
45  */
46 void SetAnalyticAAFromCommonFlags();
47