blob: 93090f61632c4cb9e58f9578f981741f393e3131 [file] [log] [blame]
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +00001/*
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.orgbe19b9e2013-06-14 17:26:54 +000011#include "SkString.h"
12#include "SkTArray.h"
13
zachr@google.comd6585682013-07-17 19:29:19 +000014#if SK_SUPPORT_OPENCL
zachr@google.com904f86e2013-07-22 13:29:20 +000015#include <CL/cl.h>
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +000016/**
17 * Converts an OpenCL error number into the string of its enumeration name.
18 * @param err The OpenCL error number
19 * @return The string of the name of the error; "UNKOWN" if the error number is invalid
20 */
21const char* cl_error_to_string(cl_int err);
zachr@google.comd6585682013-07-17 19:29:19 +000022#endif
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +000023
24/**
25 * Get a positive monotonic real-time measure of the amount of seconds since some undefined epoch.
26 * Maximum precision is the goal of this routine.
27 * @return Amount of time in seconds since some epoch
28 */
29double get_seconds();
30
31/**
32 * Get file entries of the given directory.
33 * @param path A path to a directory to enumerate
34 * @param entries A vector to return the results into
35 * @return True on success, false otherwise
36 */
37bool get_directory(const char path[], SkTArray<SkString>* entries);
38
zachr@google.com18bbba92013-06-26 18:55:36 +000039/**
40 * Gets the files that match the specified pattern in sorted order.
41 * @param globPattern The pattern to use. Patterns must be valid paths, optionally with wildcards (*)
42 * @param entries An array to return the results into
43 * @return True on success, false otherwise
44 */
45bool glob_files(const char globPattern[], SkTArray<SkString>* entries);
46
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +000047
48#endif