Chromium Code Reviews| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 | 43 |
| 44 for (auto& observer : observers_) | 44 for (auto& observer : observers_) |
| 45 observer.OnSurfaceDiscarded(this); | 45 observer.OnSurfaceDiscarded(this); |
| 46 observers_.Clear(); | 46 observers_.Clear(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void Surface::SetPreviousFrameSurface(Surface* surface) { | 49 void Surface::SetPreviousFrameSurface(Surface* surface) { |
| 50 DCHECK(surface); | 50 DCHECK(surface); |
| 51 frame_index_ = surface->frame_index() + 1; | 51 frame_index_ = surface->frame_index() + 1; |
| 52 previous_frame_surface_id_ = surface->surface_id(); | 52 previous_frame_surface_id_ = surface->surface_id(); |
| 53 if (!surface->HasActiveFrame()) | |
| 54 return; | |
| 55 active_frame_->metadata.latency_info.insert( | |
|
jbauman
2017/02/28 23:11:09
Also check whether active_frame_ exists for the ne
Fady Samuel
2017/03/01 04:30:56
I actually think that we might want to place the L
Saman Sami
2017/03/01 16:35:20
A frame was just submitted, so either pending or a
| |
| 56 active_frame_->metadata.latency_info.end(), | |
| 57 surface->active_frame_->metadata.latency_info.begin(), | |
| 58 surface->active_frame_->metadata.latency_info.end()); | |
| 59 surface->active_frame_->metadata.latency_info.clear(); | |
| 53 } | 60 } |
| 54 | 61 |
| 55 void Surface::QueueFrame(CompositorFrame frame, const DrawCallback& callback) { | 62 void Surface::QueueFrame(CompositorFrame frame, const DrawCallback& callback) { |
| 56 base::Optional<CompositorFrame> previous_pending_frame = | 63 base::Optional<CompositorFrame> previous_pending_frame = |
| 57 std::move(pending_frame_); | 64 std::move(pending_frame_); |
| 58 pending_frame_.reset(); | 65 pending_frame_.reset(); |
| 59 | 66 |
| 60 UpdateBlockingSurfaces(previous_pending_frame, frame); | 67 UpdateBlockingSurfaces(previous_pending_frame, frame); |
| 61 | 68 |
| 62 // Receive and track the resources referenced from the CompositorFrame | 69 // Receive and track the resources referenced from the CompositorFrame |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 void Surface::ClearCopyRequests() { | 321 void Surface::ClearCopyRequests() { |
| 315 if (active_frame_) { | 322 if (active_frame_) { |
| 316 for (const auto& render_pass : active_frame_->render_pass_list) { | 323 for (const auto& render_pass : active_frame_->render_pass_list) { |
| 317 for (const auto& copy_request : render_pass->copy_requests) | 324 for (const auto& copy_request : render_pass->copy_requests) |
| 318 copy_request->SendEmptyResult(); | 325 copy_request->SendEmptyResult(); |
| 319 } | 326 } |
| 320 } | 327 } |
| 321 } | 328 } |
| 322 | 329 |
| 323 } // namespace cc | 330 } // namespace cc |
| OLD | NEW |