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

Side by Side Diff: cc/output/renderer_pixeltest.cc

Issue 532003003: Adding support for blending in cc::SoftwareRenderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 3 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 | « no previous file | cc/output/software_renderer.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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698