blob: b713dabcd36780d0ab3f6c15bd85f8a95f6ddf97 [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"
Kevin Lubickdc6cc022023-01-13 11:24:27 -050010#include "include/private/base/SkTArray.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "tools/flags/CommandLineFlags.h"
caryclark17f0b6d2014-07-22 10:15:34 -070012
John Stilesb5e8e342023-08-22 14:59:00 -040013namespace skgpu::graphite {
14struct ContextOptions;
15};
16
Kevin Lubick8f4e5602021-10-14 09:50:00 -040017namespace CommonFlags {
scroggo86737142016-02-03 12:19:11 -080018/**
Mike Klein88544fb2019-03-20 10:50:33 -050019 * Helper to assist in collecting image paths from |dir| specified through a command line
20 * flag.
scroggo86737142016-02-03 12:19:11 -080021 *
msarett69deca82016-04-29 09:38:40 -070022 * Populates |output|, an array of strings with paths to images to test.
scroggo86737142016-02-03 12:19:11 -080023 *
msarett69deca82016-04-29 09:38:40 -070024 * Returns true if each argument to the images flag is meaningful:
scroggo86737142016-02-03 12:19:11 -080025 * - If the file/directory does not exist, return false.
msarett69deca82016-04-29 09:38:40 -070026 * - If |dir| does not have any supported images (based on file type), return false.
27 * - If |dir| is a single file, assume the user is deliberately testing this image,
28 * regardless of file type.
scroggo86737142016-02-03 12:19:11 -080029 */
John Stiles26bf5222023-10-17 10:29:41 -040030bool CollectImages(const CommandLineFlags::StringArray& dir,
31 skia_private::TArray<SkString>* output);
Mike Klein4932a5e2019-03-22 11:08:02 -050032/**
33 * Helper to set GrContextOptions from common GPU flags, including
34 * --gpuThreads
35 * --cachePathMasks
Chris Daltond1e67162020-09-23 11:55:27 -060036 * --allPathsVolatile
Chris Daltoned6e8272020-04-23 11:44:26 -060037 * --(no)gs
38 * --(no)ts
Mike Klein4932a5e2019-03-22 11:08:02 -050039 * --pr
Chris Dalton52586232019-12-27 13:47:25 -070040 * --internalSamples
Mike Klein4932a5e2019-03-22 11:08:02 -050041 * --disableDriverCorrectnessWorkarounds
Greg Danielf41b2bd2019-08-22 16:19:24 -040042 * --reduceOpsTaskSplitting
43 * --dontReduceOpsTaskSplitting
James Godfrey-Kittle160bf902022-11-15 16:47:45 -050044 * --allowMSAAOnNewIntel
Mike Klein4932a5e2019-03-22 11:08:02 -050045 */
Kevin Lubick8f4e5602021-10-14 09:50:00 -040046void SetCtxOptions(struct GrContextOptions*);
Mike Klein4932a5e2019-03-22 11:08:02 -050047
Kevin Lubick8f4e5602021-10-14 09:50:00 -040048} // namespace CommonFlags