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