| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
| 7 #include "cc/output/gl_renderer.h" | 7 #include "cc/output/gl_renderer.h" |
| 8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
| 9 #include "cc/quads/picture_draw_quad.h" | 9 #include "cc/quads/picture_draw_quad.h" |
| 10 #include "cc/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 vertex_opacity, | 154 vertex_opacity, |
| 155 false); // flipped | 155 false); // flipped |
| 156 } | 156 } |
| 157 | 157 |
| 158 typedef ::testing::Types<GLRenderer, | 158 typedef ::testing::Types<GLRenderer, |
| 159 SoftwareRenderer, | 159 SoftwareRenderer, |
| 160 GLRendererWithExpandedViewport, | 160 GLRendererWithExpandedViewport, |
| 161 SoftwareRendererWithExpandedViewport> RendererTypes; | 161 SoftwareRendererWithExpandedViewport> RendererTypes; |
| 162 TYPED_TEST_CASE(RendererPixelTest, RendererTypes); | 162 TYPED_TEST_CASE(RendererPixelTest, RendererTypes); |
| 163 | 163 |
| 164 // All pixels can be off by one, but any more than that is an error. | |
| 165 class FuzzyPixelOffByOneComparator : public FuzzyPixelComparator { | |
| 166 public: | |
| 167 explicit FuzzyPixelOffByOneComparator(bool discard_alpha) | |
| 168 : FuzzyPixelComparator(discard_alpha, 100.f, 0.f, 1.f, 1, 0) {} | |
| 169 }; | |
| 170 | |
| 171 template <typename RendererType> | 164 template <typename RendererType> |
| 172 class FuzzyForSoftwareOnlyPixelComparator : public PixelComparator { | 165 class FuzzyForSoftwareOnlyPixelComparator : public PixelComparator { |
| 173 public: | 166 public: |
| 174 explicit FuzzyForSoftwareOnlyPixelComparator(bool discard_alpha) | 167 explicit FuzzyForSoftwareOnlyPixelComparator(bool discard_alpha) |
| 175 : fuzzy_(discard_alpha), exact_(discard_alpha) {} | 168 : fuzzy_(discard_alpha), exact_(discard_alpha) {} |
| 176 | 169 |
| 177 virtual bool Compare(const SkBitmap& actual_bmp, | 170 virtual bool Compare(const SkBitmap& actual_bmp, |
| 178 const SkBitmap& expected_bmp) const; | 171 const SkBitmap& expected_bmp) const; |
| 179 | 172 |
| 180 private: | 173 private: |
| (...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2209 EXPECT_TRUE(this->RunPixelTest( | 2202 EXPECT_TRUE(this->RunPixelTest( |
| 2210 &pass_list, | 2203 &pass_list, |
| 2211 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), | 2204 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), |
| 2212 FuzzyPixelOffByOneComparator(true))); | 2205 FuzzyPixelOffByOneComparator(true))); |
| 2213 } | 2206 } |
| 2214 | 2207 |
| 2215 #endif // !defined(OS_ANDROID) | 2208 #endif // !defined(OS_ANDROID) |
| 2216 | 2209 |
| 2217 } // namespace | 2210 } // namespace |
| 2218 } // namespace cc | 2211 } // namespace cc |
| OLD | NEW |