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