| 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/scheduler/scheduler.h" | 5 #include "cc/scheduler/scheduler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 base::TimeDelta CommitToActivateDurationEstimate() override { | 221 base::TimeDelta CommitToActivateDurationEstimate() override { |
| 222 return commit_to_activate_duration_; | 222 return commit_to_activate_duration_; |
| 223 } | 223 } |
| 224 | 224 |
| 225 private: | 225 private: |
| 226 base::TimeDelta draw_duration_; | 226 base::TimeDelta draw_duration_; |
| 227 base::TimeDelta begin_main_frame_to_commit_duration_; | 227 base::TimeDelta begin_main_frame_to_commit_duration_; |
| 228 base::TimeDelta commit_to_activate_duration_; | 228 base::TimeDelta commit_to_activate_duration_; |
| 229 }; | 229 }; |
| 230 | 230 |
| 231 class FakeExternalBeginFrameSource : public BeginFrameSourceMixIn { | 231 class FakeExternalBeginFrameSource : public BeginFrameSourceBase { |
| 232 public: | 232 public: |
| 233 explicit FakeExternalBeginFrameSource(FakeSchedulerClient* client) | 233 explicit FakeExternalBeginFrameSource(FakeSchedulerClient* client) |
| 234 : client_(client) {} | 234 : client_(client) {} |
| 235 ~FakeExternalBeginFrameSource() override {} | 235 ~FakeExternalBeginFrameSource() override {} |
| 236 | 236 |
| 237 void OnNeedsBeginFramesChange(bool needs_begin_frames) override { | 237 void OnNeedsBeginFramesChange(bool needs_begin_frames) override { |
| 238 if (needs_begin_frames) { | 238 if (needs_begin_frames) { |
| 239 client_->PushAction("SetNeedsBeginFrames(true)"); | 239 client_->PushAction("SetNeedsBeginFrames(true)"); |
| 240 } else { | 240 } else { |
| 241 client_->PushAction("SetNeedsBeginFrames(false)"); | 241 client_->PushAction("SetNeedsBeginFrames(false)"); |
| (...skipping 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 EXPECT_SCOPED(AdvanceFrame()); | 2998 EXPECT_SCOPED(AdvanceFrame()); |
| 2999 | 2999 |
| 3000 // At the next BeginFrame, authoritative interval is used instead of previous | 3000 // At the next BeginFrame, authoritative interval is used instead of previous |
| 3001 // interval. | 3001 // interval. |
| 3002 EXPECT_NE(initial_interval, scheduler_->BeginImplFrameInterval()); | 3002 EXPECT_NE(initial_interval, scheduler_->BeginImplFrameInterval()); |
| 3003 EXPECT_EQ(authoritative_interval, scheduler_->BeginImplFrameInterval()); | 3003 EXPECT_EQ(authoritative_interval, scheduler_->BeginImplFrameInterval()); |
| 3004 } | 3004 } |
| 3005 | 3005 |
| 3006 } // namespace | 3006 } // namespace |
| 3007 } // namespace cc | 3007 } // namespace cc |
| OLD | NEW |