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

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

Issue 1432463002: cc: Track BeginMainFrame more precisely in CompositorTimingHistory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. New tests to be added. Created 5 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 "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool animate) override { 206 bool animate) override {
207 ThreadProxy::UpdateTopControlsStateOnImpl(constraints, current, animate); 207 ThreadProxy::UpdateTopControlsStateOnImpl(constraints, current, animate);
208 test_hooks_->UpdateTopControlsStateOnImpl(constraints, current, animate); 208 test_hooks_->UpdateTopControlsStateOnImpl(constraints, current, animate);
209 } 209 }
210 210
211 void SetDeferCommitsOnImpl(bool defer_commits) const override { 211 void SetDeferCommitsOnImpl(bool defer_commits) const override {
212 ThreadProxy::SetDeferCommitsOnImpl(defer_commits); 212 ThreadProxy::SetDeferCommitsOnImpl(defer_commits);
213 test_hooks_->SetDeferCommitsOnImpl(defer_commits); 213 test_hooks_->SetDeferCommitsOnImpl(defer_commits);
214 } 214 }
215 215
216 void BeginMainFrameAbortedOnImpl(CommitEarlyOutReason reason) override { 216 void BeginMainFrameAbortedOnImpl(
217 ThreadProxy::BeginMainFrameAbortedOnImpl(reason); 217 CommitEarlyOutReason reason,
218 base::TimeTicks main_thread_start_time) override {
219 ThreadProxy::BeginMainFrameAbortedOnImpl(reason, main_thread_start_time);
218 test_hooks_->BeginMainFrameAbortedOnImpl(reason); 220 test_hooks_->BeginMainFrameAbortedOnImpl(reason);
219 } 221 }
220 222
221 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override { 223 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override {
222 ThreadProxy::SetNeedsRedrawOnImpl(damage_rect); 224 ThreadProxy::SetNeedsRedrawOnImpl(damage_rect);
223 test_hooks_->SetNeedsRedrawOnImpl(damage_rect); 225 test_hooks_->SetNeedsRedrawOnImpl(damage_rect);
224 }; 226 };
225 227
226 void SetNeedsCommitOnImpl() override { 228 void SetNeedsCommitOnImpl() override {
227 ThreadProxy::SetNeedsCommitOnImpl(); 229 ThreadProxy::SetNeedsCommitOnImpl();
(...skipping 13 matching lines...) Expand all
241 void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override { 243 void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override {
242 ThreadProxy::ReleaseOutputSurfaceOnImpl(completion); 244 ThreadProxy::ReleaseOutputSurfaceOnImpl(completion);
243 test_hooks_->ReleaseOutputSurfaceOnImpl(); 245 test_hooks_->ReleaseOutputSurfaceOnImpl();
244 } 246 }
245 247
246 void FinishGLOnImpl(CompletionEvent* completion) override { 248 void FinishGLOnImpl(CompletionEvent* completion) override {
247 ThreadProxy::FinishGLOnImpl(completion); 249 ThreadProxy::FinishGLOnImpl(completion);
248 test_hooks_->FinishGLOnImpl(); 250 test_hooks_->FinishGLOnImpl();
249 } 251 }
250 252
251 void StartCommitOnImpl(CompletionEvent* completion) override { 253 void StartCommitOnImpl(CompletionEvent* completion,
252 ThreadProxy::StartCommitOnImpl(completion); 254 base::TimeTicks main_thread_start_time) override {
255 ThreadProxy::StartCommitOnImpl(completion, main_thread_start_time);
253 test_hooks_->StartCommitOnImpl(); 256 test_hooks_->StartCommitOnImpl();
254 } 257 }
255 258
256 void DidCompleteSwapBuffers() override { 259 void DidCompleteSwapBuffers() override {
257 ThreadProxy::DidCompleteSwapBuffers(); 260 ThreadProxy::DidCompleteSwapBuffers();
258 test_hooks_->ReceivedDidCompleteSwapBuffers(); 261 test_hooks_->ReceivedDidCompleteSwapBuffers();
259 } 262 }
260 263
261 void SetRendererCapabilitiesMainCopy( 264 void SetRendererCapabilitiesMainCopy(
262 const RendererCapabilities& capabilities) override { 265 const RendererCapabilities& capabilities) override {
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 LayerTreeHost* LayerTreeTest::layer_tree_host() { 1136 LayerTreeHost* LayerTreeTest::layer_tree_host() {
1134 // We check for a null proxy here as we sometimes ask for the layer tree host 1137 // We check for a null proxy here as we sometimes ask for the layer tree host
1135 // when the proxy does not exist, often for checking settings after a test has 1138 // when the proxy does not exist, often for checking settings after a test has
1136 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See 1139 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See
1137 // elsewhere in this file for other examples. 1140 // elsewhere in this file for other examples.
1138 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); 1141 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked());
1139 return layer_tree_host_.get(); 1142 return layer_tree_host_.get();
1140 } 1143 }
1141 1144
1142 } // namespace cc 1145 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698