blob: 04e46b0f5a9dcb565c4e316a8b95170a1ed6ece0 [file] [log] [blame]
caryclark17f0b6d2014-07-22 10:15:34 -07001/*
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
bungemanbf521ff2016-02-17 13:13:44 -080011#include "../private/SkTArray.h"
Mike Klein88544fb2019-03-20 10:50:33 -050012#include "CommandLineFlags.h"
scroggo86737142016-02-03 12:19:11 -080013#include "SkString.h"
caryclark17f0b6d2014-07-22 10:15:34 -070014
caryclark17f0b6d2014-07-22 10:15:34 -070015DECLARE_bool(cpu);
16DECLARE_bool(dryRun);
17DECLARE_bool(gpu);
msarett95f192d2015-02-13 09:05:41 -080018DECLARE_string(images);
msarettdb197a52016-06-21 09:44:29 -070019DECLARE_bool(simpleCodec);
caryclark17f0b6d2014-07-22 10:15:34 -070020DECLARE_string(match);
21DECLARE_bool(quiet);
mtklein92007582014-08-01 07:46:52 -070022DECLARE_string(skps);
Eric Boren8c172ba2018-07-19 13:27:49 -040023DECLARE_string(lotties);
fmalita95573e42016-09-14 09:05:43 -070024DECLARE_string(svgs);
Ben Wagner483c7722018-02-20 17:06:07 -050025DECLARE_bool(nativeFonts);
Mike Klein5b3f3432019-03-21 11:42:21 -050026DECLARE_int(threads);
caryclark17f0b6d2014-07-22 10:15:34 -070027DECLARE_string(resourcePath);
28DECLARE_bool(verbose);
29DECLARE_bool(veryVerbose);
mtkleinb5110422014-08-07 15:20:02 -070030DECLARE_string(writePath);
liyuqian38911a72016-10-04 11:23:22 -070031DECLARE_bool(analyticAA);
Yuqian Li550148b2017-01-13 10:13:13 -050032DECLARE_bool(forceAnalyticAA);
mtkleinea65bfa2014-09-09 07:59:46 -070033DECLARE_string(key);
34DECLARE_string(properties);
35
scroggo86737142016-02-03 12:19:11 -080036/**
Mike Klein88544fb2019-03-20 10:50:33 -050037 * Helper to assist in collecting image paths from |dir| specified through a command line
38 * flag.
scroggo86737142016-02-03 12:19:11 -080039 *
msarett69deca82016-04-29 09:38:40 -070040 * Populates |output|, an array of strings with paths to images to test.
scroggo86737142016-02-03 12:19:11 -080041 *
msarett69deca82016-04-29 09:38:40 -070042 * Returns true if each argument to the images flag is meaningful:
scroggo86737142016-02-03 12:19:11 -080043 * - If the file/directory does not exist, return false.
msarett69deca82016-04-29 09:38:40 -070044 * - If |dir| does not have any supported images (based on file type), return false.
45 * - If |dir| is a single file, assume the user is deliberately testing this image,
46 * regardless of file type.
scroggo86737142016-02-03 12:19:11 -080047 */
Mike Klein88544fb2019-03-20 10:50:33 -050048bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output);
scroggo86737142016-02-03 12:19:11 -080049
Mike Klein4932a5e2019-03-22 11:08:02 -050050/**
51 * Helper to set GrContextOptions from common GPU flags, including
52 * --gpuThreads
53 * --cachePathMasks
54 * --noGS
55 * --pr
56 * --disableDriverCorrectnessWorkarounds
57 * --reduceOpListSplitting
58 */
59void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
60
caryclark17f0b6d2014-07-22 10:15:34 -070061#endif