OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/surfaces/onscreen_display_client.h" | 5 #include "cc/surfaces/onscreen_display_client.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "cc/output/output_surface.h" | 8 #include "cc/output/output_surface.h" |
9 #include "cc/scheduler/begin_frame_source.h" | 9 #include "cc/scheduler/begin_frame_source.h" |
10 #include "cc/surfaces/display_scheduler.h" | 10 #include "cc/surfaces/display_scheduler.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return display_->Initialize(std::move(output_surface_), scheduler_.get()); | 55 return display_->Initialize(std::move(output_surface_), scheduler_.get()); |
56 } | 56 } |
57 | 57 |
58 void OnscreenDisplayClient::CommitVSyncParameters(base::TimeTicks timebase, | 58 void OnscreenDisplayClient::CommitVSyncParameters(base::TimeTicks timebase, |
59 base::TimeDelta interval) { | 59 base::TimeDelta interval) { |
60 if (interval == base::TimeDelta()) { | 60 if (interval == base::TimeDelta()) { |
61 // TODO(brianderson): We should not be receiving 0 intervals. | 61 // TODO(brianderson): We should not be receiving 0 intervals. |
62 interval = BeginFrameArgs::DefaultInterval(); | 62 interval = BeginFrameArgs::DefaultInterval(); |
63 } | 63 } |
64 | 64 |
65 surface_display_output_surface_->ReceivedVSyncParameters(timebase, interval); | 65 if (synthetic_frame_source_) |
66 if (synthetic_frame_source_.get()) | |
67 synthetic_frame_source_->OnUpdateVSyncParameters(timebase, interval); | 66 synthetic_frame_source_->OnUpdateVSyncParameters(timebase, interval); |
68 } | 67 } |
69 | 68 |
70 void OnscreenDisplayClient::OutputSurfaceLost() { | 69 void OnscreenDisplayClient::OutputSurfaceLost() { |
71 output_surface_lost_ = true; | 70 output_surface_lost_ = true; |
72 surface_display_output_surface_->DidLoseOutputSurface(); | 71 surface_display_output_surface_->DidLoseOutputSurface(); |
73 } | 72 } |
74 | 73 |
75 void OnscreenDisplayClient::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 74 void OnscreenDisplayClient::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
76 surface_display_output_surface_->SetMemoryPolicy(policy); | 75 surface_display_output_surface_->SetMemoryPolicy(policy); |
77 } | 76 } |
78 | 77 |
| 78 BeginFrameSource* OnscreenDisplayClient::BeginFrameSourceForChildren() { |
| 79 if (unthrottled_frame_source_) |
| 80 return unthrottled_frame_source_.get(); |
| 81 DCHECK(synthetic_frame_source_); |
| 82 return synthetic_frame_source_.get(); |
| 83 } |
| 84 |
79 } // namespace cc | 85 } // namespace cc |
OLD | NEW |