OLD | NEW |
---|---|
(Empty) | |
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 SkDifferentPixelsMetric_DEFINED | |
9 #define SkDifferentPixelsMetric_DEFINED | |
10 | |
11 #include "SkTDArray.h" | |
12 | |
13 #include "SkCLImageDiffer.h" | |
djsollen
2013/07/16 20:11:46
remove this
| |
14 | |
15 #if SK_SUPPORT_OPENCL | |
16 #include "SkCLImageDiffer.h" | |
17 #else | |
18 #include "SkImageDiffer.h" | |
19 #endif | |
20 | |
21 /** | |
22 * A differ that measures the percentage of different corresponding pixels. If t he two images are | |
23 * not the same size or have no pixels, the result will always be zero. | |
24 */ | |
25 class SkDifferentPixelsMetric : | |
26 #if SK_SUPPORT_OPENCL | |
27 public SkCLImageDiffer { | |
djsollen
2013/07/16 19:45:10
this seems backward. Shouldn't CL and the CPU dif
Zach Reizner
2013/07/16 19:58:32
I made it so that both versions are the metric, an
| |
28 #else | |
29 public SkImageDiffer { | |
30 #endif | |
31 public: | |
32 virtual const char* getName() SK_OVERRIDE; | |
33 virtual int queueDiff(SkBitmap* baseline, SkBitmap* test) SK_OVERRIDE; | |
34 virtual void deleteDiff(int id) SK_OVERRIDE; | |
35 virtual bool isFinished(int id) SK_OVERRIDE; | |
36 virtual double getResult(int id) SK_OVERRIDE; | |
37 virtual int getPointsOfInterestCount(int id) SK_OVERRIDE; | |
38 virtual SkIPoint* getPointsOfInterest(int id) SK_OVERRIDE; | |
39 | |
40 protected: | |
41 #if SK_SUPPORT_OPENCL | |
42 virtual bool onInit() SK_OVERRIDE; | |
43 #endif | |
44 | |
45 private: | |
46 struct QueuedDiff; | |
47 | |
48 SkTDArray<QueuedDiff> fQueuedDiffs; | |
49 | |
50 #if SK_SUPPORT_OPENCL | |
51 cl_kernel fKernel; | |
52 | |
53 typedef SkCLImageDiffer INHERITED; | |
54 #else | |
55 typedef SkImageDiffer INHERITED; | |
56 #endif | |
57 }; | |
58 | |
59 #endif | |
OLD | NEW |