| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/test/fake_output_surface.h" | 5 #include "cc/test/fake_output_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "cc/output/compositor_frame_ack.h" | 9 #include "cc/output/compositor_frame_ack.h" |
| 10 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 std::unique_ptr<SoftwareOutputDevice> software_device, | 37 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 38 bool delegated_rendering) | 38 bool delegated_rendering) |
| 39 : OutputSurface(std::move(context_provider), | 39 : OutputSurface(std::move(context_provider), |
| 40 std::move(worker_context_provider), | 40 std::move(worker_context_provider), |
| 41 std::move(software_device)) { | 41 std::move(software_device)) { |
| 42 capabilities_.delegated_rendering = delegated_rendering; | 42 capabilities_.delegated_rendering = delegated_rendering; |
| 43 } | 43 } |
| 44 | 44 |
| 45 FakeOutputSurface::~FakeOutputSurface() {} | 45 FakeOutputSurface::~FakeOutputSurface() {} |
| 46 | 46 |
| 47 void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) { | 47 void FakeOutputSurface::SwapBuffers(CompositorFrame frame) { |
| 48 if (frame->delegated_frame_data || !context_provider()) { | 48 if (frame.delegated_frame_data || !context_provider()) { |
| 49 frame->AssignTo(&last_sent_frame_); | 49 last_sent_frame_ = std::move(frame); |
| 50 | 50 |
| 51 if (last_sent_frame_.delegated_frame_data) { | 51 if (last_sent_frame_.delegated_frame_data) { |
| 52 resources_held_by_parent_.insert( | 52 resources_held_by_parent_.insert( |
| 53 resources_held_by_parent_.end(), | 53 resources_held_by_parent_.end(), |
| 54 last_sent_frame_.delegated_frame_data->resource_list.begin(), | 54 last_sent_frame_.delegated_frame_data->resource_list.begin(), |
| 55 last_sent_frame_.delegated_frame_data->resource_list.end()); | 55 last_sent_frame_.delegated_frame_data->resource_list.end()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 ++num_sent_frames_; | 58 ++num_sent_frames_; |
| 59 } else { | 59 } else { |
| 60 last_swap_rect_ = frame->gl_frame_data->sub_buffer_rect; | 60 last_swap_rect_ = frame.gl_frame_data->sub_buffer_rect; |
| 61 frame->AssignTo(&last_sent_frame_); | 61 last_sent_frame_ = std::move(frame); |
| 62 ++num_sent_frames_; | 62 ++num_sent_frames_; |
| 63 } | 63 } |
| 64 PostSwapBuffersComplete(); | 64 PostSwapBuffersComplete(); |
| 65 client_->DidSwapBuffers(); | 65 client_->DidSwapBuffers(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void FakeOutputSurface::BindFramebuffer() { | 68 void FakeOutputSurface::BindFramebuffer() { |
| 69 if (framebuffer_) { | 69 if (framebuffer_) { |
| 70 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, | 70 context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, |
| 71 framebuffer_); | 71 framebuffer_); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 const { | 125 const { |
| 126 return overlay_candidate_validator_; | 126 return overlay_candidate_validator_; |
| 127 } | 127 } |
| 128 | 128 |
| 129 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( | 129 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( |
| 130 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { | 130 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { |
| 131 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); | 131 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace cc | 134 } // namespace cc |
| OLD | NEW |