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

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

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 287efe04 Rebase, oshima@ nits. Created 6 years, 10 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/output_surface.h ('k') | cc/output/output_surface_unittest.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "cc/output/output_surface.h" 5 #include "cc/output/output_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 for (int i = 0; i < pending_swap_buffers_; i++) 110 for (int i = 0; i < pending_swap_buffers_; i++)
111 frame_rate_controller_->DidSwapBuffers(); 111 frame_rate_controller_->DidSwapBuffers();
112 } 112 }
113 113
114 void OutputSurface::SetMaxFramesPending(int max_frames_pending) { 114 void OutputSurface::SetMaxFramesPending(int max_frames_pending) {
115 if (frame_rate_controller_) 115 if (frame_rate_controller_)
116 frame_rate_controller_->SetMaxSwapsPending(max_frames_pending); 116 frame_rate_controller_->SetMaxSwapsPending(max_frames_pending);
117 max_frames_pending_ = max_frames_pending; 117 max_frames_pending_ = max_frames_pending;
118 } 118 }
119 119
120 void OutputSurface::OnVSyncParametersChanged(base::TimeTicks timebase, 120 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase,
121 base::TimeDelta interval) { 121 base::TimeDelta interval) {
122 TRACE_EVENT2("cc", "OutputSurface::OnVSyncParametersChanged", 122 TRACE_EVENT2("cc",
123 "timebase", (timebase - base::TimeTicks()).InSecondsF(), 123 "OutputSurface::CommitVSyncParameters",
124 "interval", interval.InSecondsF()); 124 "timebase",
125 (timebase - base::TimeTicks()).InSecondsF(),
126 "interval",
127 interval.InSecondsF());
125 if (frame_rate_controller_) 128 if (frame_rate_controller_)
126 frame_rate_controller_->SetTimebaseAndInterval(timebase, interval); 129 frame_rate_controller_->SetTimebaseAndInterval(timebase, interval);
127 } 130 }
128 131
129 void OutputSurface::FrameRateControllerTick(bool throttled, 132 void OutputSurface::FrameRateControllerTick(bool throttled,
130 const BeginFrameArgs& args) { 133 const BeginFrameArgs& args) {
131 DCHECK(frame_rate_controller_); 134 DCHECK(frame_rate_controller_);
132 if (throttled) 135 if (throttled)
133 skipped_begin_impl_frame_args_ = args; 136 skipped_begin_impl_frame_args_ = args;
134 else 137 else
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", 486 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy",
484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); 487 "bytes_limit_when_visible", policy.bytes_limit_when_visible);
485 // Just ignore the memory manager when it says to set the limit to zero 488 // Just ignore the memory manager when it says to set the limit to zero
486 // bytes. This will happen when the memory manager thinks that the renderer 489 // bytes. This will happen when the memory manager thinks that the renderer
487 // is not visible (which the renderer knows better). 490 // is not visible (which the renderer knows better).
488 if (policy.bytes_limit_when_visible) 491 if (policy.bytes_limit_when_visible)
489 client_->SetMemoryPolicy(policy); 492 client_->SetMemoryPolicy(policy);
490 } 493 }
491 494
492 } // namespace cc 495 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/output/output_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698