Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / login / screenshot_testing / SkDiffPixelsMetric.h
blob2fa280f4b0cea48d42911ed92618f8996169bb99
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // WARNING! This file is copied from third_party/skia/tools/skpdiff and slightly
6 // modified to be compilable outside Skia and suit chromium style. Some comments
7 // can make no sense.
8 // TODO(elizavetai): remove this file and reuse the original one in Skia
10 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_SKDIFFPIXELSMETRIC_H_
11 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_SKDIFFPIXELSMETRIC_H_
13 #include "chrome/browser/chromeos/login/screenshot_testing/SkImageDiffer.h"
15 /**
16 * A differ that measures the percentage of different corresponding pixels. If
17 * the two images are
18 * not the same size or have no pixels, the result will always be zero.
20 class SkDifferentPixelsMetric {
21 public:
22 virtual bool diff(SkBitmap* baseline,
23 SkBitmap* test,
24 const SkImageDiffer::BitmapsToCreate& bitmapsToCreate,
25 SkImageDiffer::Result* result);
28 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_SKDIFFPIXELSMETRIC_H_