Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 672283003: cc: ReadyToDraw notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void ReclaimResources(const CompositorFrameAck* ack) override { 207 void ReclaimResources(const CompositorFrameAck* ack) override {
208 LayerTreeHostImpl::ReclaimResources(ack); 208 LayerTreeHostImpl::ReclaimResources(ack);
209 } 209 }
210 210
211 void UpdateVisibleTiles() override { 211 void UpdateVisibleTiles() override {
212 LayerTreeHostImpl::UpdateVisibleTiles(); 212 LayerTreeHostImpl::UpdateVisibleTiles();
213 test_hooks_->UpdateVisibleTilesOnThread(this); 213 test_hooks_->UpdateVisibleTilesOnThread(this);
214 } 214 }
215 215
216 void NotifyReadyToActivate() override { 216 void NotifyReadyToActivate() override {
217 if (block_notify_ready_to_activate_for_testing_) 217 if (block_notify_ready_to_activate_for_testing_) {
218 notify_ready_to_activate_was_blocked_ = true; 218 notify_ready_to_activate_was_blocked_ = true;
219 else 219 } else {
220 client_->NotifyReadyToActivate(); 220 client_->NotifyReadyToActivate();
221 test_hooks_->NotifyReadyToActivateOnThread(this);
222 }
223 }
224
225 void NotifyReadyToDraw() override {
226 client_->NotifyReadyToDraw();
227 test_hooks_->NotifyReadyToDrawOnThread(this);
221 } 228 }
222 229
223 void BlockNotifyReadyToActivateForTesting(bool block) override { 230 void BlockNotifyReadyToActivateForTesting(bool block) override {
224 CHECK(settings().impl_side_painting); 231 CHECK(settings().impl_side_painting);
225 CHECK(proxy()->ImplThreadTaskRunner()) 232 CHECK(proxy()->ImplThreadTaskRunner())
226 << "Not supported for single-threaded mode."; 233 << "Not supported for single-threaded mode.";
227 block_notify_ready_to_activate_for_testing_ = block; 234 block_notify_ready_to_activate_for_testing_ = block;
228 if (!block && notify_ready_to_activate_was_blocked_) { 235 if (!block && notify_ready_to_activate_was_blocked_) {
229 NotifyReadyToActivate(); 236 NotifyReadyToActivate();
230 notify_ready_to_activate_was_blocked_ = false; 237 notify_ready_to_activate_was_blocked_ = false;
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 return -1; 753 return -1;
747 } 754 }
748 755
749 void LayerTreeTest::DestroyLayerTreeHost() { 756 void LayerTreeTest::DestroyLayerTreeHost() {
750 if (layer_tree_host_ && layer_tree_host_->root_layer()) 757 if (layer_tree_host_ && layer_tree_host_->root_layer())
751 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 758 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL);
752 layer_tree_host_ = nullptr; 759 layer_tree_host_ = nullptr;
753 } 760 }
754 761
755 } // namespace cc 762 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698