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/output/delegated_frame_data.h" | 6 #include "cc/output/delegated_frame_data.h" |
7 #include "cc/quads/render_pass.h" | 7 #include "cc/quads/render_pass.h" |
8 #include "cc/quads/render_pass_draw_quad.h" | 8 #include "cc/quads/render_pass_draw_quad.h" |
9 #include "cc/quads/render_pass_id.h" | 9 #include "cc/quads/render_pass_id.h" |
10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
11 #include "cc/quads/surface_draw_quad.h" | 11 #include "cc/quads/surface_draw_quad.h" |
12 #include "cc/surfaces/surface.h" | 12 #include "cc/surfaces/surface.h" |
13 #include "cc/surfaces/surface_factory.h" | 13 #include "cc/surfaces/surface_factory.h" |
14 #include "cc/surfaces/surface_factory_client.h" | 14 #include "cc/surfaces/surface_factory_client.h" |
15 #include "cc/surfaces/surface_hittest.h" | 15 #include "cc/surfaces/surface_hittest.h" |
16 #include "cc/surfaces/surface_id_allocator.h" | 16 #include "cc/surfaces/surface_id_allocator.h" |
17 #include "cc/surfaces/surface_manager.h" | 17 #include "cc/surfaces/surface_manager.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
20 #include "ui/gfx/geometry/size.h" | 20 #include "ui/gfx/geometry/size.h" |
21 | 21 |
22 namespace cc { | 22 namespace cc { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { | 26 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { |
27 public: | 27 public: |
28 void ReturnResources(const ReturnedResourceArray& resources) override {} | 28 void ReturnResources(const ReturnedResourceArray& resources) override {} |
| 29 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override {} |
29 }; | 30 }; |
30 | 31 |
31 void CreateSharedQuadState(RenderPass* pass, | 32 void CreateSharedQuadState(RenderPass* pass, |
32 const gfx::Transform& transform, | 33 const gfx::Transform& transform, |
33 const gfx::Rect& root_rect) { | 34 const gfx::Rect& root_rect) { |
34 SharedQuadState* child_shared_state = | 35 SharedQuadState* child_shared_state = |
35 pass->CreateAndAppendSharedQuadState(); | 36 pass->CreateAndAppendSharedQuadState(); |
36 child_shared_state->SetAll(transform, | 37 child_shared_state->SetAll(transform, |
37 root_rect.size(), | 38 root_rect.size(), |
38 root_rect, root_rect, false, 1.0f, | 39 root_rect, root_rect, false, 1.0f, |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 hittest.GetTargetSurfaceAtPoint(test.input_surface_id, point, | 479 hittest.GetTargetSurfaceAtPoint(test.input_surface_id, point, |
479 &transform)); | 480 &transform)); |
480 transform.TransformPoint(&point); | 481 transform.TransformPoint(&point); |
481 EXPECT_EQ(test.expected_output_point, point); | 482 EXPECT_EQ(test.expected_output_point, point); |
482 } | 483 } |
483 | 484 |
484 factory.Destroy(root_surface_id); | 485 factory.Destroy(root_surface_id); |
485 } | 486 } |
486 | 487 |
487 } // namespace cc | 488 } // namespace cc |
OLD | NEW |