| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/compositor_frame_sink_support.h" | 5 #include "cc/surfaces/compositor_frame_sink_support.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/scheduler/begin_frame_source.h" | 8 #include "cc/scheduler/begin_frame_source.h" |
| 9 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 9 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| 10 #include "cc/surfaces/display.h" | 10 #include "cc/surfaces/display.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 void CompositorFrameSinkSupport::SubmitCompositorFrame( | 61 void CompositorFrameSinkSupport::SubmitCompositorFrame( |
| 62 const LocalSurfaceId& local_surface_id, | 62 const LocalSurfaceId& local_surface_id, |
| 63 CompositorFrame frame) { | 63 CompositorFrame frame) { |
| 64 ++ack_pending_count_; | 64 ++ack_pending_count_; |
| 65 surface_factory_.SubmitCompositorFrame( | 65 surface_factory_.SubmitCompositorFrame( |
| 66 local_surface_id, std::move(frame), | 66 local_surface_id, std::move(frame), |
| 67 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, | 67 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, |
| 68 weak_factory_.GetWeakPtr())); | 68 weak_factory_.GetWeakPtr())); |
| 69 if (display_) { | 69 if (display_) { |
| 70 display_->SetLocalSurfaceId(local_surface_id, | 70 display_->SetLocalSurfaceId(local_surface_id); |
| 71 frame.metadata.device_scale_factor); | 71 display_->SetDeviceScaleFactor(frame.metadata.device_scale_factor); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 void CompositorFrameSinkSupport::Require(const LocalSurfaceId& local_surface_id, | 75 void CompositorFrameSinkSupport::Require(const LocalSurfaceId& local_surface_id, |
| 76 const SurfaceSequence& sequence) { | 76 const SurfaceSequence& sequence) { |
| 77 surface_manager_->RequireSequence(SurfaceId(frame_sink_id_, local_surface_id), | 77 surface_manager_->RequireSequence(SurfaceId(frame_sink_id_, local_surface_id), |
| 78 sequence); | 78 sequence); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void CompositorFrameSinkSupport::Satisfy(const SurfaceSequence& sequence) { | 81 void CompositorFrameSinkSupport::Satisfy(const SurfaceSequence& sequence) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return; | 173 return; |
| 174 | 174 |
| 175 added_frame_observer_ = needs_begin_frame_; | 175 added_frame_observer_ = needs_begin_frame_; |
| 176 if (needs_begin_frame_) | 176 if (needs_begin_frame_) |
| 177 begin_frame_source_->AddObserver(this); | 177 begin_frame_source_->AddObserver(this); |
| 178 else | 178 else |
| 179 begin_frame_source_->RemoveObserver(this); | 179 begin_frame_source_->RemoveObserver(this); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace cc | 182 } // namespace cc |
| OLD | NEW |