CommonFlags.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #pragma once
  8. #include "include/core/SkString.h"
  9. #include "include/private/SkTArray.h"
  10. #include "tools/flags/CommandLineFlags.h"
  11. /**
  12. * Helper to assist in collecting image paths from |dir| specified through a command line
  13. * flag.
  14. *
  15. * Populates |output|, an array of strings with paths to images to test.
  16. *
  17. * Returns true if each argument to the images flag is meaningful:
  18. * - If the file/directory does not exist, return false.
  19. * - If |dir| does not have any supported images (based on file type), return false.
  20. * - If |dir| is a single file, assume the user is deliberately testing this image,
  21. * regardless of file type.
  22. */
  23. bool CollectImages(CommandLineFlags::StringArray dir, SkTArray<SkString>* output);
  24. /**
  25. * Helper to set GrContextOptions from common GPU flags, including
  26. * --gpuThreads
  27. * --cachePathMasks
  28. * --noGS
  29. * --pr
  30. * --disableDriverCorrectnessWorkarounds
  31. * --reduceOpListSplitting
  32. * --dontReduceOpListSplitting
  33. */
  34. void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
  35. /**
  36. * Enable, disable, or force analytic anti-aliasing using --analyticAA and --forceAnalyticAA.
  37. */
  38. void SetAnalyticAAFromCommonFlags();