| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkCLImageDiffer_DEFINED | 8 #ifndef SkCLImageDiffer_DEFINED |
| 9 #define SkCLImageDiffer_DEFINED | 9 #define SkCLImageDiffer_DEFINED |
| 10 | 10 |
| 11 #if defined(SK_BUILD_FOR_MAC) | 11 #if defined(SK_BUILD_FOR_MAC) |
| 12 # include <OpenCL/cl.h> | 12 # include <OpenCL/cl.h> |
| 13 #else | 13 #else |
| 14 # include <CL/cl.h> | 14 # include <CL/cl.h> |
| 15 #endif | 15 #endif |
| 16 #include "SkTDArray.h" | 16 #include "SkTDArray.h" |
| 17 | 17 |
| 18 #include "SkImageDiffer.h" | 18 #include "SkImageDiffer.h" |
| 19 | 19 |
| 20 class SkStream; | 20 class SkStream; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * An SkImageDiffer that requires initialization with an OpenCL device and conte
xt. | 23 * An SkImageDiffer that requires initialization with an OpenCL device and conte
xt. |
| 24 */ | 24 */ |
| 25 class SkCLImageDiffer : public SkImageDiffer { | 25 class SkCLImageDiffer : public SkImageDiffer { |
| 26 public: | 26 public: |
| 27 SkCLImageDiffer(); | 27 SkCLImageDiffer(); |
| 28 | 28 |
| 29 virtual bool requiresOpenCL() const SK_OVERRIDE { return true; } | 29 bool requiresOpenCL() const SK_OVERRIDE { return true; } |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Initializes the OpenCL resources this differ needs to work | 32 * Initializes the OpenCL resources this differ needs to work |
| 33 * @param device An OpenCL device | 33 * @param device An OpenCL device |
| 34 * @param context An OpenCL context of the given device | 34 * @param context An OpenCL context of the given device |
| 35 * @return True on success, false otherwise | 35 * @return True on success, false otherwise |
| 36 */ | 36 */ |
| 37 virtual bool init(cl_device_id device, cl_context context); | 37 virtual bool init(cl_device_id device, cl_context context); |
| 38 | 38 |
| 39 protected: | 39 protected: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 bool fIsGood; | 90 bool fIsGood; |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 | 93 |
| 94 typedef SkImageDiffer INHERITED; | 94 typedef SkImageDiffer INHERITED; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 #endif | 97 #endif |
| OLD | NEW |