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

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

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Many optimizations. Address comments. 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
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 states_.push_back(scheduler_->StateAsStringForTesting()); 111 states_.push_back(scheduler_->StateAsStringForTesting());
112 } 112 }
113 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE { 113 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE {
114 actions_.push_back("ScheduledActionAcquireLayerTexturesForMainThread"); 114 actions_.push_back("ScheduledActionAcquireLayerTexturesForMainThread");
115 states_.push_back(scheduler_->StateAsStringForTesting()); 115 states_.push_back(scheduler_->StateAsStringForTesting());
116 } 116 }
117 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {} 117 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {}
118 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE { 118 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE {
119 return base::TimeDelta(); 119 return base::TimeDelta();
120 } 120 }
121 virtual void PostBeginFrameDeadlineTask(base::TimeTicks deadline) OVERRIDE {
122 actions_.push_back("PostBeginFrameDeadlineTask");
123 states_.push_back(scheduler_->StateAsStringForTesting());
124 }
121 125
122 protected: 126 protected:
123 bool needs_begin_frame_; 127 bool needs_begin_frame_;
124 bool draw_will_happen_; 128 bool draw_will_happen_;
125 bool swap_will_happen_if_draw_happens_; 129 bool swap_will_happen_if_draw_happens_;
126 int num_draws_; 130 int num_draws_;
127 std::vector<const char*> actions_; 131 std::vector<const char*> actions_;
128 std::vector<std::string> states_; 132 std::vector<std::string> states_;
129 scoped_ptr<Scheduler> scheduler_; 133 scoped_ptr<Scheduler> scheduler_;
130 }; 134 };
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 595
592 // Get the compositor to do a ScheduledActionDrawAndSwapForced. 596 // Get the compositor to do a ScheduledActionDrawAndSwapForced.
593 scheduler->SetCanDraw(true); 597 scheduler->SetCanDraw(true);
594 scheduler->SetNeedsRedraw(); 598 scheduler->SetNeedsRedraw();
595 scheduler->SetNeedsForcedRedraw(); 599 scheduler->SetNeedsForcedRedraw();
596 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapForced")); 600 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapForced"));
597 } 601 }
598 602
599 } // namespace 603 } // namespace
600 } // namespace cc 604 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698