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

Side by Side Diff: cc/scheduler/scheduler_unittest.cc

Issue 16574002: Estimate draw duration in SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE { 103 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {
104 actions_.push_back("ScheduledActionBeginOutputSurfaceCreation"); 104 actions_.push_back("ScheduledActionBeginOutputSurfaceCreation");
105 states_.push_back(scheduler_->StateAsStringForTesting()); 105 states_.push_back(scheduler_->StateAsStringForTesting());
106 } 106 }
107 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE { 107 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE {
108 actions_.push_back("ScheduledActionAcquireLayerTexturesForMainThread"); 108 actions_.push_back("ScheduledActionAcquireLayerTexturesForMainThread");
109 states_.push_back(scheduler_->StateAsStringForTesting()); 109 states_.push_back(scheduler_->StateAsStringForTesting());
110 } 110 }
111 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {} 111 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {}
112 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE {
113 return base::TimeDelta();
114 }
112 115
113 protected: 116 protected:
114 bool draw_will_happen_; 117 bool draw_will_happen_;
115 bool swap_will_happen_if_draw_happens_; 118 bool swap_will_happen_if_draw_happens_;
116 int num_draws_; 119 int num_draws_;
117 std::vector<const char*> actions_; 120 std::vector<const char*> actions_;
118 std::vector<std::string> states_; 121 std::vector<std::string> states_;
119 scoped_ptr<Scheduler> scheduler_; 122 scoped_ptr<Scheduler> scheduler_;
120 }; 123 };
121 124
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 scheduler->DidLoseOutputSurface(); 643 scheduler->DidLoseOutputSurface();
641 // Verifying that it's 1 so that we know that it's reset on recreate. 644 // Verifying that it's 1 so that we know that it's reset on recreate.
642 EXPECT_EQ(1, controller_ptr->NumFramesPending()); 645 EXPECT_EQ(1, controller_ptr->NumFramesPending());
643 646
644 scheduler->DidCreateAndInitializeOutputSurface(); 647 scheduler->DidCreateAndInitializeOutputSurface();
645 EXPECT_EQ(0, controller_ptr->NumFramesPending()); 648 EXPECT_EQ(0, controller_ptr->NumFramesPending());
646 } 649 }
647 650
648 } // namespace 651 } // namespace
649 } // namespace cc 652 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698