| 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" |
| 11 #include "cc/resources/returned_resource.h" | 11 #include "cc/resources/returned_resource.h" |
| 12 #include "cc/test/begin_frame_args_test.h" | 12 #include "cc/test/begin_frame_args_test.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 FakeOutputSurface::FakeOutputSurface( | 17 FakeOutputSurface::FakeOutputSurface( |
| 18 scoped_refptr<ContextProvider> context_provider, | 18 scoped_refptr<ContextProvider> context_provider, |
| 19 scoped_refptr<ContextProvider> worker_context_provider, | 19 scoped_refptr<ContextProvider> worker_context_provider, |
| 20 bool delegated_rendering) | 20 bool delegated_rendering) |
| 21 : FakeOutputSurface(std::move(context_provider), | 21 : OutputSurface(context_provider, worker_context_provider), |
| 22 std::move(worker_context_provider), | 22 client_(NULL), |
| 23 nullptr, | 23 num_sent_frames_(0), |
| 24 delegated_rendering) {} | 24 has_external_stencil_test_(false), |
| 25 suspended_for_recycle_(false), |
| 26 framebuffer_(0), |
| 27 overlay_candidate_validator_(nullptr) { |
| 28 capabilities_.delegated_rendering = delegated_rendering; |
| 29 } |
| 30 |
| 31 FakeOutputSurface::FakeOutputSurface( |
| 32 scoped_refptr<ContextProvider> context_provider, |
| 33 bool delegated_rendering) |
| 34 : OutputSurface(context_provider), |
| 35 client_(NULL), |
| 36 num_sent_frames_(0), |
| 37 has_external_stencil_test_(false), |
| 38 suspended_for_recycle_(false), |
| 39 framebuffer_(0), |
| 40 overlay_candidate_validator_(nullptr) { |
| 41 capabilities_.delegated_rendering = delegated_rendering; |
| 42 } |
| 25 | 43 |
| 26 FakeOutputSurface::FakeOutputSurface( | 44 FakeOutputSurface::FakeOutputSurface( |
| 27 std::unique_ptr<SoftwareOutputDevice> software_device, | 45 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 28 bool delegated_rendering) | 46 bool delegated_rendering) |
| 29 : FakeOutputSurface(nullptr, | 47 : OutputSurface(std::move(software_device)), |
| 30 nullptr, | 48 client_(NULL), |
| 31 std::move(software_device), | 49 num_sent_frames_(0), |
| 32 delegated_rendering) {} | 50 has_external_stencil_test_(false), |
| 51 suspended_for_recycle_(false), |
| 52 framebuffer_(0), |
| 53 overlay_candidate_validator_(nullptr) { |
| 54 capabilities_.delegated_rendering = delegated_rendering; |
| 55 } |
| 33 | 56 |
| 34 FakeOutputSurface::FakeOutputSurface( | 57 FakeOutputSurface::FakeOutputSurface( |
| 35 scoped_refptr<ContextProvider> context_provider, | 58 scoped_refptr<ContextProvider> context_provider, |
| 36 scoped_refptr<ContextProvider> worker_context_provider, | |
| 37 std::unique_ptr<SoftwareOutputDevice> software_device, | 59 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 38 bool delegated_rendering) | 60 bool delegated_rendering) |
| 39 : OutputSurface(std::move(context_provider), | 61 : OutputSurface(context_provider, std::move(software_device)), |
| 40 std::move(worker_context_provider), | |
| 41 std::move(software_device)), | |
| 42 client_(NULL), | 62 client_(NULL), |
| 43 num_sent_frames_(0), | 63 num_sent_frames_(0), |
| 44 has_external_stencil_test_(false), | 64 has_external_stencil_test_(false), |
| 45 suspended_for_recycle_(false), | 65 suspended_for_recycle_(false), |
| 46 framebuffer_(0), | 66 framebuffer_(0), |
| 47 overlay_candidate_validator_(nullptr) { | 67 overlay_candidate_validator_(nullptr) { |
| 48 capabilities_.delegated_rendering = delegated_rendering; | 68 capabilities_.delegated_rendering = delegated_rendering; |
| 49 } | 69 } |
| 50 | 70 |
| 51 FakeOutputSurface::~FakeOutputSurface() {} | 71 FakeOutputSurface::~FakeOutputSurface() {} |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const { | 143 const { |
| 124 return overlay_candidate_validator_; | 144 return overlay_candidate_validator_; |
| 125 } | 145 } |
| 126 | 146 |
| 127 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( | 147 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( |
| 128 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { | 148 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { |
| 129 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); | 149 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); |
| 130 } | 150 } |
| 131 | 151 |
| 132 } // namespace cc | 152 } // namespace cc |
| OLD | NEW |