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" |
11 #include "cc/test/fake_picture_pile_impl.h" | 11 #include "cc/test/fake_picture_pile_impl.h" |
12 #include "cc/test/pixel_test.h" | 12 #include "cc/test/pixel_test.h" |
13 #include "gpu/GLES2/gl2extchromium.h" | 13 #include "gpu/GLES2/gl2extchromium.h" |
14 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 14 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
15 #include "third_party/skia/include/core/SkImageFilter.h" | 15 #include "third_party/skia/include/core/SkImageFilter.h" |
16 #include "third_party/skia/include/core/SkMatrix.h" | 16 #include "third_party/skia/include/core/SkMatrix.h" |
17 #include "third_party/skia/include/effects/SkColorFilterImageFilter.h" | 17 #include "third_party/skia/include/effects/SkColorFilterImageFilter.h" |
18 #include "third_party/skia/include/effects/SkColorMatrixFilter.h" | 18 #include "third_party/skia/include/effects/SkColorMatrixFilter.h" |
19 #include "ui/gfx/rect_conversions.h" | 19 #include "ui/gfx/rect_conversions.h" |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 namespace { | 22 namespace { |
23 | 23 |
| 24 #if !defined(OS_ANDROID) |
24 scoped_ptr<RenderPass> CreateTestRootRenderPass(RenderPass::Id id, | 25 scoped_ptr<RenderPass> CreateTestRootRenderPass(RenderPass::Id id, |
25 gfx::Rect rect) { | 26 gfx::Rect rect) { |
26 scoped_ptr<RenderPass> pass = RenderPass::Create(); | 27 scoped_ptr<RenderPass> pass = RenderPass::Create(); |
27 const gfx::Rect output_rect = rect; | 28 const gfx::Rect output_rect = rect; |
28 const gfx::RectF damage_rect = rect; | 29 const gfx::RectF damage_rect = rect; |
29 const gfx::Transform transform_to_root_target; | 30 const gfx::Transform transform_to_root_target; |
30 pass->SetNew(id, output_rect, damage_rect, transform_to_root_target); | 31 pass->SetNew(id, output_rect, damage_rect, transform_to_root_target); |
31 return pass.Pass(); | 32 return pass.Pass(); |
32 } | 33 } |
33 | 34 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 return fuzzy_.Compare(actual_bmp, expected_bmp); | 189 return fuzzy_.Compare(actual_bmp, expected_bmp); |
189 } | 190 } |
190 | 191 |
191 template<typename RendererType> | 192 template<typename RendererType> |
192 bool FuzzyForSoftwareOnlyPixelComparator<RendererType>::Compare( | 193 bool FuzzyForSoftwareOnlyPixelComparator<RendererType>::Compare( |
193 const SkBitmap& actual_bmp, | 194 const SkBitmap& actual_bmp, |
194 const SkBitmap& expected_bmp) const { | 195 const SkBitmap& expected_bmp) const { |
195 return exact_.Compare(actual_bmp, expected_bmp); | 196 return exact_.Compare(actual_bmp, expected_bmp); |
196 } | 197 } |
197 | 198 |
198 #if !defined(OS_ANDROID) | |
199 TYPED_TEST(RendererPixelTest, SimpleGreenRect) { | 199 TYPED_TEST(RendererPixelTest, SimpleGreenRect) { |
200 gfx::Rect rect(this->device_viewport_size_); | 200 gfx::Rect rect(this->device_viewport_size_); |
201 | 201 |
202 RenderPass::Id id(1, 1); | 202 RenderPass::Id id(1, 1); |
203 scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 203 scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
204 | 204 |
205 scoped_ptr<SharedQuadState> shared_state = | 205 scoped_ptr<SharedQuadState> shared_state = |
206 CreateTestSharedQuadState(gfx::Transform(), rect); | 206 CreateTestSharedQuadState(gfx::Transform(), rect); |
207 | 207 |
208 scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create(); | 208 scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create(); |
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 EXPECT_TRUE(this->RunPixelTest( | 2008 EXPECT_TRUE(this->RunPixelTest( |
2009 &pass_list, | 2009 &pass_list, |
2010 PixelTest::NoOffscreenContext, | 2010 PixelTest::NoOffscreenContext, |
2011 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), | 2011 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), |
2012 ExactPixelComparator(true))); | 2012 ExactPixelComparator(true))); |
2013 } | 2013 } |
2014 #endif // !defined(OS_ANDROID) | 2014 #endif // !defined(OS_ANDROID) |
2015 | 2015 |
2016 } // namespace | 2016 } // namespace |
2017 } // namespace cc | 2017 } // namespace cc |
OLD | NEW |