| 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 #include "cc/scheduler/scheduler.h" | 4 #include "cc/scheduler/scheduler.h" |
| 5 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class FakeSchedulerClient : public SchedulerClient { | 46 class FakeSchedulerClient : public SchedulerClient { |
| 47 public: | 47 public: |
| 48 struct FakeBeginFrameSourceForFakeSchedulerClient | 48 struct FakeBeginFrameSourceForFakeSchedulerClient |
| 49 : public FakeBeginFrameSource { | 49 : public FakeBeginFrameSource { |
| 50 FakeSchedulerClient* client_; | 50 FakeSchedulerClient* client_; |
| 51 | 51 |
| 52 explicit FakeBeginFrameSourceForFakeSchedulerClient( | 52 explicit FakeBeginFrameSourceForFakeSchedulerClient( |
| 53 FakeSchedulerClient* client) | 53 FakeSchedulerClient* client) |
| 54 : client_(client) {} | 54 : client_(client) {} |
| 55 | 55 |
| 56 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) OVERRIDE { | 56 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override { |
| 57 if (needs_begin_frames) { | 57 if (needs_begin_frames) { |
| 58 client_->actions_.push_back("SetNeedsBeginFrames(true)"); | 58 client_->actions_.push_back("SetNeedsBeginFrames(true)"); |
| 59 } else { | 59 } else { |
| 60 client_->actions_.push_back("SetNeedsBeginFrames(false)"); | 60 client_->actions_.push_back("SetNeedsBeginFrames(false)"); |
| 61 } | 61 } |
| 62 client_->states_.push_back(client_->scheduler_->AsValue()); | 62 client_->states_.push_back(client_->scheduler_->AsValue()); |
| 63 } | 63 } |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 FakeSchedulerClient() | 66 FakeSchedulerClient() |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const char* Action(int i) const { return actions_[i]; } | 100 const char* Action(int i) const { return actions_[i]; } |
| 101 std::string StateForAction(int i) const { return states_[i]->ToString(); } | 101 std::string StateForAction(int i) const { return states_[i]->ToString(); } |
| 102 base::TimeTicks posted_begin_impl_frame_deadline() const { | 102 base::TimeTicks posted_begin_impl_frame_deadline() const { |
| 103 return posted_begin_impl_frame_deadline_; | 103 return posted_begin_impl_frame_deadline_; |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool ExternalBeginFrame() { | 106 bool ExternalBeginFrame() { |
| 107 return scheduler_->settings().begin_frame_scheduling_enabled && | 107 return scheduler_->settings().begin_frame_scheduling_enabled && |
| 108 scheduler_->settings().throttle_frame_production; | 108 scheduler_->settings().throttle_frame_production; |
| 109 } | 109 } |
| 110 virtual FakeBeginFrameSource* ExternalBeginFrameSource() OVERRIDE { | 110 virtual FakeBeginFrameSource* ExternalBeginFrameSource() override { |
| 111 return &fake_frame_source_; | 111 return &fake_frame_source_; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void AdvanceFrame() { | 114 void AdvanceFrame() { |
| 115 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), | 115 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), |
| 116 "FakeSchedulerClient::AdvanceFrame"); | 116 "FakeSchedulerClient::AdvanceFrame"); |
| 117 // EXPECT_TRUE(needs_begin_frames()); | 117 // EXPECT_TRUE(needs_begin_frames()); |
| 118 if (ExternalBeginFrame()) { | 118 if (ExternalBeginFrame()) { |
| 119 // Creep the time forward so that any BeginFrameArgs is not equal to the | 119 // Creep the time forward so that any BeginFrameArgs is not equal to the |
| 120 // last one otherwise we violate the BeginFrameSource contract. | 120 // last one otherwise we violate the BeginFrameSource contract. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { | 152 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { |
| 153 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; | 153 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; |
| 154 } | 154 } |
| 155 void SetAutomaticSwapAck(bool automatic_swap_ack) { | 155 void SetAutomaticSwapAck(bool automatic_swap_ack) { |
| 156 automatic_swap_ack_ = automatic_swap_ack; | 156 automatic_swap_ack_ = automatic_swap_ack; |
| 157 } | 157 } |
| 158 void SetRedrawWillHappenIfUpdateVisibleTilesHappens(bool redraw) { | 158 void SetRedrawWillHappenIfUpdateVisibleTilesHappens(bool redraw) { |
| 159 redraw_will_happen_if_update_visible_tiles_happens_ = redraw; | 159 redraw_will_happen_if_update_visible_tiles_happens_ = redraw; |
| 160 } | 160 } |
| 161 // SchedulerClient implementation. | 161 // SchedulerClient implementation. |
| 162 virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE { | 162 virtual void WillBeginImplFrame(const BeginFrameArgs& args) override { |
| 163 actions_.push_back("WillBeginImplFrame"); | 163 actions_.push_back("WillBeginImplFrame"); |
| 164 states_.push_back(scheduler_->AsValue()); | 164 states_.push_back(scheduler_->AsValue()); |
| 165 } | 165 } |
| 166 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE { | 166 virtual void ScheduledActionSendBeginMainFrame() override { |
| 167 actions_.push_back("ScheduledActionSendBeginMainFrame"); | 167 actions_.push_back("ScheduledActionSendBeginMainFrame"); |
| 168 states_.push_back(scheduler_->AsValue()); | 168 states_.push_back(scheduler_->AsValue()); |
| 169 } | 169 } |
| 170 virtual void ScheduledActionAnimate() OVERRIDE { | 170 virtual void ScheduledActionAnimate() override { |
| 171 actions_.push_back("ScheduledActionAnimate"); | 171 actions_.push_back("ScheduledActionAnimate"); |
| 172 states_.push_back(scheduler_->AsValue()); | 172 states_.push_back(scheduler_->AsValue()); |
| 173 } | 173 } |
| 174 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE { | 174 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
| 175 actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); | 175 actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); |
| 176 states_.push_back(scheduler_->AsValue()); | 176 states_.push_back(scheduler_->AsValue()); |
| 177 num_draws_++; | 177 num_draws_++; |
| 178 DrawResult result = | 178 DrawResult result = |
| 179 draw_will_happen_ ? DRAW_SUCCESS : DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; | 179 draw_will_happen_ ? DRAW_SUCCESS : DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; |
| 180 bool swap_will_happen = | 180 bool swap_will_happen = |
| 181 draw_will_happen_ && swap_will_happen_if_draw_happens_; | 181 draw_will_happen_ && swap_will_happen_if_draw_happens_; |
| 182 if (swap_will_happen) { | 182 if (swap_will_happen) { |
| 183 scheduler_->DidSwapBuffers(); | 183 scheduler_->DidSwapBuffers(); |
| 184 if (swap_contains_incomplete_tile_) { | 184 if (swap_contains_incomplete_tile_) { |
| 185 scheduler_->SetSwapUsedIncompleteTile(true); | 185 scheduler_->SetSwapUsedIncompleteTile(true); |
| 186 swap_contains_incomplete_tile_ = false; | 186 swap_contains_incomplete_tile_ = false; |
| 187 } else { | 187 } else { |
| 188 scheduler_->SetSwapUsedIncompleteTile(false); | 188 scheduler_->SetSwapUsedIncompleteTile(false); |
| 189 } | 189 } |
| 190 | 190 |
| 191 if (automatic_swap_ack_) | 191 if (automatic_swap_ack_) |
| 192 scheduler_->DidSwapBuffersComplete(); | 192 scheduler_->DidSwapBuffersComplete(); |
| 193 } | 193 } |
| 194 return result; | 194 return result; |
| 195 } | 195 } |
| 196 virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE { | 196 virtual DrawResult ScheduledActionDrawAndSwapForced() override { |
| 197 actions_.push_back("ScheduledActionDrawAndSwapForced"); | 197 actions_.push_back("ScheduledActionDrawAndSwapForced"); |
| 198 states_.push_back(scheduler_->AsValue()); | 198 states_.push_back(scheduler_->AsValue()); |
| 199 return DRAW_SUCCESS; | 199 return DRAW_SUCCESS; |
| 200 } | 200 } |
| 201 virtual void ScheduledActionCommit() OVERRIDE { | 201 virtual void ScheduledActionCommit() override { |
| 202 actions_.push_back("ScheduledActionCommit"); | 202 actions_.push_back("ScheduledActionCommit"); |
| 203 states_.push_back(scheduler_->AsValue()); | 203 states_.push_back(scheduler_->AsValue()); |
| 204 } | 204 } |
| 205 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE { | 205 virtual void ScheduledActionUpdateVisibleTiles() override { |
| 206 actions_.push_back("ScheduledActionUpdateVisibleTiles"); | 206 actions_.push_back("ScheduledActionUpdateVisibleTiles"); |
| 207 states_.push_back(scheduler_->AsValue()); | 207 states_.push_back(scheduler_->AsValue()); |
| 208 if (redraw_will_happen_if_update_visible_tiles_happens_) | 208 if (redraw_will_happen_if_update_visible_tiles_happens_) |
| 209 scheduler_->SetNeedsRedraw(); | 209 scheduler_->SetNeedsRedraw(); |
| 210 } | 210 } |
| 211 virtual void ScheduledActionActivateSyncTree() OVERRIDE { | 211 virtual void ScheduledActionActivateSyncTree() override { |
| 212 actions_.push_back("ScheduledActionActivateSyncTree"); | 212 actions_.push_back("ScheduledActionActivateSyncTree"); |
| 213 states_.push_back(scheduler_->AsValue()); | 213 states_.push_back(scheduler_->AsValue()); |
| 214 } | 214 } |
| 215 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE { | 215 virtual void ScheduledActionBeginOutputSurfaceCreation() override { |
| 216 actions_.push_back("ScheduledActionBeginOutputSurfaceCreation"); | 216 actions_.push_back("ScheduledActionBeginOutputSurfaceCreation"); |
| 217 states_.push_back(scheduler_->AsValue()); | 217 states_.push_back(scheduler_->AsValue()); |
| 218 } | 218 } |
| 219 virtual void ScheduledActionManageTiles() OVERRIDE { | 219 virtual void ScheduledActionManageTiles() override { |
| 220 actions_.push_back("ScheduledActionManageTiles"); | 220 actions_.push_back("ScheduledActionManageTiles"); |
| 221 states_.push_back(scheduler_->AsValue()); | 221 states_.push_back(scheduler_->AsValue()); |
| 222 } | 222 } |
| 223 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { | 223 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override { |
| 224 if (log_anticipated_draw_time_change_) | 224 if (log_anticipated_draw_time_change_) |
| 225 actions_.push_back("DidAnticipatedDrawTimeChange"); | 225 actions_.push_back("DidAnticipatedDrawTimeChange"); |
| 226 } | 226 } |
| 227 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE { | 227 virtual base::TimeDelta DrawDurationEstimate() override { |
| 228 return base::TimeDelta(); | 228 return base::TimeDelta(); |
| 229 } | 229 } |
| 230 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE { | 230 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { |
| 231 return base::TimeDelta(); | 231 return base::TimeDelta(); |
| 232 } | 232 } |
| 233 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE { | 233 virtual base::TimeDelta CommitToActivateDurationEstimate() override { |
| 234 return base::TimeDelta(); | 234 return base::TimeDelta(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 virtual void DidBeginImplFrameDeadline() OVERRIDE {} | 237 virtual void DidBeginImplFrameDeadline() override {} |
| 238 | 238 |
| 239 base::Callback<bool(void)> ImplFrameDeadlinePending(bool state) { | 239 base::Callback<bool(void)> ImplFrameDeadlinePending(bool state) { |
| 240 return base::Bind(&FakeSchedulerClient::ImplFrameDeadlinePendingCallback, | 240 return base::Bind(&FakeSchedulerClient::ImplFrameDeadlinePendingCallback, |
| 241 base::Unretained(this), | 241 base::Unretained(this), |
| 242 state); | 242 state); |
| 243 } | 243 } |
| 244 | 244 |
| 245 protected: | 245 protected: |
| 246 bool ImplFrameDeadlinePendingCallback(bool state) { | 246 bool ImplFrameDeadlinePendingCallback(bool state) { |
| 247 return scheduler_->BeginImplFrameDeadlinePending() == state; | 247 return scheduler_->BeginImplFrameDeadlinePending() == state; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // On the next BeginImplFrame, verify we go back to a quiescent state and | 448 // On the next BeginImplFrame, verify we go back to a quiescent state and |
| 449 // no longer request BeginImplFrames. | 449 // no longer request BeginImplFrames. |
| 450 client.AdvanceFrame(); | 450 client.AdvanceFrame(); |
| 451 client.task_runner().RunPendingTasks(); // Run posted deadline. | 451 client.task_runner().RunPendingTasks(); // Run posted deadline. |
| 452 EXPECT_FALSE(client.needs_begin_frames()); | 452 EXPECT_FALSE(client.needs_begin_frames()); |
| 453 client.Reset(); | 453 client.Reset(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 class SchedulerClientThatsetNeedsDrawInsideDraw : public FakeSchedulerClient { | 456 class SchedulerClientThatsetNeedsDrawInsideDraw : public FakeSchedulerClient { |
| 457 public: | 457 public: |
| 458 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {} | 458 virtual void ScheduledActionSendBeginMainFrame() override {} |
| 459 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() | 459 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() |
| 460 OVERRIDE { | 460 override { |
| 461 // Only SetNeedsRedraw the first time this is called | 461 // Only SetNeedsRedraw the first time this is called |
| 462 if (!num_draws_) | 462 if (!num_draws_) |
| 463 scheduler_->SetNeedsRedraw(); | 463 scheduler_->SetNeedsRedraw(); |
| 464 return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); | 464 return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE { | 467 virtual DrawResult ScheduledActionDrawAndSwapForced() override { |
| 468 NOTREACHED(); | 468 NOTREACHED(); |
| 469 return DRAW_SUCCESS; | 469 return DRAW_SUCCESS; |
| 470 } | 470 } |
| 471 | 471 |
| 472 virtual void ScheduledActionCommit() OVERRIDE {} | 472 virtual void ScheduledActionCommit() override {} |
| 473 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {} | 473 virtual void ScheduledActionBeginOutputSurfaceCreation() override {} |
| 474 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {} | 474 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {} |
| 475 }; | 475 }; |
| 476 | 476 |
| 477 // Tests for two different situations: | 477 // Tests for two different situations: |
| 478 // 1. the scheduler dropping SetNeedsRedraw requests that happen inside | 478 // 1. the scheduler dropping SetNeedsRedraw requests that happen inside |
| 479 // a ScheduledActionDrawAndSwap | 479 // a ScheduledActionDrawAndSwap |
| 480 // 2. the scheduler drawing twice inside a single tick | 480 // 2. the scheduler drawing twice inside a single tick |
| 481 TEST(SchedulerTest, RequestRedrawInsideDraw) { | 481 TEST(SchedulerTest, RequestRedrawInsideDraw) { |
| 482 SchedulerClientThatsetNeedsDrawInsideDraw client; | 482 SchedulerClientThatsetNeedsDrawInsideDraw client; |
| 483 SchedulerSettings default_scheduler_settings; | 483 SchedulerSettings default_scheduler_settings; |
| 484 TestScheduler* scheduler = client.CreateScheduler(default_scheduler_settings); | 484 TestScheduler* scheduler = client.CreateScheduler(default_scheduler_settings); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 EXPECT_TRUE(scheduler->CommitPending()); | 559 EXPECT_TRUE(scheduler->CommitPending()); |
| 560 EXPECT_FALSE(scheduler->RedrawPending()); | 560 EXPECT_FALSE(scheduler->RedrawPending()); |
| 561 EXPECT_TRUE(client.needs_begin_frames()); | 561 EXPECT_TRUE(client.needs_begin_frames()); |
| 562 } | 562 } |
| 563 | 563 |
| 564 class SchedulerClientThatSetNeedsCommitInsideDraw : public FakeSchedulerClient { | 564 class SchedulerClientThatSetNeedsCommitInsideDraw : public FakeSchedulerClient { |
| 565 public: | 565 public: |
| 566 SchedulerClientThatSetNeedsCommitInsideDraw() | 566 SchedulerClientThatSetNeedsCommitInsideDraw() |
| 567 : set_needs_commit_on_next_draw_(false) {} | 567 : set_needs_commit_on_next_draw_(false) {} |
| 568 | 568 |
| 569 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {} | 569 virtual void ScheduledActionSendBeginMainFrame() override {} |
| 570 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() | 570 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() |
| 571 OVERRIDE { | 571 override { |
| 572 // Only SetNeedsCommit the first time this is called | 572 // Only SetNeedsCommit the first time this is called |
| 573 if (set_needs_commit_on_next_draw_) { | 573 if (set_needs_commit_on_next_draw_) { |
| 574 scheduler_->SetNeedsCommit(); | 574 scheduler_->SetNeedsCommit(); |
| 575 set_needs_commit_on_next_draw_ = false; | 575 set_needs_commit_on_next_draw_ = false; |
| 576 } | 576 } |
| 577 return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); | 577 return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); |
| 578 } | 578 } |
| 579 | 579 |
| 580 virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE { | 580 virtual DrawResult ScheduledActionDrawAndSwapForced() override { |
| 581 NOTREACHED(); | 581 NOTREACHED(); |
| 582 return DRAW_SUCCESS; | 582 return DRAW_SUCCESS; |
| 583 } | 583 } |
| 584 | 584 |
| 585 virtual void ScheduledActionCommit() OVERRIDE {} | 585 virtual void ScheduledActionCommit() override {} |
| 586 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {} | 586 virtual void ScheduledActionBeginOutputSurfaceCreation() override {} |
| 587 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {} | 587 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {} |
| 588 | 588 |
| 589 void SetNeedsCommitOnNextDraw() { set_needs_commit_on_next_draw_ = true; } | 589 void SetNeedsCommitOnNextDraw() { set_needs_commit_on_next_draw_ = true; } |
| 590 | 590 |
| 591 private: | 591 private: |
| 592 bool set_needs_commit_on_next_draw_; | 592 bool set_needs_commit_on_next_draw_; |
| 593 }; | 593 }; |
| 594 | 594 |
| 595 // Tests for the scheduler infinite-looping on SetNeedsCommit requests that | 595 // Tests for the scheduler infinite-looping on SetNeedsCommit requests that |
| 596 // happen inside a ScheduledActionDrawAndSwap | 596 // happen inside a ScheduledActionDrawAndSwap |
| 597 TEST(SchedulerTest, RequestCommitInsideDraw) { | 597 TEST(SchedulerTest, RequestCommitInsideDraw) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 client.SetDrawWillHappen(false); | 715 client.SetDrawWillHappen(false); |
| 716 client.SetNeedsCommitOnNextDraw(); | 716 client.SetNeedsCommitOnNextDraw(); |
| 717 client.AdvanceFrame(); | 717 client.AdvanceFrame(); |
| 718 client.task_runner().RunPendingTasks(); // Run posted deadline. | 718 client.task_runner().RunPendingTasks(); // Run posted deadline. |
| 719 EXPECT_EQ(2, client.num_draws()); | 719 EXPECT_EQ(2, client.num_draws()); |
| 720 } | 720 } |
| 721 | 721 |
| 722 class SchedulerClientNeedsManageTilesInDraw : public FakeSchedulerClient { | 722 class SchedulerClientNeedsManageTilesInDraw : public FakeSchedulerClient { |
| 723 public: | 723 public: |
| 724 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() | 724 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() |
| 725 OVERRIDE { | 725 override { |
| 726 scheduler_->SetNeedsManageTiles(); | 726 scheduler_->SetNeedsManageTiles(); |
| 727 return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); | 727 return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); |
| 728 } | 728 } |
| 729 }; | 729 }; |
| 730 | 730 |
| 731 // Test manage tiles is independant of draws. | 731 // Test manage tiles is independant of draws. |
| 732 TEST(SchedulerTest, ManageTiles) { | 732 TEST(SchedulerTest, ManageTiles) { |
| 733 SchedulerClientNeedsManageTilesInDraw client; | 733 SchedulerClientNeedsManageTilesInDraw client; |
| 734 SchedulerSettings default_scheduler_settings; | 734 SchedulerSettings default_scheduler_settings; |
| 735 TestScheduler* scheduler = client.CreateScheduler(default_scheduler_settings); | 735 TestScheduler* scheduler = client.CreateScheduler(default_scheduler_settings); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 public: | 1036 public: |
| 1037 SchedulerClientWithFixedEstimates( | 1037 SchedulerClientWithFixedEstimates( |
| 1038 base::TimeDelta draw_duration, | 1038 base::TimeDelta draw_duration, |
| 1039 base::TimeDelta begin_main_frame_to_commit_duration, | 1039 base::TimeDelta begin_main_frame_to_commit_duration, |
| 1040 base::TimeDelta commit_to_activate_duration) | 1040 base::TimeDelta commit_to_activate_duration) |
| 1041 : draw_duration_(draw_duration), | 1041 : draw_duration_(draw_duration), |
| 1042 begin_main_frame_to_commit_duration_( | 1042 begin_main_frame_to_commit_duration_( |
| 1043 begin_main_frame_to_commit_duration), | 1043 begin_main_frame_to_commit_duration), |
| 1044 commit_to_activate_duration_(commit_to_activate_duration) {} | 1044 commit_to_activate_duration_(commit_to_activate_duration) {} |
| 1045 | 1045 |
| 1046 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE { | 1046 virtual base::TimeDelta DrawDurationEstimate() override { |
| 1047 return draw_duration_; | 1047 return draw_duration_; |
| 1048 } | 1048 } |
| 1049 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE { | 1049 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { |
| 1050 return begin_main_frame_to_commit_duration_; | 1050 return begin_main_frame_to_commit_duration_; |
| 1051 } | 1051 } |
| 1052 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE { | 1052 virtual base::TimeDelta CommitToActivateDurationEstimate() override { |
| 1053 return commit_to_activate_duration_; | 1053 return commit_to_activate_duration_; |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 private: | 1056 private: |
| 1057 base::TimeDelta draw_duration_; | 1057 base::TimeDelta draw_duration_; |
| 1058 base::TimeDelta begin_main_frame_to_commit_duration_; | 1058 base::TimeDelta begin_main_frame_to_commit_duration_; |
| 1059 base::TimeDelta commit_to_activate_duration_; | 1059 base::TimeDelta commit_to_activate_duration_; |
| 1060 }; | 1060 }; |
| 1061 | 1061 |
| 1062 void MainFrameInHighLatencyMode(int64 begin_main_frame_to_commit_estimate_in_ms, | 1062 void MainFrameInHighLatencyMode(int64 begin_main_frame_to_commit_estimate_in_ms, |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1962 | 1962 |
| 1963 client.Reset(); | 1963 client.Reset(); |
| 1964 scheduler->SetVisible(false); | 1964 scheduler->SetVisible(false); |
| 1965 // Sync tree should be forced to activate. | 1965 // Sync tree should be forced to activate. |
| 1966 EXPECT_ACTION("SetNeedsBeginFrames(false)", client, 0, 2); | 1966 EXPECT_ACTION("SetNeedsBeginFrames(false)", client, 0, 2); |
| 1967 EXPECT_ACTION("ScheduledActionActivateSyncTree", client, 1, 2); | 1967 EXPECT_ACTION("ScheduledActionActivateSyncTree", client, 1, 2); |
| 1968 } | 1968 } |
| 1969 | 1969 |
| 1970 } // namespace | 1970 } // namespace |
| 1971 } // namespace cc | 1971 } // namespace cc |
| OLD | NEW |