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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 gfx::Size outer_size(100, 100); | 72 gfx::Size outer_size(100, 100); |
73 gfx::Size inner_size(98, 98); | 73 gfx::Size inner_size(98, 98); |
74 gfx::Rect outer_rect(outer_size); | 74 gfx::Rect outer_rect(outer_size); |
75 gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); | 75 gfx::Rect inner_rect(gfx::Point(1, 1), inner_size); |
76 gfx::Rect visible_rect(gfx::Point(1, 2), gfx::Size(98, 97)); | 76 gfx::Rect visible_rect(gfx::Point(1, 2), gfx::Size(98, 97)); |
77 set_viewport(gfx::Rect(outer_size)); | 77 set_viewport(gfx::Rect(outer_size)); |
78 | 78 |
79 InitializeRenderer(make_scoped_ptr(new SoftwareOutputDevice)); | 79 InitializeRenderer(make_scoped_ptr(new SoftwareOutputDevice)); |
80 | 80 |
81 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); | 81 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); |
82 shared_quad_state->SetAll( | 82 shared_quad_state->SetAll(gfx::Transform(), |
83 gfx::Transform(), outer_size, outer_rect, outer_rect, false, 1.0); | 83 outer_size, |
| 84 outer_rect, |
| 85 outer_rect, |
| 86 false, |
| 87 1.0, |
| 88 SkXfermode::kSrcOver_Mode); |
84 RenderPass::Id root_render_pass_id = RenderPass::Id(1, 1); | 89 RenderPass::Id root_render_pass_id = RenderPass::Id(1, 1); |
85 scoped_ptr<TestRenderPass> root_render_pass = TestRenderPass::Create(); | 90 scoped_ptr<TestRenderPass> root_render_pass = TestRenderPass::Create(); |
86 root_render_pass->SetNew( | 91 root_render_pass->SetNew( |
87 root_render_pass_id, outer_rect, outer_rect, gfx::Transform()); | 92 root_render_pass_id, outer_rect, outer_rect, gfx::Transform()); |
88 scoped_ptr<SolidColorDrawQuad> outer_quad = SolidColorDrawQuad::Create(); | 93 scoped_ptr<SolidColorDrawQuad> outer_quad = SolidColorDrawQuad::Create(); |
89 outer_quad->SetNew( | 94 outer_quad->SetNew( |
90 shared_quad_state.get(), outer_rect, SK_ColorYELLOW, false); | 95 shared_quad_state.get(), outer_rect, SK_ColorYELLOW, false); |
91 scoped_ptr<SolidColorDrawQuad> inner_quad = SolidColorDrawQuad::Create(); | 96 scoped_ptr<SolidColorDrawQuad> inner_quad = SolidColorDrawQuad::Create(); |
92 inner_quad->SetNew(shared_quad_state.get(), inner_rect, SK_ColorCYAN, false); | 97 inner_quad->SetNew(shared_quad_state.get(), inner_rect, SK_ColorCYAN, false); |
93 inner_quad->visible_rect = visible_rect; | 98 inner_quad->visible_rect = visible_rect; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 gfx::Vector2d()); | 160 gfx::Vector2d()); |
156 resource_provider()->SetPixels(resource_cyan, | 161 resource_provider()->SetPixels(resource_cyan, |
157 static_cast<uint8_t*>(cyan_tile.getPixels()), | 162 static_cast<uint8_t*>(cyan_tile.getPixels()), |
158 gfx::Rect(inner_size), | 163 gfx::Rect(inner_size), |
159 gfx::Rect(inner_size), | 164 gfx::Rect(inner_size), |
160 gfx::Vector2d()); | 165 gfx::Vector2d()); |
161 | 166 |
162 gfx::Rect root_rect = DeviceViewport(); | 167 gfx::Rect root_rect = DeviceViewport(); |
163 | 168 |
164 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); | 169 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); |
165 shared_quad_state->SetAll( | 170 shared_quad_state->SetAll(gfx::Transform(), |
166 gfx::Transform(), outer_size, outer_rect, outer_rect, false, 1.0); | 171 outer_size, |
| 172 outer_rect, |
| 173 outer_rect, |
| 174 false, |
| 175 1.0, |
| 176 SkXfermode::kSrcOver_Mode); |
167 RenderPass::Id root_render_pass_id = RenderPass::Id(1, 1); | 177 RenderPass::Id root_render_pass_id = RenderPass::Id(1, 1); |
168 scoped_ptr<TestRenderPass> root_render_pass = TestRenderPass::Create(); | 178 scoped_ptr<TestRenderPass> root_render_pass = TestRenderPass::Create(); |
169 root_render_pass->SetNew( | 179 root_render_pass->SetNew( |
170 root_render_pass_id, root_rect, root_rect, gfx::Transform()); | 180 root_render_pass_id, root_rect, root_rect, gfx::Transform()); |
171 scoped_ptr<TileDrawQuad> outer_quad = TileDrawQuad::Create(); | 181 scoped_ptr<TileDrawQuad> outer_quad = TileDrawQuad::Create(); |
172 outer_quad->SetNew(shared_quad_state.get(), | 182 outer_quad->SetNew(shared_quad_state.get(), |
173 outer_rect, | 183 outer_rect, |
174 outer_rect, | 184 outer_rect, |
175 resource_yellow, | 185 resource_yellow, |
176 gfx::RectF(outer_size), | 186 gfx::RectF(outer_size), |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 244 |
235 resource_provider()->SetPixels(resource_cyan, | 245 resource_provider()->SetPixels(resource_cyan, |
236 static_cast<uint8_t*>(cyan_tile.getPixels()), | 246 static_cast<uint8_t*>(cyan_tile.getPixels()), |
237 gfx::Rect(tile_size), | 247 gfx::Rect(tile_size), |
238 gfx::Rect(tile_size), | 248 gfx::Rect(tile_size), |
239 gfx::Vector2d()); | 249 gfx::Vector2d()); |
240 | 250 |
241 gfx::Rect root_rect = DeviceViewport(); | 251 gfx::Rect root_rect = DeviceViewport(); |
242 | 252 |
243 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); | 253 scoped_ptr<SharedQuadState> shared_quad_state = SharedQuadState::Create(); |
244 shared_quad_state->SetAll( | 254 shared_quad_state->SetAll(gfx::Transform(), |
245 gfx::Transform(), tile_size, tile_rect, tile_rect, false, 1.0); | 255 tile_size, |
| 256 tile_rect, |
| 257 tile_rect, |
| 258 false, |
| 259 1.0, |
| 260 SkXfermode::kSrcOver_Mode); |
246 RenderPass::Id root_render_pass_id = RenderPass::Id(1, 1); | 261 RenderPass::Id root_render_pass_id = RenderPass::Id(1, 1); |
247 scoped_ptr<TestRenderPass> root_render_pass = TestRenderPass::Create(); | 262 scoped_ptr<TestRenderPass> root_render_pass = TestRenderPass::Create(); |
248 root_render_pass->SetNew( | 263 root_render_pass->SetNew( |
249 root_render_pass_id, root_rect, root_rect, gfx::Transform()); | 264 root_render_pass_id, root_rect, root_rect, gfx::Transform()); |
250 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); | 265 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); |
251 quad->SetNew(shared_quad_state.get(), | 266 quad->SetNew(shared_quad_state.get(), |
252 tile_rect, | 267 tile_rect, |
253 tile_rect, | 268 tile_rect, |
254 resource_cyan, | 269 resource_cyan, |
255 gfx::RectF(tile_size), | 270 gfx::RectF(tile_size), |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 EXPECT_EQ( | 412 EXPECT_EQ( |
398 SK_ColorMAGENTA, | 413 SK_ColorMAGENTA, |
399 output.getColor(interior_visible_rect.x(), interior_visible_rect.y())); | 414 output.getColor(interior_visible_rect.x(), interior_visible_rect.y())); |
400 EXPECT_EQ(SK_ColorMAGENTA, | 415 EXPECT_EQ(SK_ColorMAGENTA, |
401 output.getColor(interior_visible_rect.right() - 1, | 416 output.getColor(interior_visible_rect.right() - 1, |
402 interior_visible_rect.bottom() - 1)); | 417 interior_visible_rect.bottom() - 1)); |
403 } | 418 } |
404 | 419 |
405 } // namespace | 420 } // namespace |
406 } // namespace cc | 421 } // namespace cc |
OLD | NEW |