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/display.h" | 5 #include "cc/surfaces/display.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 bool should_swap = should_draw && size_matches; | 300 bool should_swap = should_draw && size_matches; |
301 if (should_swap) { | 301 if (should_swap) { |
302 swapped_since_resize_ = true; | 302 swapped_since_resize_ = true; |
303 for (auto& latency : frame->metadata.latency_info) { | 303 for (auto& latency : frame->metadata.latency_info) { |
304 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", | 304 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", |
305 TRACE_ID_DONT_MANGLE(latency.trace_id()), | 305 TRACE_ID_DONT_MANGLE(latency.trace_id()), |
306 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 306 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
307 "step", "Display::DrawAndSwap"); | 307 "step", "Display::DrawAndSwap"); |
308 } | 308 } |
309 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); | 309 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); |
310 renderer_->SwapBuffers(frame->metadata); | 310 renderer_->SwapBuffers(std::move(frame->metadata)); |
311 } else { | 311 } else { |
312 if (have_damage && !size_matches) | 312 if (have_damage && !size_matches) |
313 aggregator_->SetFullDamageForSurface(current_surface_id_); | 313 aggregator_->SetFullDamageForSurface(current_surface_id_); |
314 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD); | 314 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD); |
315 stored_latency_info_.insert(stored_latency_info_.end(), | 315 stored_latency_info_.insert(stored_latency_info_.end(), |
316 frame->metadata.latency_info.begin(), | 316 frame->metadata.latency_info.begin(), |
317 frame->metadata.latency_info.end()); | 317 frame->metadata.latency_info.end()); |
318 DidSwapBuffers(); | 318 DidSwapBuffers(); |
319 DidSwapBuffersComplete(); | 319 DidSwapBuffersComplete(); |
320 } | 320 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 410 |
411 if (surface_id == current_surface_id_) | 411 if (surface_id == current_surface_id_) |
412 UpdateRootSurfaceResourcesLocked(); | 412 UpdateRootSurfaceResourcesLocked(); |
413 } | 413 } |
414 | 414 |
415 SurfaceId Display::CurrentSurfaceId() { | 415 SurfaceId Display::CurrentSurfaceId() { |
416 return current_surface_id_; | 416 return current_surface_id_; |
417 } | 417 } |
418 | 418 |
419 } // namespace cc | 419 } // namespace cc |
OLD | NEW |