Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: cc/surfaces/surface_hittest_unittest.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: IsEmpty + rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/surfaces/surface.h" 8 #include "cc/surfaces/surface.h"
9 #include "cc/surfaces/surface_factory.h" 9 #include "cc/surfaces/surface_factory.h"
10 #include "cc/surfaces/surface_factory_client.h" 10 #include "cc/surfaces/surface_factory_client.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 &render_pass_list); 411 &render_pass_list);
412 412
413 // Create the root RenderPass. 413 // Create the root RenderPass.
414 RenderPassId root_render_pass_id(1, 2); 414 RenderPassId root_render_pass_id(1, 2);
415 CreateRenderPass(root_render_pass_id, root_rect, gfx::Transform(), 415 CreateRenderPass(root_render_pass_id, root_rect, gfx::Transform(),
416 &render_pass_list); 416 &render_pass_list);
417 417
418 RenderPass* root_pass = nullptr; 418 RenderPass* root_pass = nullptr;
419 CompositorFrame root_frame = 419 CompositorFrame root_frame =
420 CreateCompositorFrameWithRenderPassList(&render_pass_list); 420 CreateCompositorFrameWithRenderPassList(&render_pass_list);
421 root_pass = root_frame.delegated_frame_data->render_pass_list.back().get(); 421 root_pass = root_frame.render_pass_list.back().get();
422 422
423 // Create a RenderPassDrawQuad. 423 // Create a RenderPassDrawQuad.
424 gfx::Rect render_pass_quad_rect(100, 100); 424 gfx::Rect render_pass_quad_rect(100, 100);
425 CreateRenderPassDrawQuad(root_pass, 425 CreateRenderPassDrawQuad(root_pass,
426 transform_to_root_target, 426 transform_to_root_target,
427 root_rect, 427 root_rect,
428 render_pass_quad_rect, 428 render_pass_quad_rect,
429 child_render_pass_id); 429 child_render_pass_id);
430 430
431 // Add a solid quad in the child render pass. 431 // Add a solid quad in the child render pass.
432 RenderPass* child_render_pass = 432 RenderPass* child_render_pass = root_frame.render_pass_list.front().get();
433 root_frame.delegated_frame_data->render_pass_list.front().get();
434 gfx::Rect child_solid_quad_rect(100, 100); 433 gfx::Rect child_solid_quad_rect(100, 100);
435 CreateSolidColorDrawQuad(child_render_pass, 434 CreateSolidColorDrawQuad(child_render_pass,
436 gfx::Transform(), 435 gfx::Transform(),
437 gfx::Rect(100, 100), 436 gfx::Rect(100, 100),
438 child_solid_quad_rect); 437 child_solid_quad_rect);
439 438
440 // Submit the root frame. 439 // Submit the root frame.
441 SurfaceIdAllocator root_allocator; 440 SurfaceIdAllocator root_allocator;
442 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); 441 LocalFrameId root_local_frame_id = root_allocator.GenerateId();
443 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); 442 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 625
627 // Verify that insets have affected hit targeting. 626 // Verify that insets have affected hit targeting.
628 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); 627 EXPECT_EQ(0, accept_delegate.reject_target_overrides());
629 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); 628 EXPECT_EQ(2, accept_delegate.accept_target_overrides());
630 629
631 root_factory.Destroy(root_local_frame_id); 630 root_factory.Destroy(root_local_frame_id);
632 child_factory.Destroy(child_local_frame_id); 631 child_factory.Destroy(child_local_frame_id);
633 } 632 }
634 633
635 } // namespace cc 634 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698