blob: 8a5c3c71a2ea0c82fdf11b1bae685cbb399955a6 [file] [log] [blame]
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +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
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +00008#include "SkBitmap.h"
9#include "SkImageDecoder.h"
10
11#include "SkImageDiffer.h"
commit-bot@chromium.orgbe19b9e2013-06-14 17:26:54 +000012#include "skpdiff_util.h"
13
14
15SkImageDiffer::SkImageDiffer()
16 : fIsGood(true) {
17
18}
19
20SkImageDiffer::~SkImageDiffer() {
21
22}
23
24int SkImageDiffer::queueDiffOfFile(const char baseline[], const char test[]) {
25 SkBitmap baselineBitmap;
26 SkBitmap testBitmap;
27 if (!SkImageDecoder::DecodeFile(baseline, &baselineBitmap)) {
28 SkDebugf("Failed to load bitmap \"%s\"\n", baseline);
29 return -1;
30 }
31 if (!SkImageDecoder::DecodeFile(test, &testBitmap)) {
32 SkDebugf("Failed to load bitmap \"%s\"\n", test);
33 return -1;
34 }
35 return this->queueDiff(&baselineBitmap, &testBitmap);
36}