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(preAbandonGpuContext);
     24 DECLARE_bool(abandonGpuContext);
     25 DECLARE_bool(releaseAndAbandonGpuContext);
     26 DECLARE_string(skps);
     27 DECLARE_bool(ddl);
     28 DECLARE_string(jsons);
     29 DECLARE_string(svgs);
     30 DECLARE_int32(threads);
     31 DECLARE_string(resourcePath);
     32 DECLARE_bool(verbose);
     33 DECLARE_bool(veryVerbose);
     34 DECLARE_string(writePath);
     35 DECLARE_bool(pre_log);
     36 DECLARE_bool(analyticAA);
     37 DECLARE_bool(forceAnalyticAA);
     38 DECLARE_bool(deltaAA);
     39 DECLARE_bool(forceDeltaAA);
     40 DECLARE_string(key);
     41 DECLARE_string(properties);
     42 
     43 /**
     44  *  Helper to assist in collecting image paths from |dir| specified through a command line flag.
     45  *
     46  *  Populates |output|, an array of strings with paths to images to test.
     47  *
     48  *  Returns true if each argument to the images flag is meaningful:
     49  *  - If the file/directory does not exist, return false.
     50  *  - If |dir| does not have any supported images (based on file type), return false.
     51  *  - If |dir| is a single file, assume the user is deliberately testing this image,
     52  *    regardless of file type.
     53  */
     54 bool CollectImages(SkCommandLineFlags::StringArray dir, SkTArray<SkString>* output);
     55 
     56 #endif
     57