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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 hittest.GetTargetSurfaceAtPoint( | 346 hittest.GetTargetSurfaceAtPoint( |
346 root_surface_id, gfx::Point(290, 290), &transformed_point)); | 347 root_surface_id, gfx::Point(290, 290), &transformed_point)); |
347 EXPECT_EQ(gfx::Point(290, 290), transformed_point); | 348 EXPECT_EQ(gfx::Point(290, 290), transformed_point); |
348 } | 349 } |
349 | 350 |
350 factory.Destroy(root_surface_id); | 351 factory.Destroy(root_surface_id); |
351 factory.Destroy(child_surface_id); | 352 factory.Destroy(child_surface_id); |
352 } | 353 } |
353 | 354 |
354 } // namespace cc | 355 } // namespace cc |
OLD | NEW |