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/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
6 | 6 |
7 #include "cc/layers/quad_sink.h" | 7 #include "cc/layers/quad_sink.h" |
8 #include "cc/output/compositor_frame_metadata.h" | 8 #include "cc/output/compositor_frame_metadata.h" |
9 #include "cc/output/software_output_device.h" | 9 #include "cc/output/software_output_device.h" |
10 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 scoped_ptr<FakeOutputSurface> output_surface_; | 74 scoped_ptr<FakeOutputSurface> output_surface_; |
75 scoped_ptr<ResourceProvider> resource_provider_; | 75 scoped_ptr<ResourceProvider> resource_provider_; |
76 scoped_ptr<SoftwareRenderer> renderer_; | 76 scoped_ptr<SoftwareRenderer> renderer_; |
77 gfx::Size viewport_size_; | 77 gfx::Size viewport_size_; |
78 LayerTreeSettings settings_; | 78 LayerTreeSettings settings_; |
79 bool should_clear_root_render_pass_; | 79 bool should_clear_root_render_pass_; |
80 }; | 80 }; |
81 | 81 |
82 TEST_F(SoftwareRendererTest, SolidColorQuad) { | 82 TEST_F(SoftwareRendererTest, SolidColorQuad) { |
83 gfx::Size outer_size(100, 100); | 83 gfx::Size outer_size(100, 100); |
| 84 #if !defined(OS_ANDROID) |
84 int outer_pixels = outer_size.width() * outer_size.height(); | 85 int outer_pixels = outer_size.width() * outer_size.height(); |
| 86 #endif |
85 gfx::Size inner_size(98, 98); | 87 gfx::Size inner_size(98, 98); |
86 gfx::Rect outer_rect(outer_size); | 88 gfx::Rect outer_rect(outer_size); |
87 gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); | 89 gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); |
88 set_viewport_size(outer_size); | 90 set_viewport_size(outer_size); |
89 | 91 |
90 InitializeRenderer(); | 92 InitializeRenderer(); |
91 | 93 |
92 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); | 94 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); |
93 shared_quad_state->SetAll( | 95 shared_quad_state->SetAll( |
94 gfx::Transform(), outer_size, outer_rect, outer_rect, false, 1.0); | 96 gfx::Transform(), outer_size, outer_rect, outer_rect, false, 1.0); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 EXPECT_EQ( | 250 EXPECT_EQ( |
249 SK_ColorMAGENTA, | 251 SK_ColorMAGENTA, |
250 pixels[smaller_rect.y() * viewport_rect.width() + smaller_rect.x()]); | 252 pixels[smaller_rect.y() * viewport_rect.width() + smaller_rect.x()]); |
251 EXPECT_EQ(SK_ColorMAGENTA, | 253 EXPECT_EQ(SK_ColorMAGENTA, |
252 pixels[(smaller_rect.bottom() - 1) * viewport_rect.width() + | 254 pixels[(smaller_rect.bottom() - 1) * viewport_rect.width() + |
253 smaller_rect.right() - 1]); | 255 smaller_rect.right() - 1]); |
254 } | 256 } |
255 | 257 |
256 } // namespace | 258 } // namespace |
257 } // namespace cc | 259 } // namespace cc |
OLD | NEW |