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 "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 public: | 53 public: |
54 static scoped_ptr<Proxy> Create( | 54 static scoped_ptr<Proxy> Create( |
55 TestHooks* test_hooks, | 55 TestHooks* test_hooks, |
56 LayerTreeHost* host, | 56 LayerTreeHost* host, |
57 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 57 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
58 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 58 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
59 return make_scoped_ptr(new ThreadProxyForTest( | 59 return make_scoped_ptr(new ThreadProxyForTest( |
60 test_hooks, host, main_task_runner, impl_task_runner)); | 60 test_hooks, host, main_task_runner, impl_task_runner)); |
61 } | 61 } |
62 | 62 |
63 virtual ~ThreadProxyForTest() {} | 63 ~ThreadProxyForTest() override {} |
64 | 64 |
65 void test() { | 65 void test() { |
66 test_hooks_->Layout(); | 66 test_hooks_->Layout(); |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 TestHooks* test_hooks_; | 70 TestHooks* test_hooks_; |
71 | 71 |
72 virtual void ScheduledActionSendBeginMainFrame() override { | 72 void ScheduledActionSendBeginMainFrame() override { |
73 test_hooks_->ScheduledActionWillSendBeginMainFrame(); | 73 test_hooks_->ScheduledActionWillSendBeginMainFrame(); |
74 ThreadProxy::ScheduledActionSendBeginMainFrame(); | 74 ThreadProxy::ScheduledActionSendBeginMainFrame(); |
75 test_hooks_->ScheduledActionSendBeginMainFrame(); | 75 test_hooks_->ScheduledActionSendBeginMainFrame(); |
76 } | 76 } |
77 | 77 |
78 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override { | 78 DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
79 DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible(); | 79 DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible(); |
80 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); | 80 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); |
81 return result; | 81 return result; |
82 } | 82 } |
83 | 83 |
84 virtual void ScheduledActionAnimate() override { | 84 void ScheduledActionAnimate() override { |
85 ThreadProxy::ScheduledActionAnimate(); | 85 ThreadProxy::ScheduledActionAnimate(); |
86 test_hooks_->ScheduledActionAnimate(); | 86 test_hooks_->ScheduledActionAnimate(); |
87 } | 87 } |
88 | 88 |
89 virtual void ScheduledActionCommit() override { | 89 void ScheduledActionCommit() override { |
90 ThreadProxy::ScheduledActionCommit(); | 90 ThreadProxy::ScheduledActionCommit(); |
91 test_hooks_->ScheduledActionCommit(); | 91 test_hooks_->ScheduledActionCommit(); |
92 } | 92 } |
93 | 93 |
94 virtual void ScheduledActionBeginOutputSurfaceCreation() override { | 94 void ScheduledActionBeginOutputSurfaceCreation() override { |
95 ThreadProxy::ScheduledActionBeginOutputSurfaceCreation(); | 95 ThreadProxy::ScheduledActionBeginOutputSurfaceCreation(); |
96 test_hooks_->ScheduledActionBeginOutputSurfaceCreation(); | 96 test_hooks_->ScheduledActionBeginOutputSurfaceCreation(); |
97 } | 97 } |
98 | 98 |
99 ThreadProxyForTest( | 99 ThreadProxyForTest( |
100 TestHooks* test_hooks, | 100 TestHooks* test_hooks, |
101 LayerTreeHost* host, | 101 LayerTreeHost* host, |
102 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 102 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
103 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) | 103 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) |
104 : ThreadProxy(host, main_task_runner, impl_task_runner), | 104 : ThreadProxy(host, main_task_runner, impl_task_runner), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 host_impl_client, | 139 host_impl_client, |
140 proxy, | 140 proxy, |
141 stats_instrumentation, | 141 stats_instrumentation, |
142 shared_bitmap_manager, | 142 shared_bitmap_manager, |
143 gpu_memory_buffer_manager, | 143 gpu_memory_buffer_manager, |
144 0), | 144 0), |
145 test_hooks_(test_hooks), | 145 test_hooks_(test_hooks), |
146 block_notify_ready_to_activate_for_testing_(false), | 146 block_notify_ready_to_activate_for_testing_(false), |
147 notify_ready_to_activate_was_blocked_(false) {} | 147 notify_ready_to_activate_was_blocked_(false) {} |
148 | 148 |
149 virtual void WillBeginImplFrame(const BeginFrameArgs& args) override { | 149 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
150 LayerTreeHostImpl::WillBeginImplFrame(args); | 150 LayerTreeHostImpl::WillBeginImplFrame(args); |
151 test_hooks_->WillBeginImplFrameOnThread(this, args); | 151 test_hooks_->WillBeginImplFrameOnThread(this, args); |
152 } | 152 } |
153 | 153 |
154 virtual void BeginMainFrameAborted(bool did_handle) override { | 154 void BeginMainFrameAborted(bool did_handle) override { |
155 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); | 155 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); |
156 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); | 156 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); |
157 } | 157 } |
158 | 158 |
159 virtual void BeginCommit() override { | 159 void BeginCommit() override { |
160 LayerTreeHostImpl::BeginCommit(); | 160 LayerTreeHostImpl::BeginCommit(); |
161 test_hooks_->BeginCommitOnThread(this); | 161 test_hooks_->BeginCommitOnThread(this); |
162 } | 162 } |
163 | 163 |
164 virtual void CommitComplete() override { | 164 void CommitComplete() override { |
165 LayerTreeHostImpl::CommitComplete(); | 165 LayerTreeHostImpl::CommitComplete(); |
166 test_hooks_->CommitCompleteOnThread(this); | 166 test_hooks_->CommitCompleteOnThread(this); |
167 } | 167 } |
168 | 168 |
169 virtual DrawResult PrepareToDraw(FrameData* frame) override { | 169 DrawResult PrepareToDraw(FrameData* frame) override { |
170 DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); | 170 DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); |
171 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); | 171 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); |
172 } | 172 } |
173 | 173 |
174 virtual void DrawLayers(FrameData* frame, | 174 void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time) override { |
175 base::TimeTicks frame_begin_time) override { | |
176 LayerTreeHostImpl::DrawLayers(frame, frame_begin_time); | 175 LayerTreeHostImpl::DrawLayers(frame, frame_begin_time); |
177 test_hooks_->DrawLayersOnThread(this); | 176 test_hooks_->DrawLayersOnThread(this); |
178 } | 177 } |
179 | 178 |
180 virtual bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) override { | 179 bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) override { |
181 bool result = LayerTreeHostImpl::SwapBuffers(frame); | 180 bool result = LayerTreeHostImpl::SwapBuffers(frame); |
182 test_hooks_->SwapBuffersOnThread(this, result); | 181 test_hooks_->SwapBuffersOnThread(this, result); |
183 return result; | 182 return result; |
184 } | 183 } |
185 | 184 |
186 virtual void DidSwapBuffersComplete() override { | 185 void DidSwapBuffersComplete() override { |
187 LayerTreeHostImpl::DidSwapBuffersComplete(); | 186 LayerTreeHostImpl::DidSwapBuffersComplete(); |
188 test_hooks_->SwapBuffersCompleteOnThread(this); | 187 test_hooks_->SwapBuffersCompleteOnThread(this); |
189 } | 188 } |
190 | 189 |
191 virtual void ReclaimResources(const CompositorFrameAck* ack) override { | 190 void ReclaimResources(const CompositorFrameAck* ack) override { |
192 LayerTreeHostImpl::ReclaimResources(ack); | 191 LayerTreeHostImpl::ReclaimResources(ack); |
193 } | 192 } |
194 | 193 |
195 virtual void UpdateVisibleTiles() override { | 194 void UpdateVisibleTiles() override { |
196 LayerTreeHostImpl::UpdateVisibleTiles(); | 195 LayerTreeHostImpl::UpdateVisibleTiles(); |
197 test_hooks_->UpdateVisibleTilesOnThread(this); | 196 test_hooks_->UpdateVisibleTilesOnThread(this); |
198 } | 197 } |
199 | 198 |
200 virtual void NotifyReadyToActivate() override { | 199 void NotifyReadyToActivate() override { |
201 if (block_notify_ready_to_activate_for_testing_) | 200 if (block_notify_ready_to_activate_for_testing_) |
202 notify_ready_to_activate_was_blocked_ = true; | 201 notify_ready_to_activate_was_blocked_ = true; |
203 else | 202 else |
204 client_->NotifyReadyToActivate(); | 203 client_->NotifyReadyToActivate(); |
205 } | 204 } |
206 | 205 |
207 virtual void BlockNotifyReadyToActivateForTesting(bool block) override { | 206 void BlockNotifyReadyToActivateForTesting(bool block) override { |
208 CHECK(settings().impl_side_painting); | 207 CHECK(settings().impl_side_painting); |
209 CHECK(proxy()->ImplThreadTaskRunner()) | 208 CHECK(proxy()->ImplThreadTaskRunner()) |
210 << "Not supported for single-threaded mode."; | 209 << "Not supported for single-threaded mode."; |
211 block_notify_ready_to_activate_for_testing_ = block; | 210 block_notify_ready_to_activate_for_testing_ = block; |
212 if (!block && notify_ready_to_activate_was_blocked_) { | 211 if (!block && notify_ready_to_activate_was_blocked_) { |
213 NotifyReadyToActivate(); | 212 NotifyReadyToActivate(); |
214 notify_ready_to_activate_was_blocked_ = false; | 213 notify_ready_to_activate_was_blocked_ = false; |
215 } | 214 } |
216 } | 215 } |
217 | 216 |
218 virtual void ActivateSyncTree() override { | 217 void ActivateSyncTree() override { |
219 test_hooks_->WillActivateTreeOnThread(this); | 218 test_hooks_->WillActivateTreeOnThread(this); |
220 LayerTreeHostImpl::ActivateSyncTree(); | 219 LayerTreeHostImpl::ActivateSyncTree(); |
221 DCHECK(!pending_tree()); | 220 DCHECK(!pending_tree()); |
222 test_hooks_->DidActivateTreeOnThread(this); | 221 test_hooks_->DidActivateTreeOnThread(this); |
223 } | 222 } |
224 | 223 |
225 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface) | 224 bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface) override { |
226 override { | |
227 bool success = LayerTreeHostImpl::InitializeRenderer(output_surface.Pass()); | 225 bool success = LayerTreeHostImpl::InitializeRenderer(output_surface.Pass()); |
228 test_hooks_->InitializedRendererOnThread(this, success); | 226 test_hooks_->InitializedRendererOnThread(this, success); |
229 return success; | 227 return success; |
230 } | 228 } |
231 | 229 |
232 virtual void SetVisible(bool visible) override { | 230 void SetVisible(bool visible) override { |
233 LayerTreeHostImpl::SetVisible(visible); | 231 LayerTreeHostImpl::SetVisible(visible); |
234 test_hooks_->DidSetVisibleOnImplTree(this, visible); | 232 test_hooks_->DidSetVisibleOnImplTree(this, visible); |
235 } | 233 } |
236 | 234 |
237 virtual void AnimateLayers(base::TimeTicks monotonic_time) override { | 235 void AnimateLayers(base::TimeTicks monotonic_time) override { |
238 test_hooks_->WillAnimateLayers(this, monotonic_time); | 236 test_hooks_->WillAnimateLayers(this, monotonic_time); |
239 LayerTreeHostImpl::AnimateLayers(monotonic_time); | 237 LayerTreeHostImpl::AnimateLayers(monotonic_time); |
240 test_hooks_->AnimateLayers(this, monotonic_time); | 238 test_hooks_->AnimateLayers(this, monotonic_time); |
241 } | 239 } |
242 | 240 |
243 virtual void UpdateAnimationState(bool start_ready_animations) override { | 241 void UpdateAnimationState(bool start_ready_animations) override { |
244 LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); | 242 LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); |
245 bool has_unfinished_animation = false; | 243 bool has_unfinished_animation = false; |
246 AnimationRegistrar::AnimationControllerMap::const_iterator iter = | 244 AnimationRegistrar::AnimationControllerMap::const_iterator iter = |
247 active_animation_controllers().begin(); | 245 active_animation_controllers().begin(); |
248 for (; iter != active_animation_controllers().end(); ++iter) { | 246 for (; iter != active_animation_controllers().end(); ++iter) { |
249 if (iter->second->HasActiveAnimation()) { | 247 if (iter->second->HasActiveAnimation()) { |
250 has_unfinished_animation = true; | 248 has_unfinished_animation = true; |
251 break; | 249 break; |
252 } | 250 } |
253 } | 251 } |
254 test_hooks_->UpdateAnimationState(this, has_unfinished_animation); | 252 test_hooks_->UpdateAnimationState(this, has_unfinished_animation); |
255 } | 253 } |
256 | 254 |
257 virtual base::TimeDelta LowFrequencyAnimationInterval() const override { | 255 base::TimeDelta LowFrequencyAnimationInterval() const override { |
258 return test_hooks_->LowFrequencyAnimationInterval(); | 256 return test_hooks_->LowFrequencyAnimationInterval(); |
259 } | 257 } |
260 | 258 |
261 private: | 259 private: |
262 TestHooks* test_hooks_; | 260 TestHooks* test_hooks_; |
263 bool block_notify_ready_to_activate_for_testing_; | 261 bool block_notify_ready_to_activate_for_testing_; |
264 bool notify_ready_to_activate_was_blocked_; | 262 bool notify_ready_to_activate_was_blocked_; |
265 }; | 263 }; |
266 | 264 |
267 // Implementation of LayerTreeHost callback interface. | 265 // Implementation of LayerTreeHost callback interface. |
268 class LayerTreeHostClientForTesting : public LayerTreeHostClient, | 266 class LayerTreeHostClientForTesting : public LayerTreeHostClient, |
269 public LayerTreeHostSingleThreadClient { | 267 public LayerTreeHostSingleThreadClient { |
270 public: | 268 public: |
271 static scoped_ptr<LayerTreeHostClientForTesting> Create( | 269 static scoped_ptr<LayerTreeHostClientForTesting> Create( |
272 TestHooks* test_hooks) { | 270 TestHooks* test_hooks) { |
273 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); | 271 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); |
274 } | 272 } |
275 virtual ~LayerTreeHostClientForTesting() {} | 273 ~LayerTreeHostClientForTesting() override {} |
276 | 274 |
277 virtual void WillBeginMainFrame(int frame_id) override { | 275 void WillBeginMainFrame(int frame_id) override { |
278 test_hooks_->WillBeginMainFrame(); | 276 test_hooks_->WillBeginMainFrame(); |
279 } | 277 } |
280 | 278 |
281 virtual void DidBeginMainFrame() override { | 279 void DidBeginMainFrame() override { test_hooks_->DidBeginMainFrame(); } |
282 test_hooks_->DidBeginMainFrame(); | |
283 } | |
284 | 280 |
285 virtual void BeginMainFrame(const BeginFrameArgs& args) override { | 281 void BeginMainFrame(const BeginFrameArgs& args) override { |
286 test_hooks_->BeginMainFrame(args); | 282 test_hooks_->BeginMainFrame(args); |
287 } | 283 } |
288 | 284 |
289 virtual void Layout() override { test_hooks_->Layout(); } | 285 void Layout() override { test_hooks_->Layout(); } |
290 | 286 |
291 virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, | 287 void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, |
292 const gfx::Vector2d& outer_delta, | 288 const gfx::Vector2d& outer_delta, |
293 float page_scale, | 289 float page_scale, |
294 float top_controls_delta) override { | 290 float top_controls_delta) override { |
295 test_hooks_->ApplyViewportDeltas(inner_delta, | 291 test_hooks_->ApplyViewportDeltas(inner_delta, |
296 outer_delta, | 292 outer_delta, |
297 page_scale, | 293 page_scale, |
298 top_controls_delta); | 294 top_controls_delta); |
299 } | 295 } |
300 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, | 296 void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, |
301 float scale, | 297 float scale, |
302 float top_controls_delta) override { | 298 float top_controls_delta) override { |
303 test_hooks_->ApplyViewportDeltas(scroll_delta, | 299 test_hooks_->ApplyViewportDeltas(scroll_delta, |
304 scale, | 300 scale, |
305 top_controls_delta); | 301 top_controls_delta); |
306 } | 302 } |
307 | 303 |
308 virtual void RequestNewOutputSurface(bool fallback) override { | 304 void RequestNewOutputSurface(bool fallback) override { |
309 test_hooks_->RequestNewOutputSurface(fallback); | 305 test_hooks_->RequestNewOutputSurface(fallback); |
310 } | 306 } |
311 | 307 |
312 virtual void DidInitializeOutputSurface() override { | 308 void DidInitializeOutputSurface() override { |
313 test_hooks_->DidInitializeOutputSurface(); | 309 test_hooks_->DidInitializeOutputSurface(); |
314 } | 310 } |
315 | 311 |
316 virtual void DidFailToInitializeOutputSurface() override { | 312 void DidFailToInitializeOutputSurface() override { |
317 test_hooks_->DidFailToInitializeOutputSurface(); | 313 test_hooks_->DidFailToInitializeOutputSurface(); |
318 } | 314 } |
319 | 315 |
320 virtual void WillCommit() override { test_hooks_->WillCommit(); } | 316 void WillCommit() override { test_hooks_->WillCommit(); } |
321 | 317 |
322 virtual void DidCommit() override { test_hooks_->DidCommit(); } | 318 void DidCommit() override { test_hooks_->DidCommit(); } |
323 | 319 |
324 virtual void DidCommitAndDrawFrame() override { | 320 void DidCommitAndDrawFrame() override { |
325 test_hooks_->DidCommitAndDrawFrame(); | 321 test_hooks_->DidCommitAndDrawFrame(); |
326 } | 322 } |
327 | 323 |
328 virtual void DidCompleteSwapBuffers() override { | 324 void DidCompleteSwapBuffers() override { |
329 test_hooks_->DidCompleteSwapBuffers(); | 325 test_hooks_->DidCompleteSwapBuffers(); |
330 } | 326 } |
331 | 327 |
332 virtual void DidPostSwapBuffers() override {} | 328 void DidPostSwapBuffers() override {} |
333 virtual void DidAbortSwapBuffers() override {} | 329 void DidAbortSwapBuffers() override {} |
334 | 330 |
335 private: | 331 private: |
336 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) | 332 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) |
337 : test_hooks_(test_hooks) {} | 333 : test_hooks_(test_hooks) {} |
338 | 334 |
339 TestHooks* test_hooks_; | 335 TestHooks* test_hooks_; |
340 }; | 336 }; |
341 | 337 |
342 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. | 338 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. |
343 class LayerTreeHostForTesting : public LayerTreeHost { | 339 class LayerTreeHostForTesting : public LayerTreeHost { |
(...skipping 12 matching lines...) Expand all Loading... |
356 layer_tree_host.get(), | 352 layer_tree_host.get(), |
357 main_task_runner, | 353 main_task_runner, |
358 impl_task_runner)); | 354 impl_task_runner)); |
359 } else { | 355 } else { |
360 layer_tree_host->InitializeForTesting(SingleThreadProxy::Create( | 356 layer_tree_host->InitializeForTesting(SingleThreadProxy::Create( |
361 layer_tree_host.get(), client, main_task_runner)); | 357 layer_tree_host.get(), client, main_task_runner)); |
362 } | 358 } |
363 return layer_tree_host.Pass(); | 359 return layer_tree_host.Pass(); |
364 } | 360 } |
365 | 361 |
366 virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 362 scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
367 LayerTreeHostImplClient* host_impl_client) override { | 363 LayerTreeHostImplClient* host_impl_client) override { |
368 return LayerTreeHostImplForTesting::Create( | 364 return LayerTreeHostImplForTesting::Create( |
369 test_hooks_, | 365 test_hooks_, |
370 settings(), | 366 settings(), |
371 host_impl_client, | 367 host_impl_client, |
372 proxy(), | 368 proxy(), |
373 shared_bitmap_manager_.get(), | 369 shared_bitmap_manager_.get(), |
374 gpu_memory_buffer_manager_.get(), | 370 gpu_memory_buffer_manager_.get(), |
375 rendering_stats_instrumentation()); | 371 rendering_stats_instrumentation()); |
376 } | 372 } |
377 | 373 |
378 virtual void SetNeedsCommit() override { | 374 void SetNeedsCommit() override { |
379 if (!test_started_) | 375 if (!test_started_) |
380 return; | 376 return; |
381 LayerTreeHost::SetNeedsCommit(); | 377 LayerTreeHost::SetNeedsCommit(); |
382 } | 378 } |
383 | 379 |
384 void set_test_started(bool started) { test_started_ = started; } | 380 void set_test_started(bool started) { test_started_ = started; } |
385 | 381 |
386 virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } | 382 void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } |
387 | 383 |
388 private: | 384 private: |
389 LayerTreeHostForTesting(TestHooks* test_hooks, | 385 LayerTreeHostForTesting(TestHooks* test_hooks, |
390 LayerTreeHostClient* client, | 386 LayerTreeHostClient* client, |
391 const LayerTreeSettings& settings) | 387 const LayerTreeSettings& settings) |
392 : LayerTreeHost(client, NULL, NULL, settings), | 388 : LayerTreeHost(client, NULL, NULL, settings), |
393 shared_bitmap_manager_(new TestSharedBitmapManager), | 389 shared_bitmap_manager_(new TestSharedBitmapManager), |
394 gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager), | 390 gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager), |
395 test_hooks_(test_hooks), | 391 test_hooks_(test_hooks), |
396 test_started_(false) {} | 392 test_started_(false) {} |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 return -1; | 714 return -1; |
719 } | 715 } |
720 | 716 |
721 void LayerTreeTest::DestroyLayerTreeHost() { | 717 void LayerTreeTest::DestroyLayerTreeHost() { |
722 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 718 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
723 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 719 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
724 layer_tree_host_ = nullptr; | 720 layer_tree_host_ = nullptr; |
725 } | 721 } |
726 | 722 |
727 } // namespace cc | 723 } // namespace cc |
OLD | NEW |