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 "cc/software_renderer.h" | 5 #include "cc/software_renderer.h" |
6 | 6 |
7 #include "cc/quad_sink.h" | 7 #include "cc/quad_sink.h" |
8 #include "cc/render_pass.h" | 8 #include "cc/render_pass.h" |
9 #include "cc/render_pass_draw_quad.h" | 9 #include "cc/render_pass_draw_quad.h" |
10 #include "cc/solid_color_draw_quad.h" | 10 #include "cc/solid_color_draw_quad.h" |
11 #include "cc/test/animation_test_common.h" | 11 #include "cc/test/animation_test_common.h" |
12 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
13 #include "cc/test/fake_software_output_device.h" | 13 #include "cc/test/fake_software_output_device.h" |
14 #include "cc/test/geometry_test_utils.h" | 14 #include "cc/test/geometry_test_utils.h" |
15 #include "cc/test/render_pass_test_common.h" | 15 #include "cc/test/render_pass_test_common.h" |
16 #include "cc/test/render_pass_test_utils.h" | 16 #include "cc/test/render_pass_test_utils.h" |
17 #include "cc/tile_draw_quad.h" | 17 #include "cc/tile_draw_quad.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 using namespace WebKit; | 21 using namespace WebKit; |
22 using namespace WebKitTests; | |
23 | 22 |
24 namespace cc { | 23 namespace cc { |
25 namespace { | 24 namespace { |
26 | 25 |
27 class SoftwareRendererTest : public testing::Test, public RendererClient { | 26 class SoftwareRendererTest : public testing::Test, public RendererClient { |
28 public: | 27 public: |
29 SoftwareRendererTest() | 28 SoftwareRendererTest() |
30 : m_shouldClearRootRenderPass(true) | 29 : m_shouldClearRootRenderPass(true) |
31 { | 30 { |
32 } | 31 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // If we didn't clear, the borders should still be green. | 211 // If we didn't clear, the borders should still be green. |
213 EXPECT_EQ(SK_ColorGREEN, pixels[0]); | 212 EXPECT_EQ(SK_ColorGREEN, pixels[0]); |
214 EXPECT_EQ(SK_ColorGREEN, pixels[viewportPixels - 1]); | 213 EXPECT_EQ(SK_ColorGREEN, pixels[viewportPixels - 1]); |
215 | 214 |
216 EXPECT_EQ(SK_ColorMAGENTA, pixels[smallerRect.y() * viewportRect.width() + s
mallerRect.x()]); | 215 EXPECT_EQ(SK_ColorMAGENTA, pixels[smallerRect.y() * viewportRect.width() + s
mallerRect.x()]); |
217 EXPECT_EQ(SK_ColorMAGENTA, pixels[(smallerRect.bottom() - 1) * viewportRect.
width() + smallerRect.right() - 1]); | 216 EXPECT_EQ(SK_ColorMAGENTA, pixels[(smallerRect.bottom() - 1) * viewportRect.
width() + smallerRect.right() - 1]); |
218 } | 217 } |
219 | 218 |
220 } // namespace | 219 } // namespace |
221 } // namespace cc | 220 } // namespace cc |
OLD | NEW |