OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
6 #include "cc/surfaces/surface.h" | 6 #include "cc/surfaces/surface.h" |
7 #include "cc/surfaces/surface_factory.h" | 7 #include "cc/surfaces/surface_factory.h" |
8 #include "cc/surfaces/surface_factory_client.h" | 8 #include "cc/surfaces/surface_factory_client.h" |
9 #include "cc/surfaces/surface_hittest.h" | 9 #include "cc/surfaces/surface_hittest.h" |
10 #include "cc/surfaces/surface_id_allocator.h" | 10 #include "cc/surfaces/surface_id_allocator.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 &render_pass_list); | 382 &render_pass_list); |
383 | 383 |
384 // Create the root RenderPass. | 384 // Create the root RenderPass. |
385 RenderPassId root_render_pass_id(1, 2); | 385 RenderPassId root_render_pass_id(1, 2); |
386 CreateRenderPass(root_render_pass_id, root_rect, gfx::Transform(), | 386 CreateRenderPass(root_render_pass_id, root_rect, gfx::Transform(), |
387 &render_pass_list); | 387 &render_pass_list); |
388 | 388 |
389 RenderPass* root_pass = nullptr; | 389 RenderPass* root_pass = nullptr; |
390 scoped_ptr<CompositorFrame> root_frame = | 390 scoped_ptr<CompositorFrame> root_frame = |
391 CreateCompositorFrameWithRenderPassList(&render_pass_list); | 391 CreateCompositorFrameWithRenderPassList(&render_pass_list); |
392 root_pass = root_frame->delegated_frame_data->render_pass_list.back(); | 392 root_pass = root_frame->delegated_frame_data->render_pass_list.back().get(); |
393 | 393 |
394 // Create a RenderPassDrawQuad. | 394 // Create a RenderPassDrawQuad. |
395 gfx::Rect render_pass_quad_rect(100, 100); | 395 gfx::Rect render_pass_quad_rect(100, 100); |
396 CreateRenderPassDrawQuad(root_pass, | 396 CreateRenderPassDrawQuad(root_pass, |
397 transform_to_root_target, | 397 transform_to_root_target, |
398 root_rect, | 398 root_rect, |
399 render_pass_quad_rect, | 399 render_pass_quad_rect, |
400 child_render_pass_id); | 400 child_render_pass_id); |
401 | 401 |
402 // Add a solid quad in the child render pass. | 402 // Add a solid quad in the child render pass. |
403 RenderPass* child_render_pass = | 403 RenderPass* child_render_pass = |
404 root_frame->delegated_frame_data->render_pass_list.front(); | 404 root_frame->delegated_frame_data->render_pass_list.front().get(); |
405 gfx::Rect child_solid_quad_rect(100, 100); | 405 gfx::Rect child_solid_quad_rect(100, 100); |
406 CreateSolidColorDrawQuad(child_render_pass, | 406 CreateSolidColorDrawQuad(child_render_pass, |
407 gfx::Transform(), | 407 gfx::Transform(), |
408 gfx::Rect(100, 100), | 408 gfx::Rect(100, 100), |
409 child_solid_quad_rect); | 409 child_solid_quad_rect); |
410 | 410 |
411 // Submit the root frame. | 411 // Submit the root frame. |
412 SurfaceIdAllocator root_allocator(1); | 412 SurfaceIdAllocator root_allocator(1); |
413 SurfaceId root_surface_id = root_allocator.GenerateId(); | 413 SurfaceId root_surface_id = root_allocator.GenerateId(); |
414 factory.Create(root_surface_id); | 414 factory.Create(root_surface_id); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 gfx::Point(100, 100) | 458 gfx::Point(100, 100) |
459 } | 459 } |
460 }; | 460 }; |
461 | 461 |
462 RunTests(&manager, tests, arraysize(tests)); | 462 RunTests(&manager, tests, arraysize(tests)); |
463 | 463 |
464 factory.Destroy(root_surface_id); | 464 factory.Destroy(root_surface_id); |
465 } | 465 } |
466 | 466 |
467 } // namespace cc | 467 } // namespace cc |
OLD | NEW |