• 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(preAbandonGpuContext);
24 DECLARE_bool(abandonGpuContext);
25 DECLARE_bool(releaseAndAbandonGpuContext);
26 DECLARE_string(skps);
27 DECLARE_int32(skpViewportSize);
28 DECLARE_string(jpgs);
29 DECLARE_string(lotties);
30 DECLARE_string(svgs);
31 DECLARE_string(nimas);
32 DECLARE_bool(nativeFonts);
33 DECLARE_int32(threads);
34 DECLARE_string(resourcePath);
35 DECLARE_bool(verbose);
36 DECLARE_bool(veryVerbose);
37 DECLARE_string(writePath);
38 DECLARE_bool(pre_log);
39 DECLARE_bool(analyticAA);
40 DECLARE_bool(forceAnalyticAA);
41 DECLARE_bool(deltaAA);
42 DECLARE_bool(forceDeltaAA);
43 DECLARE_string(key);
44 DECLARE_string(properties);
45 DECLARE_int32(backendTiles);
46 DECLARE_int32(backendThreads)
47 
48 /**
49  *  Helper to assist in collecting image paths from |dir| specified through a command line flag.
50  *
51  *  Populates |output|, an array of strings with paths to images to test.
52  *
53  *  Returns true if each argument to the images flag is meaningful:
54  *  - If the file/directory does not exist, return false.
55  *  - If |dir| does not have any supported images (based on file type), return false.
56  *  - If |dir| is a single file, assume the user is deliberately testing this image,
57  *    regardless of file type.
58  */
59 bool CollectImages(SkCommandLineFlags::StringArray dir, SkTArray<SkString>* output);
60 
61 #endif
62