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

Side by Side Diff: cc/output/begin_frame_args.cc

Issue 311263016: cc: Fix negative EstimatedParentDrawTimes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/output/begin_frame_args.h ('k') | cc/trees/layer_tree_host_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/json/json_writer.h" 5 #include "base/json/json_writer.h"
6 #include "cc/output/begin_frame_args.h" 6 #include "cc/output/begin_frame_args.h"
7 #include "ui/gfx/frame_time.h" 7 #include "ui/gfx/frame_time.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 now = gfx::FrameTime::Now(); 45 now = gfx::FrameTime::Now();
46 return BeginFrameArgs(now, base::TimeTicks(), DefaultInterval()); 46 return BeginFrameArgs(now, base::TimeTicks(), DefaultInterval());
47 } 47 }
48 48
49 // This is a hard-coded deadline adjustment that assumes 60Hz, to be used in 49 // This is a hard-coded deadline adjustment that assumes 60Hz, to be used in
50 // cases where a good estimated draw time is not known. Using 1/3 of the vsync 50 // cases where a good estimated draw time is not known. Using 1/3 of the vsync
51 // as the default adjustment gives the Browser the last 1/3 of a frame to 51 // as the default adjustment gives the Browser the last 1/3 of a frame to
52 // produce output, the Renderer Impl thread the middle 1/3 of a frame to produce 52 // produce output, the Renderer Impl thread the middle 1/3 of a frame to produce
53 // ouput, and the Renderer Main thread the first 1/3 of a frame to produce 53 // ouput, and the Renderer Main thread the first 1/3 of a frame to produce
54 // output. 54 // output.
55 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { 55 base::TimeDelta BeginFrameArgs::DefaultEstimatedParentDrawTime() {
danakj 2014/06/06 22:45:45 +1 to the new name
56 return base::TimeDelta::FromMicroseconds(-16666 / 3); 56 return base::TimeDelta::FromMicroseconds(16666 / 3);
57 } 57 }
58 58
59 base::TimeDelta BeginFrameArgs::DefaultInterval() { 59 base::TimeDelta BeginFrameArgs::DefaultInterval() {
60 return base::TimeDelta::FromMicroseconds(16666); 60 return base::TimeDelta::FromMicroseconds(16666);
61 } 61 }
62 62
63 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { 63 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() {
64 return base::TimeDelta::FromMicroseconds(4444); 64 return base::TimeDelta::FromMicroseconds(4444);
65 } 65 }
66 66
67 } // namespace cc 67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698