| 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::CommitVSyncParameters(base::TimeTicks timebase, | 120 void OutputSurface::OnVSyncParametersChanged(base::TimeTicks timebase, |
| 121 base::TimeDelta interval) { | 121 base::TimeDelta interval) { |
| 122 TRACE_EVENT2("cc", | 122 TRACE_EVENT2("cc", "OutputSurface::OnVSyncParametersChanged", |
| 123 "OutputSurface::CommitVSyncParameters", | 123 "timebase", (timebase - base::TimeTicks()).InSecondsF(), |
| 124 "timebase", | 124 "interval", interval.InSecondsF()); |
| 125 (timebase - base::TimeTicks()).InSecondsF(), | |
| 126 "interval", | |
| 127 interval.InSecondsF()); | |
| 128 if (frame_rate_controller_) | 125 if (frame_rate_controller_) |
| 129 frame_rate_controller_->SetTimebaseAndInterval(timebase, interval); | 126 frame_rate_controller_->SetTimebaseAndInterval(timebase, interval); |
| 130 } | 127 } |
| 131 | 128 |
| 132 void OutputSurface::FrameRateControllerTick(bool throttled, | 129 void OutputSurface::FrameRateControllerTick(bool throttled, |
| 133 const BeginFrameArgs& args) { | 130 const BeginFrameArgs& args) { |
| 134 DCHECK(frame_rate_controller_); | 131 DCHECK(frame_rate_controller_); |
| 135 if (throttled) | 132 if (throttled) |
| 136 skipped_begin_impl_frame_args_ = args; | 133 skipped_begin_impl_frame_args_ = args; |
| 137 else | 134 else |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 487 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 488 // Just ignore the memory manager when it says to set the limit to zero | 485 // Just ignore the memory manager when it says to set the limit to zero |
| 489 // bytes. This will happen when the memory manager thinks that the renderer | 486 // bytes. This will happen when the memory manager thinks that the renderer |
| 490 // is not visible (which the renderer knows better). | 487 // is not visible (which the renderer knows better). |
| 491 if (policy.bytes_limit_when_visible) | 488 if (policy.bytes_limit_when_visible) |
| 492 client_->SetMemoryPolicy(policy); | 489 client_->SetMemoryPolicy(policy); |
| 493 } | 490 } |
| 494 | 491 |
| 495 } // namespace cc | 492 } // namespace cc |
| OLD | NEW |