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) | |
85 int outer_pixels = outer_size.width() * outer_size.height(); | 84 int outer_pixels = outer_size.width() * outer_size.height(); |
86 #endif | |
87 gfx::Size inner_size(98, 98); | 85 gfx::Size inner_size(98, 98); |
88 gfx::Rect outer_rect(outer_size); | 86 gfx::Rect outer_rect(outer_size); |
89 gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); | 87 gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); |
90 set_viewport_size(outer_size); | 88 set_viewport_size(outer_size); |
91 | 89 |
92 InitializeRenderer(); | 90 InitializeRenderer(); |
93 | 91 |
94 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); | 92 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); |
95 shared_quad_state->SetAll( | 93 shared_quad_state->SetAll( |
96 gfx::Transform(), outer_size, outer_rect, outer_rect, false, 1.0); | 94 gfx::Transform(), outer_size, outer_rect, outer_rect, false, 1.0); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 EXPECT_EQ( | 248 EXPECT_EQ( |
251 SK_ColorMAGENTA, | 249 SK_ColorMAGENTA, |
252 pixels[smaller_rect.y() * viewport_rect.width() + smaller_rect.x()]); | 250 pixels[smaller_rect.y() * viewport_rect.width() + smaller_rect.x()]); |
253 EXPECT_EQ(SK_ColorMAGENTA, | 251 EXPECT_EQ(SK_ColorMAGENTA, |
254 pixels[(smaller_rect.bottom() - 1) * viewport_rect.width() + | 252 pixels[(smaller_rect.bottom() - 1) * viewport_rect.width() + |
255 smaller_rect.right() - 1]); | 253 smaller_rect.right() - 1]); |
256 } | 254 } |
257 | 255 |
258 } // namespace | 256 } // namespace |
259 } // namespace cc | 257 } // namespace cc |
OLD | NEW |