Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: tools/skpdiff/SkImageDiffer.cpp

Issue 60833002: fix multithread related crashes in skpdiff (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: addressing comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/skpdiff/SkImageDiffer.h ('k') | tools/skpdiff/SkPMetric.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 10
11 #include "SkImageDiffer.h" 11 #include "SkImageDiffer.h"
12 #include "skpdiff_util.h" 12 #include "skpdiff_util.h"
13 13
14 const double SkImageDiffer::RESULT_CORRECT = 1.0f; 14 const double SkImageDiffer::RESULT_CORRECT = 1.0f;
15 const double SkImageDiffer::RESULT_INCORRECT = 0.0f; 15 const double SkImageDiffer::RESULT_INCORRECT = 0.0f;
mtklein 2013/11/12 17:00:20 At this point you van probably just get rid of thi
16 16
17 SkImageDiffer::SkImageDiffer() 17 SkImageDiffer::SkImageDiffer() {
18 : fIsGood(true) {
19 18
20 } 19 }
21 20
22 SkImageDiffer::~SkImageDiffer() { 21 SkImageDiffer::~SkImageDiffer() {
23 22
24 } 23 }
25
26 int SkImageDiffer::queueDiffOfFile(const char baseline[], const char test[]) {
27 SkBitmap baselineBitmap;
28 SkBitmap testBitmap;
29 if (!SkImageDecoder::DecodeFile(baseline, &baselineBitmap)) {
30 SkDebugf("Failed to load bitmap \"%s\"\n", baseline);
31 return -1;
32 }
33 if (!SkImageDecoder::DecodeFile(test, &testBitmap)) {
34 SkDebugf("Failed to load bitmap \"%s\"\n", test);
35 return -1;
36 }
37 return this->queueDiff(&baselineBitmap, &testBitmap);
38 }
OLDNEW
« no previous file with comments | « tools/skpdiff/SkImageDiffer.h ('k') | tools/skpdiff/SkPMetric.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698