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 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 | 9 |
10 #include "SkDifferentPixelsMetric.h" | 10 #include "SkDifferentPixelsMetric.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 cl_mem baseline; | 40 cl_mem baseline; |
41 cl_mem test; | 41 cl_mem test; |
42 cl_mem resultsBuffer; | 42 cl_mem resultsBuffer; |
43 cl_mem poiBuffer; | 43 cl_mem poiBuffer; |
44 }; | 44 }; |
45 | 45 |
46 const char* SkDifferentPixelsMetric::getName() { | 46 const char* SkDifferentPixelsMetric::getName() { |
47 return "different_pixels"; | 47 return "different_pixels"; |
48 } | 48 } |
49 | 49 |
| 50 bool SkDifferentPixelsMetric::enablePOIAlphaMask() { |
| 51 return false; |
| 52 } |
| 53 |
50 int SkDifferentPixelsMetric::queueDiff(SkBitmap* baseline, SkBitmap* test) { | 54 int SkDifferentPixelsMetric::queueDiff(SkBitmap* baseline, SkBitmap* test) { |
51 int diffID = fQueuedDiffs.count(); | 55 int diffID = fQueuedDiffs.count(); |
52 double startTime = get_seconds(); | 56 double startTime = get_seconds(); |
53 QueuedDiff* diff = fQueuedDiffs.push(); | 57 QueuedDiff* diff = fQueuedDiffs.push(); |
54 | 58 |
55 // If we never end up running the kernel, include some safe defaults in the
result. | 59 // If we never end up running the kernel, include some safe defaults in the
result. |
56 diff->finished = false; | 60 diff->finished = false; |
57 diff->result = -1.0; | 61 diff->result = -1.0; |
58 diff->numDiffPixels = 0; | 62 diff->numDiffPixels = 0; |
59 diff->poi = NULL; | 63 diff->poi = NULL; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return fQueuedDiffs[id].poi; | 165 return fQueuedDiffs[id].poi; |
162 } | 166 } |
163 | 167 |
164 bool SkDifferentPixelsMetric::onInit() { | 168 bool SkDifferentPixelsMetric::onInit() { |
165 if (!this->loadKernelSource(kDifferentPixelsKernelSource, "diff", &fKernel))
{ | 169 if (!this->loadKernelSource(kDifferentPixelsKernelSource, "diff", &fKernel))
{ |
166 return false; | 170 return false; |
167 } | 171 } |
168 | 172 |
169 return true; | 173 return true; |
170 } | 174 } |
OLD | NEW |