| 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/surface.h" | 5 #include "cc/surfaces/surface.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // completely damaged the first time they're drawn from. | 22 // completely damaged the first time they're drawn from. |
| 23 static const int kFrameIndexStart = 2; | 23 static const int kFrameIndexStart = 2; |
| 24 | 24 |
| 25 Surface::Surface( | 25 Surface::Surface( |
| 26 const SurfaceInfo& surface_info, | 26 const SurfaceInfo& surface_info, |
| 27 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support) | 27 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support) |
| 28 : surface_info_(surface_info), | 28 : surface_info_(surface_info), |
| 29 previous_frame_surface_id_(surface_info.id()), | 29 previous_frame_surface_id_(surface_info.id()), |
| 30 compositor_frame_sink_support_(std::move(compositor_frame_sink_support)), | 30 compositor_frame_sink_support_(std::move(compositor_frame_sink_support)), |
| 31 surface_manager_(compositor_frame_sink_support_->surface_manager()), | 31 surface_manager_(compositor_frame_sink_support_->surface_manager()), |
| 32 frame_index_(kFrameIndexStart), | 32 frame_index_(kFrameIndexStart) {} |
| 33 destroyed_(false) {} | |
| 34 | 33 |
| 35 Surface::~Surface() { | 34 Surface::~Surface() { |
| 36 ClearCopyRequests(); | 35 ClearCopyRequests(); |
| 37 surface_manager_->SurfaceDiscarded(this); | 36 surface_manager_->SurfaceDiscarded(this); |
| 38 | 37 |
| 39 UnrefFrameResourcesAndRunDrawCallback(std::move(pending_frame_data_)); | 38 UnrefFrameResourcesAndRunDrawCallback(std::move(pending_frame_data_)); |
| 40 UnrefFrameResourcesAndRunDrawCallback(std::move(active_frame_data_)); | 39 UnrefFrameResourcesAndRunDrawCallback(std::move(active_frame_data_)); |
| 41 } | 40 } |
| 42 | 41 |
| 43 void Surface::SetPreviousFrameSurface(Surface* surface) { | 42 void Surface::SetPreviousFrameSurface(Surface* surface) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 frame->metadata.latency_info.swap(*latency_info); | 369 frame->metadata.latency_info.swap(*latency_info); |
| 371 return; | 370 return; |
| 372 } | 371 } |
| 373 std::copy(frame->metadata.latency_info.begin(), | 372 std::copy(frame->metadata.latency_info.begin(), |
| 374 frame->metadata.latency_info.end(), | 373 frame->metadata.latency_info.end(), |
| 375 std::back_inserter(*latency_info)); | 374 std::back_inserter(*latency_info)); |
| 376 frame->metadata.latency_info.clear(); | 375 frame->metadata.latency_info.clear(); |
| 377 } | 376 } |
| 378 | 377 |
| 379 } // namespace cc | 378 } // namespace cc |
| OLD | NEW |