2014-07-22 17:15:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2019-03-25 15:54:59 +00:00
|
|
|
#pragma once
|
2014-07-22 17:15:34 +00:00
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkString.h"
|
|
|
|
#include "include/private/SkTArray.h"
|
|
|
|
#include "tools/flags/CommandLineFlags.h"
|
2014-07-22 17:15:34 +00:00
|
|
|
|
2016-02-03 20:19:11 +00:00
|
|
|
/**
|
2019-03-20 15:50:33 +00:00
|
|
|
* Helper to assist in collecting image paths from |dir| specified through a command line
|
|
|
|
* flag.
|
2016-02-03 20:19:11 +00:00
|
|
|
*
|
2016-04-29 16:38:40 +00:00
|
|
|
* Populates |output|, an array of strings with paths to images to test.
|
2016-02-03 20:19:11 +00:00
|
|
|
*
|
2016-04-29 16:38:40 +00:00
|
|
|
* Returns true if each argument to the images flag is meaningful:
|
2016-02-03 20:19:11 +00:00
|
|
|
* - If the file/directory does not exist, return false.
|
2016-04-29 16:38:40 +00:00
|
|
|
* - If |dir| does not have any supported images (based on file type), return false.
|
|
|
|
* - If |dir| is a single file, assume the user is deliberately testing this image,
|
|
|
|
* regardless of file type.
|
2016-02-03 20:19:11 +00:00
|
|
|
*/
|
2019-03-20 15:50:33 +00:00
|
|
|
bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output);
|
2016-02-03 20:19:11 +00:00
|
|
|
|
2019-03-22 16:08:02 +00:00
|
|
|
/**
|
|
|
|
* Helper to set GrContextOptions from common GPU flags, including
|
|
|
|
* --gpuThreads
|
|
|
|
* --cachePathMasks
|
|
|
|
* --noGS
|
|
|
|
* --pr
|
2019-12-27 20:47:25 +00:00
|
|
|
* --internalSamples
|
2019-03-22 16:08:02 +00:00
|
|
|
* --disableDriverCorrectnessWorkarounds
|
2019-08-22 20:19:24 +00:00
|
|
|
* --reduceOpsTaskSplitting
|
|
|
|
* --dontReduceOpsTaskSplitting
|
2019-03-22 16:08:02 +00:00
|
|
|
*/
|
|
|
|
void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
|
|
|
|
|
2019-03-22 16:39:09 +00:00
|
|
|
/**
|
|
|
|
* Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA.
|
|
|
|
*/
|
|
|
|
void SetAnalyticAAFromCommonFlags();
|