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

Unified Diff: cc/single_thread_proxy.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/single_thread_proxy.h ('k') | cc/test/layer_tree_test_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index 88f27265d706f12bbd6fedce334d487ff898a13f..49ccf55ec476b90645876356ded403ae0b3c15f0 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -55,7 +55,7 @@ bool SingleThreadProxy::CompositeAndReadback(void* pixels, gfx::Rect rect) {
TRACE_EVENT0("cc", "SingleThreadProxy::compositeAndReadback");
DCHECK(Proxy::IsMainThread());
- if (!CommitAndComposite())
+ if (!CommitAndComposite(base::TimeTicks::Now()))
return false;
{
@@ -337,8 +337,8 @@ void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() {
// Called by the legacy scheduling path (e.g. where render_widget does the
// scheduling)
-void SingleThreadProxy::CompositeImmediately() {
- if (CommitAndComposite()) {
+void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
+ if (CommitAndComposite(frame_begin_time)) {
layer_tree_host_impl_->SwapBuffers();
DidSwapFrame();
}
@@ -368,7 +368,7 @@ void SingleThreadProxy::ForceSerializeOnSwapBuffers() {
void SingleThreadProxy::OnSwapBuffersCompleteOnImplThread() { NOTREACHED(); }
-bool SingleThreadProxy::CommitAndComposite() {
+bool SingleThreadProxy::CommitAndComposite(base::TimeTicks frame_begin_time) {
DCHECK(Proxy::IsMainThread());
if (!layer_tree_host_->InitializeRendererIfNeeded())
@@ -394,13 +394,14 @@ bool SingleThreadProxy::CommitAndComposite() {
layer_tree_host_->WillCommit();
DoCommit(queue.Pass());
- bool result = DoComposite(offscreen_context_provider);
+ bool result = DoComposite(offscreen_context_provider, frame_begin_time);
layer_tree_host_->DidBeginFrame();
return result;
}
bool SingleThreadProxy::DoComposite(
- scoped_refptr<cc::ContextProvider> offscreen_context_provider) {
+ scoped_refptr<cc::ContextProvider> offscreen_context_provider,
+ base::TimeTicks frame_begin_time) {
DCHECK(!output_surface_lost_);
{
DebugScopedSetImplThread impl(this);
@@ -423,7 +424,7 @@ bool SingleThreadProxy::DoComposite(
LayerTreeHostImpl::FrameData frame;
layer_tree_host_impl_->PrepareToDraw(&frame);
- layer_tree_host_impl_->DrawLayers(&frame);
+ layer_tree_host_impl_->DrawLayers(&frame, frame_begin_time);
layer_tree_host_impl_->DidDrawAllLayers(frame);
output_surface_lost_ = layer_tree_host_impl_->IsContextLost();
« no previous file with comments | « cc/single_thread_proxy.h ('k') | cc/test/layer_tree_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698