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

Side by Side Diff: cc/test/pixel_test_utils.h

Issue 12558003: cc: Made image comparison for pixel tests error tolerant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added output of error pixel details. Created 7 years, 8 months 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
« no previous file with comments | « cc/test/pixel_test.cc ('k') | cc/test/pixel_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TEST_PIXEL_TEST_UTILS_H_ 5 #ifndef CC_TEST_PIXEL_TEST_UTILS_H_
6 #define CC_TEST_PIXEL_TEST_UTILS_H_ 6 #define CC_TEST_PIXEL_TEST_UTILS_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "cc/test/pixel_comparator.h"
9 10
10 class SkBitmap; 11 class SkBitmap;
11 12
12 namespace cc { 13 namespace cc {
13 14
14 // Encodes a bitmap into a PNG and write to disk. Returns true on success. The 15 // Encodes a bitmap into a PNG and write to disk. Returns true on success. The
15 // parent directory does not have to exist. 16 // parent directory does not have to exist.
16 bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path, 17 bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path,
17 bool discard_transparency); 18 bool discard_transparency);
18 19
19 // Reads and decodes a PNG image to a bitmap. Returns true on success. The PNG 20 // Reads and decodes a PNG image to a bitmap. Returns true on success. The PNG
20 // should have been encoded using |gfx::PNGCodec::Encode|. 21 // should have been encoded using |gfx::PNGCodec::Encode|.
21 bool ReadPNGFile(const base::FilePath& file_path, SkBitmap* bitmap); 22 bool ReadPNGFile(const base::FilePath& file_path, SkBitmap* bitmap);
22 23
23 // Compares with a PNG file on disk, and returns true if it is the same as 24 // Compares with a PNG file on disk using the given PixelComparator, and returns
24 // the given image. |ref_img_path| is absolute. 25 // true if the comparator returns a match. |ref_img_path| is absolute.
25 bool IsSameAsPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path, 26 bool MatchesPNGFile(const SkBitmap& gen_bmp,
26 bool discard_transparency); 27 base::FilePath ref_img_path,
28 const PixelComparator& comparator);
27 29
28 } // namespace cc 30 } // namespace cc
29 31
30 #endif // CC_TEST_PIXEL_TEST_UTILS_H_ 32 #endif // CC_TEST_PIXEL_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « cc/test/pixel_test.cc ('k') | cc/test/pixel_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698