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