blob: 83ed0835968db4a2a66f4ef466b3900711c02090 [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 */
Mike Kleinc6142d82019-03-25 10:54:59 -05007#pragma once
caryclark17f0b6d2014-07-22 10:15:34 -07008
Mike Kleinc0bd9f92019-04-23 12:05:21 -05009#include "include/core/SkString.h"
10#include "include/private/SkTArray.h"
11#include "tools/flags/CommandLineFlags.h"
caryclark17f0b6d2014-07-22 10:15:34 -070012
scroggo86737142016-02-03 12:19:11 -080013/**
Mike Klein88544fb2019-03-20 10:50:33 -050014 * Helper to assist in collecting image paths from |dir| specified through a command line
15 * flag.
scroggo86737142016-02-03 12:19:11 -080016 *
msarett69deca82016-04-29 09:38:40 -070017 * Populates |output|, an array of strings with paths to images to test.
scroggo86737142016-02-03 12:19:11 -080018 *
msarett69deca82016-04-29 09:38:40 -070019 * Returns true if each argument to the images flag is meaningful:
scroggo86737142016-02-03 12:19:11 -080020 * - If the file/directory does not exist, return false.
msarett69deca82016-04-29 09:38:40 -070021 * - 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.
scroggo86737142016-02-03 12:19:11 -080024 */
Mike Klein88544fb2019-03-20 10:50:33 -050025bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output);
scroggo86737142016-02-03 12:19:11 -080026
Mike Klein4932a5e2019-03-22 11:08:02 -050027/**
28 * Helper to set GrContextOptions from common GPU flags, including
29 * --gpuThreads
30 * --cachePathMasks
31 * --noGS
32 * --pr
33 * --disableDriverCorrectnessWorkarounds
Greg Danielf41b2bd2019-08-22 16:19:24 -040034 * --reduceOpsTaskSplitting
35 * --dontReduceOpsTaskSplitting
Mike Klein4932a5e2019-03-22 11:08:02 -050036 */
37void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
38
Mike Klein03fa5d42019-03-22 11:39:09 -050039/**
40 * Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA.
41 */
42void SetAnalyticAAFromCommonFlags();