| 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 26 matching lines...) Expand all Loading... |
| 37 if (!draw_callback_.is_null()) | 37 if (!draw_callback_.is_null()) |
| 38 draw_callback_.Run(SurfaceDrawStatus::DRAW_SKIPPED); | 38 draw_callback_.Run(SurfaceDrawStatus::DRAW_SKIPPED); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void Surface::SetPreviousFrameSurface(Surface* surface) { | 41 void Surface::SetPreviousFrameSurface(Surface* surface) { |
| 42 DCHECK(surface); | 42 DCHECK(surface); |
| 43 frame_index_ = surface->frame_index() + 1; | 43 frame_index_ = surface->frame_index() + 1; |
| 44 previous_frame_surface_id_ = surface->surface_id(); | 44 previous_frame_surface_id_ = surface->surface_id(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void Surface::SetGpuMemoryBufferClientId(int gpu_memory_buffer_client_id) { | |
| 48 // This should only be set once. | |
| 49 DCHECK_EQ(-1, gpu_memory_buffer_client_id_); | |
| 50 DCHECK_NE(gpu_memory_buffer_client_id, gpu_memory_buffer_client_id_); | |
| 51 gpu_memory_buffer_client_id_ = gpu_memory_buffer_client_id; | |
| 52 } | |
| 53 | |
| 54 void Surface::QueueFrame(CompositorFrame frame, const DrawCallback& callback) { | 47 void Surface::QueueFrame(CompositorFrame frame, const DrawCallback& callback) { |
| 55 DCHECK(factory_); | 48 DCHECK(factory_); |
| 56 ClearCopyRequests(); | 49 ClearCopyRequests(); |
| 57 | 50 |
| 58 if (frame.delegated_frame_data) { | 51 if (frame.delegated_frame_data) { |
| 59 TakeLatencyInfo(&frame.metadata.latency_info); | 52 TakeLatencyInfo(&frame.metadata.latency_info); |
| 60 } | 53 } |
| 61 | 54 |
| 62 CompositorFrame previous_frame = std::move(current_frame_); | 55 CompositorFrame previous_frame = std::move(current_frame_); |
| 63 current_frame_ = std::move(frame); | 56 current_frame_ = std::move(frame); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (current_frame_.delegated_frame_data) { | 189 if (current_frame_.delegated_frame_data) { |
| 197 for (const auto& render_pass : | 190 for (const auto& render_pass : |
| 198 current_frame_.delegated_frame_data->render_pass_list) { | 191 current_frame_.delegated_frame_data->render_pass_list) { |
| 199 for (const auto& copy_request : render_pass->copy_requests) | 192 for (const auto& copy_request : render_pass->copy_requests) |
| 200 copy_request->SendEmptyResult(); | 193 copy_request->SendEmptyResult(); |
| 201 } | 194 } |
| 202 } | 195 } |
| 203 } | 196 } |
| 204 | 197 |
| 205 } // namespace cc | 198 } // namespace cc |
| OLD | NEW |