• 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 
8 #ifndef SK_COMMON_FLAGS_H
9 #define SK_COMMON_FLAGS_H
10 
11 #include "../private/SkTArray.h"
12 #include "SkCommandLineFlags.h"
13 #include "SkString.h"
14 
15 DECLARE_bool(cpu);
16 DECLARE_bool(dryRun);
17 DECLARE_bool(gpu);
18 DECLARE_string(images);
19 DECLARE_string(colorImages);
20 DECLARE_bool(simpleCodec);
21 DECLARE_string(match);
22 DECLARE_bool(quiet);
23 DECLARE_bool(resetGpuContext);
24 DECLARE_bool(preAbandonGpuContext);
25 DECLARE_bool(abandonGpuContext);
26 DECLARE_bool(releaseAndAbandonGpuContext);
27 DECLARE_string(skps);
28 DECLARE_string(svgs);
29 DECLARE_int32(threads);
30 DECLARE_string(resourcePath);
31 DECLARE_bool(verbose);
32 DECLARE_bool(veryVerbose);
33 DECLARE_string(writePath);
34 DECLARE_bool(pre_log);
35 DECLARE_bool(analyticAA);
36 DECLARE_bool(forceAnalyticAA);
37 DECLARE_bool(trace)
38 
39 DECLARE_string(key);
40 DECLARE_string(properties);
41 
42 /**
43  *  Helper to assist in collecting image paths from |dir| specified through a command line flag.
44  *
45  *  Populates |output|, an array of strings with paths to images to test.
46  *
47  *  Returns true if each argument to the images flag is meaningful:
48  *  - If the file/directory does not exist, return false.
49  *  - If |dir| does not have any supported images (based on file type), return false.
50  *  - If |dir| is a single file, assume the user is deliberately testing this image,
51  *    regardless of file type.
52  */
53 bool CollectImages(SkCommandLineFlags::StringArray dir, SkTArray<SkString>* output);
54 
55 #endif
56