| zachr@google.com | c0a75a8 | 2013-06-28 15:34:56 +0000 | [diff] [blame^] | 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 SkPMetric_DEFINED |
| 9 | #define SkPMetric_DEFINED |
| 10 | |
| 11 | #include "SkTDArray.h" |
| 12 | |
| 13 | #include "SkImageDiffer.h" |
| 14 | |
| 15 | /** |
| 16 | * An image differ that uses the pdiff image metric to compare images. |
| 17 | */ |
| 18 | class SkPMetric : public SkImageDiffer { |
| 19 | public: |
| 20 | virtual const char* getName() SK_OVERRIDE; |
| 21 | virtual int queueDiff(SkBitmap* baseline, SkBitmap* test) SK_OVERRIDE; |
| 22 | virtual bool isFinished(int id) SK_OVERRIDE; |
| 23 | virtual double getResult(int id) SK_OVERRIDE; |
| 24 | |
| 25 | private: |
| 26 | struct QueuedDiff { |
| 27 | bool finished; |
| 28 | double result; |
| 29 | }; |
| 30 | |
| 31 | SkTDArray<QueuedDiff> fQueuedDiffs; |
| 32 | |
| 33 | typedef SkImageDiffer INHERITED; |
| 34 | }; |
| 35 | |
| 36 | |
| 37 | #endif |