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