| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 BeginFrameAck ack = frame.metadata.begin_frame_ack; | 116 BeginFrameAck ack = frame.metadata.begin_frame_ack; |
| 117 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number); | 117 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number); |
| 118 | 118 |
| 119 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info, | 119 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info, |
| 120 "RenderWidgetHostImpl::OnSwapCompositorFrame")) { | 120 "RenderWidgetHostImpl::OnSwapCompositorFrame")) { |
| 121 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info); | 121 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info); |
| 122 } | 122 } |
| 123 for (ui::LatencyInfo& latency : frame.metadata.latency_info) { | 123 for (ui::LatencyInfo& latency : frame.metadata.latency_info) { |
| 124 if (latency.latency_components().size() > 0) { | 124 if (latency.latency_components().size() > 0) { |
| 125 latency.AddLatencyNumber(ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, | 125 latency.AddLatencyNumber(ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, |
| 126 0, 0); | 126 0); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 std::unique_ptr<Surface> surface; | 130 std::unique_ptr<Surface> surface; |
| 131 bool create_new_surface = | 131 bool create_new_surface = |
| 132 (!current_surface_ || | 132 (!current_surface_ || |
| 133 local_surface_id != current_surface_->surface_id().local_surface_id()); | 133 local_surface_id != current_surface_->surface_id().local_surface_id()); |
| 134 if (!create_new_surface) { | 134 if (!create_new_surface) { |
| 135 surface = std::move(current_surface_); | 135 surface = std::move(current_surface_); |
| 136 } else { | 136 } else { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 DCHECK(current_surface_->compositor_frame_sink_support().get() == this); | 362 DCHECK(current_surface_->compositor_frame_sink_support().get() == this); |
| 363 current_surface_->RequestCopyOfOutput(std::move(copy_request)); | 363 current_surface_->RequestCopyOfOutput(std::move(copy_request)); |
| 364 BeginFrameAck ack; | 364 BeginFrameAck ack; |
| 365 ack.has_damage = true; | 365 ack.has_damage = true; |
| 366 if (current_surface_->HasActiveFrame()) | 366 if (current_surface_->HasActiveFrame()) |
| 367 surface_manager_->SurfaceModified(current_surface_->surface_id(), ack); | 367 surface_manager_->SurfaceModified(current_surface_->surface_id(), ack); |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace cc | 370 } // namespace cc |
| OLD | NEW |