OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 test_hooks_->WillPrepareTilesOnThread(this); | 176 test_hooks_->WillPrepareTilesOnThread(this); |
177 return LayerTreeHostImpl::PrepareTiles(); | 177 return LayerTreeHostImpl::PrepareTiles(); |
178 } | 178 } |
179 | 179 |
180 DrawResult PrepareToDraw(FrameData* frame) override { | 180 DrawResult PrepareToDraw(FrameData* frame) override { |
181 test_hooks_->WillPrepareToDrawOnThread(this); | 181 test_hooks_->WillPrepareToDrawOnThread(this); |
182 DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); | 182 DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); |
183 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); | 183 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); |
184 } | 184 } |
185 | 185 |
186 void DrawLayers(FrameData* frame) override { | 186 bool SwapBuffers(const FrameData& frame) override { |
187 LayerTreeHostImpl::DrawLayers(frame); | 187 bool r = LayerTreeHostImpl::SwapBuffers(frame); |
enne (OOO)
2016/09/07 18:05:52
I know swap is going to go away, but why does Swap
danakj
2016/09/07 18:28:12
What's happening is the frame is being given to th
enne (OOO)
2016/09/07 18:38:08
I figured that this was safe to do in the current
danakj
2016/09/07 18:42:16
Well, usually TestHooks happen *after* LTHI does s
enne (OOO)
2016/09/07 19:02:58
Sure, DrawLayersOnThread always happens after Draw
danakj
2016/09/07 19:05:46
Ah, just cuz I wanted to make tests work with that
| |
188 test_hooks_->DrawLayersOnThread(this); | 188 test_hooks_->DrawLayersOnThread(this); |
189 return r; | |
189 } | 190 } |
190 | 191 |
191 void NotifyReadyToActivate() override { | 192 void NotifyReadyToActivate() override { |
192 if (block_notify_ready_to_activate_for_testing_) { | 193 if (block_notify_ready_to_activate_for_testing_) { |
193 notify_ready_to_activate_was_blocked_ = true; | 194 notify_ready_to_activate_was_blocked_ = true; |
194 } else { | 195 } else { |
195 LayerTreeHostImpl::NotifyReadyToActivate(); | 196 LayerTreeHostImpl::NotifyReadyToActivate(); |
196 test_hooks_->NotifyReadyToActivateOnThread(this); | 197 test_hooks_->NotifyReadyToActivateOnThread(this); |
197 } | 198 } |
198 } | 199 } |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
940 } | 941 } |
941 | 942 |
942 LayerTreeHost* LayerTreeTest::remote_client_layer_tree_host() { | 943 LayerTreeHost* LayerTreeTest::remote_client_layer_tree_host() { |
943 DCHECK(IsRemoteTest()); | 944 DCHECK(IsRemoteTest()); |
944 DCHECK(task_runner_provider()->IsMainThread() || | 945 DCHECK(task_runner_provider()->IsMainThread() || |
945 task_runner_provider()->IsMainThreadBlocked()); | 946 task_runner_provider()->IsMainThreadBlocked()); |
946 return remote_client_layer_tree_host_.get(); | 947 return remote_client_layer_tree_host_.get(); |
947 } | 948 } |
948 | 949 |
949 } // namespace cc | 950 } // namespace cc |
OLD | NEW |