| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 BeginFrameAck ack = frame.metadata.begin_frame_ack; | 119 BeginFrameAck ack = frame.metadata.begin_frame_ack; |
| 120 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number); | 120 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number); |
| 121 | 121 |
| 122 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info, | 122 if (!ui::LatencyInfo::Verify(frame.metadata.latency_info, |
| 123 "RenderWidgetHostImpl::OnSwapCompositorFrame")) { | 123 "RenderWidgetHostImpl::OnSwapCompositorFrame")) { |
| 124 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info); | 124 std::vector<ui::LatencyInfo>().swap(frame.metadata.latency_info); |
| 125 } | 125 } |
| 126 for (ui::LatencyInfo& latency : frame.metadata.latency_info) { | 126 for (ui::LatencyInfo& latency : frame.metadata.latency_info) { |
| 127 if (latency.latency_components().size() > 0) { | 127 if (latency.latency_components().size() > 0) { |
| 128 latency.AddLatencyNumber(ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, | 128 latency.AddLatencyNumber(ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, |
| 129 0, 0); | 129 0); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 Surface* prev_surface = | 133 Surface* prev_surface = |
| 134 surface_manager_->GetSurfaceForId(current_surface_id_); | 134 surface_manager_->GetSurfaceForId(current_surface_id_); |
| 135 Surface* current_surface = nullptr; | 135 Surface* current_surface = nullptr; |
| 136 if (prev_surface && | 136 if (prev_surface && |
| 137 local_surface_id == current_surface_id_.local_surface_id()) { | 137 local_surface_id == current_surface_id_.local_surface_id()) { |
| 138 current_surface = prev_surface; | 138 current_surface = prev_surface; |
| 139 } else { | 139 } else { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 ack.has_damage = true; | 362 ack.has_damage = true; |
| 363 if (current_surface->HasActiveFrame()) | 363 if (current_surface->HasActiveFrame()) |
| 364 surface_manager_->SurfaceModified(current_surface->surface_id(), ack); | 364 surface_manager_->SurfaceModified(current_surface->surface_id(), ack); |
| 365 } | 365 } |
| 366 | 366 |
| 367 Surface* CompositorFrameSinkSupport::GetCurrentSurfaceForTesting() { | 367 Surface* CompositorFrameSinkSupport::GetCurrentSurfaceForTesting() { |
| 368 return surface_manager_->GetSurfaceForId(current_surface_id_); | 368 return surface_manager_->GetSurfaceForId(current_surface_id_); |
| 369 } | 369 } |
| 370 | 370 |
| 371 } // namespace cc | 371 } // namespace cc |
| OLD | NEW |