commit-bot@chromium.org | be19b9e | 2013-06-14 17:26:54 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 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 skpdiff_util_DEFINED |
| 9 | #define skpdiff_util_DEFINED |
| 10 | |
commit-bot@chromium.org | be19b9e | 2013-06-14 17:26:54 +0000 | [diff] [blame] | 11 | #include "SkString.h" |
| 12 | #include "SkTArray.h" |
| 13 | |
zachr@google.com | d658568 | 2013-07-17 19:29:19 +0000 | [diff] [blame] | 14 | #if SK_SUPPORT_OPENCL |
zachr@google.com | 35f02fb | 2013-07-22 17:05:24 +0000 | [diff] [blame] | 15 | #if SK_BUILD_FOR_MAC |
| 16 | # include <OpenCL/cl.h> |
| 17 | #else |
| 18 | # include <CL/cl.h> |
| 19 | #endif |
| 20 | |
commit-bot@chromium.org | be19b9e | 2013-06-14 17:26:54 +0000 | [diff] [blame] | 21 | /** |
| 22 | * Converts an OpenCL error number into the string of its enumeration name. |
| 23 | * @param err The OpenCL error number |
| 24 | * @return The string of the name of the error; "UNKOWN" if the error number is invalid |
| 25 | */ |
| 26 | const char* cl_error_to_string(cl_int err); |
zachr@google.com | d658568 | 2013-07-17 19:29:19 +0000 | [diff] [blame] | 27 | #endif |
commit-bot@chromium.org | be19b9e | 2013-06-14 17:26:54 +0000 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Get a positive monotonic real-time measure of the amount of seconds since some undefined epoch. |
| 31 | * Maximum precision is the goal of this routine. |
| 32 | * @return Amount of time in seconds since some epoch |
| 33 | */ |
| 34 | double get_seconds(); |
| 35 | |
| 36 | /** |
| 37 | * Get file entries of the given directory. |
| 38 | * @param path A path to a directory to enumerate |
| 39 | * @param entries A vector to return the results into |
| 40 | * @return True on success, false otherwise |
| 41 | */ |
| 42 | bool get_directory(const char path[], SkTArray<SkString>* entries); |
| 43 | |
zachr@google.com | 18bbba9 | 2013-06-26 18:55:36 +0000 | [diff] [blame] | 44 | /** |
| 45 | * Gets the files that match the specified pattern in sorted order. |
| 46 | * @param globPattern The pattern to use. Patterns must be valid paths, optionally with wildcards (*) |
| 47 | * @param entries An array to return the results into |
| 48 | * @return True on success, false otherwise |
| 49 | */ |
| 50 | bool glob_files(const char globPattern[], SkTArray<SkString>* entries); |
| 51 | |
zachr@google.com | a479aa1 | 2013-08-02 15:54:30 +0000 | [diff] [blame] | 52 | /** |
| 53 | * Gets the absolute version of the given path. |
| 54 | * @param path The absolute or relative path to expand |
| 55 | * @return The absolute path of the given path on success, or an empty string on failure. |
| 56 | */ |
| 57 | SkString get_absolute_path(const SkString& path); |
| 58 | |
commit-bot@chromium.org | be19b9e | 2013-06-14 17:26:54 +0000 | [diff] [blame] | 59 | |
| 60 | #endif |