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

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

Issue 12804006: cc: Save correct frame begin time to FrameRateCounter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 188402 Created 7 years, 9 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
« no previous file with comments | « cc/test/layer_tree_test_common.h ('k') | cc/thread_proxy.cc » ('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/test/layer_tree_test_common.h" 5 #include "cc/test/layer_tree_test_common.h"
6 6
7 #include "cc/animation.h" 7 #include "cc/animation.h"
8 #include "cc/animation_registrar.h" 8 #include "cc/animation_registrar.h"
9 #include "cc/content_layer.h" 9 #include "cc/content_layer.h"
10 #include "cc/input_handler.h" 10 #include "cc/input_handler.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 bool MockLayerTreeHostImpl::PrepareToDraw(FrameData* frame) 87 bool MockLayerTreeHostImpl::PrepareToDraw(FrameData* frame)
88 { 88 {
89 bool result = LayerTreeHostImpl::PrepareToDraw(frame); 89 bool result = LayerTreeHostImpl::PrepareToDraw(frame);
90 if (!m_testHooks->prepareToDrawOnThread(this, frame, result)) 90 if (!m_testHooks->prepareToDrawOnThread(this, frame, result))
91 result = false; 91 result = false;
92 return result; 92 return result;
93 } 93 }
94 94
95 void MockLayerTreeHostImpl::DrawLayers(FrameData* frame) 95 void MockLayerTreeHostImpl::DrawLayers(FrameData* frame, base::TimeTicks frameBe ginTime)
96 { 96 {
97 LayerTreeHostImpl::DrawLayers(frame); 97 LayerTreeHostImpl::DrawLayers(frame, frameBeginTime);
98 m_testHooks->drawLayersOnThread(this); 98 m_testHooks->drawLayersOnThread(this);
99 } 99 }
100 100
101 bool MockLayerTreeHostImpl::SwapBuffers() 101 bool MockLayerTreeHostImpl::SwapBuffers()
102 { 102 {
103 bool result = LayerTreeHostImpl::SwapBuffers(); 103 bool result = LayerTreeHostImpl::SwapBuffers();
104 m_testHooks->swapBuffersOnThread(this, result); 104 m_testHooks->swapBuffersOnThread(this, result);
105 return result; 105 return result;
106 } 106 }
107 107
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 return; 487 return;
488 488
489 // If the LTH is not visible, defer the composite until the LTH is made 489 // If the LTH is not visible, defer the composite until the LTH is made
490 // visible. 490 // visible.
491 if (!m_layerTreeHost->visible()) { 491 if (!m_layerTreeHost->visible()) {
492 m_scheduleWhenSetVisibleTrue = true; 492 m_scheduleWhenSetVisibleTrue = true;
493 return; 493 return;
494 } 494 }
495 495
496 m_scheduleWhenSetVisibleTrue = false; 496 m_scheduleWhenSetVisibleTrue = false;
497 m_layerTreeHost->Composite(); 497 m_layerTreeHost->Composite(base::TimeTicks::Now());
498 } 498 }
499 499
500 void ThreadedTest::runTest(bool threaded) 500 void ThreadedTest::runTest(bool threaded)
501 { 501 {
502 if (threaded) { 502 if (threaded) {
503 m_implThread.reset(new base::Thread("ThreadedTest")); 503 m_implThread.reset(new base::Thread("ThreadedTest"));
504 ASSERT_TRUE(m_implThread->Start()); 504 ASSERT_TRUE(m_implThread->Start());
505 } 505 }
506 506
507 m_mainCCThread = cc::ThreadImpl::createForCurrentThread(); 507 m_mainCCThread = cc::ThreadImpl::createForCurrentThread();
(...skipping 13 matching lines...) Expand all
521 ASSERT_FALSE(m_layerTreeHost.get()); 521 ASSERT_FALSE(m_layerTreeHost.get());
522 m_client.reset(); 522 m_client.reset();
523 if (m_timedOut) { 523 if (m_timedOut) {
524 FAIL() << "Test timed out"; 524 FAIL() << "Test timed out";
525 return; 525 return;
526 } 526 }
527 afterTest(); 527 afterTest();
528 } 528 }
529 529
530 } // namespace cc 530 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test_common.h ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698