Home | History | Annotate | Download | only in flags
      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  */
      7 
      8 #ifndef SK_COMMON_FLAGS_H
      9 #define SK_COMMON_FLAGS_H
     10 
     11 #include "../private/SkTArray.h"
     12 #include "SkCommandLineFlags.h"
     13 #include "SkString.h"
     14 
     15 DECLARE_bool(cpu);
     16 DECLARE_bool(dryRun);
     17 DECLARE_bool(gpu);
     18 DECLARE_string(images);
     19 DECLARE_string(colorImages);
     20 DECLARE_bool(simpleCodec);
     21 DECLARE_string(match);
     22 DECLARE_bool(quiet);
     23 DECLARE_bool(resetGpuContext);
     24 DECLARE_bool(preAbandonGpuContext);
     25 DECLARE_bool(abandonGpuContext);
     26 DECLARE_bool(releaseAndAbandonGpuContext);
     27 DECLARE_string(skps);
     28 DECLARE_string(svgs);
     29 DECLARE_int32(threads);
     30 DECLARE_string(resourcePath);
     31 DECLARE_bool(verbose);
     32 DECLARE_bool(veryVerbose);
     33 DECLARE_string(writePath);
     34 DECLARE_bool(pre_log);
     35 DECLARE_bool(analyticAA);
     36 DECLARE_bool(forceAnalyticAA);
     37 
     38 DECLARE_string(key);
     39 DECLARE_string(properties);
     40 
     41 /**
     42  *  Helper to assist in collecting image paths from |dir| specified through a command line flag.
     43  *
     44  *  Populates |output|, an array of strings with paths to images to test.
     45  *
     46  *  Returns true if each argument to the images flag is meaningful:
     47  *  - If the file/directory does not exist, return false.
     48  *  - If |dir| does not have any supported images (based on file type), return false.
     49  *  - If |dir| is a single file, assume the user is deliberately testing this image,
     50  *    regardless of file type.
     51  */
     52 bool CollectImages(SkCommandLineFlags::StringArray dir, SkTArray<SkString>* output);
     53 
     54 #endif
     55