| 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/direct_compositor_frame_sink.h" | 5 #include "cc/surfaces/direct_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
| 9 #include "cc/output/compositor_frame_sink_client.h" | 9 #include "cc/output/compositor_frame_sink_client.h" |
| 10 #include "cc/surfaces/display.h" | 10 #include "cc/surfaces/display.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 CompositorFrameSink::DetachFromClient(); | 93 CompositorFrameSink::DetachFromClient(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { | 96 void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { |
| 97 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); | 97 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); |
| 98 if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) { | 98 if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) { |
| 99 delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId(); | 99 delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId(); |
| 100 last_swap_frame_size_ = frame_size; | 100 last_swap_frame_size_ = frame_size; |
| 101 } | 101 } |
| 102 display_->SetLocalSurfaceId(delegated_local_surface_id_, | 102 display_->SetLocalSurfaceId(delegated_local_surface_id_); |
| 103 frame.metadata.device_scale_factor); | 103 display_->SetDeviceScaleFactor(frame.metadata.device_scale_factor); |
| 104 | 104 |
| 105 support_->SubmitCompositorFrame(delegated_local_surface_id_, | 105 support_->SubmitCompositorFrame(delegated_local_surface_id_, |
| 106 std::move(frame)); | 106 std::move(frame)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void DirectCompositorFrameSink::ForceReclaimResources() { | 109 void DirectCompositorFrameSink::ForceReclaimResources() { |
| 110 support_->ForceReclaimResources(); | 110 support_->ForceReclaimResources(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() { | 113 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) { | 149 void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) { |
| 150 support_->SetNeedsBeginFrame(needs_begin_frame); | 150 support_->SetNeedsBeginFrame(needs_begin_frame); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { | 153 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { |
| 154 // TODO(eseckler): Pass on the ack to support_ and its BeginFrameSource. | 154 // TODO(eseckler): Pass on the ack to support_ and its BeginFrameSource. |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace cc | 157 } // namespace cc |
| OLD | NEW |