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

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

Issue 2710593003: cc: Fix const value pattern by replacing it by non-const or reference. (Closed)
Patch Set: update rebase Created 3 years, 10 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/layers/scrollbar_layer_unittest.cc ('k') | cc/tiles/prioritized_tile.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 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_COMPARATOR_H_ 5 #ifndef CC_TEST_PIXEL_COMPARATOR_H_
6 #define CC_TEST_PIXEL_COMPARATOR_H_ 6 #define CC_TEST_PIXEL_COMPARATOR_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "third_party/skia/include/core/SkBitmap.h" 9 #include "third_party/skia/include/core/SkBitmap.h"
10 10
(...skipping 22 matching lines...) Expand all
33 33
34 private: 34 private:
35 // Exclude alpha channel from comparison? 35 // Exclude alpha channel from comparison?
36 bool discard_alpha_; 36 bool discard_alpha_;
37 }; 37 };
38 38
39 // Fuzzy pixel comparator. Counts small and arbitrary errors separately and 39 // Fuzzy pixel comparator. Counts small and arbitrary errors separately and
40 // computes average and maximum absolute errors per color channel. 40 // computes average and maximum absolute errors per color channel.
41 class FuzzyPixelComparator : public PixelComparator { 41 class FuzzyPixelComparator : public PixelComparator {
42 public: 42 public:
43 FuzzyPixelComparator(const bool discard_alpha, 43 FuzzyPixelComparator(bool discard_alpha,
44 const float error_pixels_percentage_limit, 44 float error_pixels_percentage_limit,
45 const float small_error_pixels_percentage_limit, 45 float small_error_pixels_percentage_limit,
46 const float avg_abs_error_limit, 46 float avg_abs_error_limit,
47 const int max_abs_error_limit, 47 int max_abs_error_limit,
48 const int small_error_threshold); 48 int small_error_threshold);
49 ~FuzzyPixelComparator() override {} 49 ~FuzzyPixelComparator() override {}
50 50
51 // Computes error metrics and returns true if the errors don't exceed the 51 // Computes error metrics and returns true if the errors don't exceed the
52 // specified limits. Otherwise, returns false and reports the error metrics on 52 // specified limits. Otherwise, returns false and reports the error metrics on
53 // LOG(ERROR). Differences in the alpha channel are ignored. 53 // LOG(ERROR). Differences in the alpha channel are ignored.
54 bool Compare(const SkBitmap& actual_bmp, 54 bool Compare(const SkBitmap& actual_bmp,
55 const SkBitmap& expected_bmp) const override; 55 const SkBitmap& expected_bmp) const override;
56 56
57 private: 57 private:
58 // Exclude alpha channel from comparison? 58 // Exclude alpha channel from comparison?
(...skipping 13 matching lines...) Expand all
72 // All pixels can be off by one, but any more than that is an error. 72 // All pixels can be off by one, but any more than that is an error.
73 class FuzzyPixelOffByOneComparator : public FuzzyPixelComparator { 73 class FuzzyPixelOffByOneComparator : public FuzzyPixelComparator {
74 public: 74 public:
75 explicit FuzzyPixelOffByOneComparator(bool discard_alpha) 75 explicit FuzzyPixelOffByOneComparator(bool discard_alpha)
76 : FuzzyPixelComparator(discard_alpha, 100.f, 0.f, 1.f, 1, 0) {} 76 : FuzzyPixelComparator(discard_alpha, 100.f, 0.f, 1.f, 1, 0) {}
77 }; 77 };
78 78
79 } // namespace cc 79 } // namespace cc
80 80
81 #endif // CC_TEST_PIXEL_COMPARATOR_H_ 81 #endif // CC_TEST_PIXEL_COMPARATOR_H_
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/tiles/prioritized_tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698