OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |