blob: fb32db5568c2aaded363296c6fd81243380ba187 [file] [log] [blame]
zachr@google.comc0a75a82013-06-28 15:34:56 +00001/*
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 */
18class SkPMetric : public SkImageDiffer {
19public:
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
25private:
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