1cb93a386Sopenharmony_ci/* 2cb93a386Sopenharmony_ci * Copyright 2014 Google Inc. 3cb93a386Sopenharmony_ci * 4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be 5cb93a386Sopenharmony_ci * found in the LICENSE file. 6cb93a386Sopenharmony_ci */ 7cb93a386Sopenharmony_ci#pragma once 8cb93a386Sopenharmony_ci 9cb93a386Sopenharmony_ci#include "include/core/SkString.h" 10cb93a386Sopenharmony_ci#include "include/private/SkTArray.h" 11cb93a386Sopenharmony_ci#include "tools/flags/CommandLineFlags.h" 12cb93a386Sopenharmony_ci 13cb93a386Sopenharmony_cinamespace CommonFlags { 14cb93a386Sopenharmony_ci/** 15cb93a386Sopenharmony_ci * Helper to assist in collecting image paths from |dir| specified through a command line 16cb93a386Sopenharmony_ci * flag. 17cb93a386Sopenharmony_ci * 18cb93a386Sopenharmony_ci * Populates |output|, an array of strings with paths to images to test. 19cb93a386Sopenharmony_ci * 20cb93a386Sopenharmony_ci * Returns true if each argument to the images flag is meaningful: 21cb93a386Sopenharmony_ci * - If the file/directory does not exist, return false. 22cb93a386Sopenharmony_ci * - If |dir| does not have any supported images (based on file type), return false. 23cb93a386Sopenharmony_ci * - If |dir| is a single file, assume the user is deliberately testing this image, 24cb93a386Sopenharmony_ci * regardless of file type. 25cb93a386Sopenharmony_ci */ 26cb93a386Sopenharmony_cibool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output); 27cb93a386Sopenharmony_ci 28cb93a386Sopenharmony_ci/** 29cb93a386Sopenharmony_ci * Helper to set GrContextOptions from common GPU flags, including 30cb93a386Sopenharmony_ci * --gpuThreads 31cb93a386Sopenharmony_ci * --cachePathMasks 32cb93a386Sopenharmony_ci * --allPathsVolatile 33cb93a386Sopenharmony_ci * --(no)gs 34cb93a386Sopenharmony_ci * --(no)ts 35cb93a386Sopenharmony_ci * --maxTessellationSegments 36cb93a386Sopenharmony_ci * --pr 37cb93a386Sopenharmony_ci * --internalSamples 38cb93a386Sopenharmony_ci * --disableDriverCorrectnessWorkarounds 39cb93a386Sopenharmony_ci * --reduceOpsTaskSplitting 40cb93a386Sopenharmony_ci * --dontReduceOpsTaskSplitting 41cb93a386Sopenharmony_ci */ 42cb93a386Sopenharmony_civoid SetCtxOptions(struct GrContextOptions*); 43cb93a386Sopenharmony_ci 44cb93a386Sopenharmony_ci/** 45cb93a386Sopenharmony_ci * Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA. 46cb93a386Sopenharmony_ci */ 47cb93a386Sopenharmony_civoid SetAnalyticAA(); 48cb93a386Sopenharmony_ci 49cb93a386Sopenharmony_ci/** 50cb93a386Sopenharmony_ci * Turn on portable (--nonativeFonts) or GDI font rendering (--gdi). 51cb93a386Sopenharmony_ci */ 52cb93a386Sopenharmony_civoid SetDefaultFontMgr(); 53cb93a386Sopenharmony_ci 54cb93a386Sopenharmony_ci} // namespace CommonFlags 55