caryclark | 17f0b6d | 2014-07-22 10:15:34 -0700 | [diff] [blame] | 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 | */ |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 7 | #pragma once |
caryclark | 17f0b6d | 2014-07-22 10:15:34 -0700 | [diff] [blame] | 8 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 9 | #include "include/core/SkString.h" |
| 10 | #include "include/private/SkTArray.h" |
| 11 | #include "tools/flags/CommandLineFlags.h" |
caryclark | 17f0b6d | 2014-07-22 10:15:34 -0700 | [diff] [blame] | 12 | |
scroggo | 8673714 | 2016-02-03 12:19:11 -0800 | [diff] [blame] | 13 | /** |
Mike Klein | 88544fb | 2019-03-20 10:50:33 -0500 | [diff] [blame] | 14 | * Helper to assist in collecting image paths from |dir| specified through a command line |
| 15 | * flag. |
scroggo | 8673714 | 2016-02-03 12:19:11 -0800 | [diff] [blame] | 16 | * |
msarett | 69deca8 | 2016-04-29 09:38:40 -0700 | [diff] [blame] | 17 | * Populates |output|, an array of strings with paths to images to test. |
scroggo | 8673714 | 2016-02-03 12:19:11 -0800 | [diff] [blame] | 18 | * |
msarett | 69deca8 | 2016-04-29 09:38:40 -0700 | [diff] [blame] | 19 | * Returns true if each argument to the images flag is meaningful: |
scroggo | 8673714 | 2016-02-03 12:19:11 -0800 | [diff] [blame] | 20 | * - If the file/directory does not exist, return false. |
msarett | 69deca8 | 2016-04-29 09:38:40 -0700 | [diff] [blame] | 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. |
scroggo | 8673714 | 2016-02-03 12:19:11 -0800 | [diff] [blame] | 24 | */ |
Mike Klein | 88544fb | 2019-03-20 10:50:33 -0500 | [diff] [blame] | 25 | bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output); |
scroggo | 8673714 | 2016-02-03 12:19:11 -0800 | [diff] [blame] | 26 | |
Mike Klein | 4932a5e | 2019-03-22 11:08:02 -0500 | [diff] [blame] | 27 | /** |
| 28 | * Helper to set GrContextOptions from common GPU flags, including |
| 29 | * --gpuThreads |
| 30 | * --cachePathMasks |
| 31 | * --noGS |
| 32 | * --pr |
| 33 | * --disableDriverCorrectnessWorkarounds |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 34 | * --reduceOpsTaskSplitting |
| 35 | * --dontReduceOpsTaskSplitting |
Mike Klein | 4932a5e | 2019-03-22 11:08:02 -0500 | [diff] [blame] | 36 | */ |
| 37 | void SetCtxOptionsFromCommonFlags(struct GrContextOptions*); |
| 38 | |
Mike Klein | 03fa5d4 | 2019-03-22 11:39:09 -0500 | [diff] [blame] | 39 | /** |
| 40 | * Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA. |
| 41 | */ |
| 42 | void SetAnalyticAAFromCommonFlags(); |