5b3e2b9622
R=djsollen@google.com Review URL: https://codereview.chromium.org/19608005 git-svn-id: http://skia.googlecode.com/svn/trunk@10249 2bbb7eff-a529-9590-31e7-b0007b416f81
43 lines
1005 B
C++
43 lines
1005 B
C++
/*
|
|
* Copyright 2013 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkPMetric_DEFINED
|
|
#define SkPMetric_DEFINED
|
|
|
|
#include "SkTArray.h"
|
|
#include "SkTDArray.h"
|
|
|
|
#include "SkImageDiffer.h"
|
|
|
|
/**
|
|
* An image differ that uses the pdiff image metric to compare images.
|
|
*/
|
|
class SkPMetric : public SkImageDiffer {
|
|
public:
|
|
virtual const char* getName() SK_OVERRIDE;
|
|
virtual int queueDiff(SkBitmap* baseline, SkBitmap* test) SK_OVERRIDE;
|
|
virtual void deleteDiff(int id) SK_OVERRIDE;
|
|
virtual bool isFinished(int id) SK_OVERRIDE;
|
|
virtual double getResult(int id) SK_OVERRIDE;
|
|
virtual int getPointsOfInterestCount(int id) SK_OVERRIDE;
|
|
virtual SkIPoint* getPointsOfInterest(int id) SK_OVERRIDE;
|
|
|
|
private:
|
|
struct QueuedDiff {
|
|
bool finished;
|
|
double result;
|
|
SkTDArray<SkIPoint> poi;
|
|
};
|
|
|
|
SkTArray<QueuedDiff> fQueuedDiffs;
|
|
|
|
typedef SkImageDiffer INHERITED;
|
|
};
|
|
|
|
|
|
#endif
|