OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/public/test/test_synchronous_compositor_android.h" | 5 #include "content/public/test/test_synchronous_compositor_android.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 TestSynchronousCompositor::TestSynchronousCompositor() : client_(NULL) { | 13 TestSynchronousCompositor::TestSynchronousCompositor(int process_id, |
14 } | 14 int routing_id) |
15 : client_(NULL), process_id_(process_id), routing_id_(routing_id) {} | |
15 | 16 |
16 TestSynchronousCompositor::~TestSynchronousCompositor() { | 17 TestSynchronousCompositor::~TestSynchronousCompositor() { |
18 client_->DidDestroyCompositor(this, process_id_, routing_id_); | |
17 SetClient(NULL); | 19 SetClient(NULL); |
18 } | 20 } |
19 | 21 |
20 void TestSynchronousCompositor::SetClient(SynchronousCompositorClient* client) { | 22 void TestSynchronousCompositor::SetClient(SynchronousCompositorClient* client) { |
23 client_ = client; | |
21 if (client_) | 24 if (client_) |
22 client_->DidDestroyCompositor(this, 0, 0); | 25 client_->DidInitializeCompositor(this, process_id_, routing_id_); |
boliu
2016/06/21 17:29:47
did you have to rearrange this logic?
hush (inactive)
2016/06/21 21:27:26
well it's saner. And... it is better to separate t
boliu
2016/06/21 21:31:59
Didn't SetClient(NULL) used to call DidDestroyComp
hush (inactive)
2016/06/21 22:02:27
ok. I reverted this bit.
| |
23 client_ = client; | |
24 if (client_) { | |
25 client_->DidInitializeCompositor(this, 0, 0); | |
26 } | |
27 } | 26 } |
28 | 27 |
29 SynchronousCompositor::Frame TestSynchronousCompositor::DemandDrawHw( | 28 SynchronousCompositor::Frame TestSynchronousCompositor::DemandDrawHw( |
30 const gfx::Size& surface_size, | 29 const gfx::Size& surface_size, |
31 const gfx::Transform& transform, | 30 const gfx::Transform& transform, |
32 const gfx::Rect& viewport, | 31 const gfx::Rect& viewport, |
33 const gfx::Rect& clip, | 32 const gfx::Rect& clip, |
34 const gfx::Rect& viewport_rect_for_tile_priority, | 33 const gfx::Rect& viewport_rect_for_tile_priority, |
35 const gfx::Transform& transform_for_tile_priority) { | 34 const gfx::Transform& transform_for_tile_priority) { |
36 return std::move(hardware_frame_); | 35 return std::move(hardware_frame_); |
(...skipping 27 matching lines...) Expand all Loading... | |
64 | 63 |
65 TestSynchronousCompositor::ReturnedResources::ReturnedResources() | 64 TestSynchronousCompositor::ReturnedResources::ReturnedResources() |
66 : output_surface_id(0u) {} | 65 : output_surface_id(0u) {} |
67 | 66 |
68 TestSynchronousCompositor::ReturnedResources::ReturnedResources( | 67 TestSynchronousCompositor::ReturnedResources::ReturnedResources( |
69 const ReturnedResources& other) = default; | 68 const ReturnedResources& other) = default; |
70 | 69 |
71 TestSynchronousCompositor::ReturnedResources::~ReturnedResources() {} | 70 TestSynchronousCompositor::ReturnedResources::~ReturnedResources() {} |
72 | 71 |
73 } // namespace content | 72 } // namespace content |
OLD | NEW |