| 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 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 cl_device_id fDevice; | 79 cl_device_id fDevice; |
| 80 cl_context fContext; | 80 cl_context fContext; |
| 81 cl_command_queue fCommandQueue; | 81 cl_command_queue fCommandQueue; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 | 84 |
| 85 typedef SkImageDiffer INHERITED; | 85 typedef SkImageDiffer INHERITED; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 /** | |
| 89 * A OpenCL differ that measures the percentage of different corresponding pixel
s. If the two images | |
| 90 * are not the same size or have no pixels, the result will always be zero. | |
| 91 */ | |
| 92 class SkDifferentPixelsImageDiffer : public SkCLImageDiffer { | |
| 93 public: | |
| 94 virtual const char* getName() SK_OVERRIDE; | |
| 95 virtual int queueDiff(SkBitmap* baseline, SkBitmap* test) SK_OVERRIDE; | |
| 96 virtual void deleteDiff(int id) SK_OVERRIDE; | |
| 97 virtual bool isFinished(int id) SK_OVERRIDE; | |
| 98 virtual double getResult(int id) SK_OVERRIDE; | |
| 99 virtual int getPointsOfInterestCount(int id) SK_OVERRIDE; | |
| 100 virtual SkIPoint* getPointsOfInterest(int id) SK_OVERRIDE; | |
| 101 | |
| 102 protected: | |
| 103 virtual bool onInit() SK_OVERRIDE; | |
| 104 | |
| 105 private: | |
| 106 struct QueuedDiff; | |
| 107 | |
| 108 SkTDArray<QueuedDiff> fQueuedDiffs; | |
| 109 cl_kernel fKernel; | |
| 110 | |
| 111 typedef SkCLImageDiffer INHERITED; | |
| 112 }; | |
| 113 | |
| 114 #endif | 88 #endif |
| OLD | NEW |