| 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 std::unique_ptr<ContextProvider::DeferredCreate> context_provider_create, |
| 19 scoped_refptr<ContextProvider> worker_context_provider, | 19 scoped_refptr<ContextProvider> worker_context_provider, |
| 20 bool delegated_rendering) | 20 bool delegated_rendering) |
| 21 : OutputSurface(context_provider, worker_context_provider), | 21 : OutputSurface(std::move(context_provider_create), |
| 22 std::move(worker_context_provider)), |
| 22 client_(NULL), | 23 client_(NULL), |
| 23 num_sent_frames_(0), | 24 num_sent_frames_(0), |
| 24 has_external_stencil_test_(false), | 25 has_external_stencil_test_(false), |
| 25 suspended_for_recycle_(false), | 26 suspended_for_recycle_(false), |
| 26 framebuffer_(0), | 27 framebuffer_(0), |
| 27 overlay_candidate_validator_(nullptr) { | 28 overlay_candidate_validator_(nullptr) { |
| 28 capabilities_.delegated_rendering = delegated_rendering; | 29 capabilities_.delegated_rendering = delegated_rendering; |
| 29 } | 30 } |
| 30 | 31 |
| 31 FakeOutputSurface::FakeOutputSurface( | 32 FakeOutputSurface::FakeOutputSurface( |
| 32 scoped_refptr<ContextProvider> context_provider, | 33 std::unique_ptr<ContextProvider::DeferredCreate> context_provider_create, |
| 33 bool delegated_rendering) | 34 bool delegated_rendering) |
| 34 : OutputSurface(context_provider), | 35 : OutputSurface(std::move(context_provider_create)), |
| 35 client_(NULL), | 36 client_(NULL), |
| 36 num_sent_frames_(0), | 37 num_sent_frames_(0), |
| 37 has_external_stencil_test_(false), | 38 has_external_stencil_test_(false), |
| 38 suspended_for_recycle_(false), | 39 suspended_for_recycle_(false), |
| 39 framebuffer_(0), | 40 framebuffer_(0), |
| 40 overlay_candidate_validator_(nullptr) { | 41 overlay_candidate_validator_(nullptr) { |
| 41 capabilities_.delegated_rendering = delegated_rendering; | 42 capabilities_.delegated_rendering = delegated_rendering; |
| 42 } | 43 } |
| 43 | 44 |
| 44 FakeOutputSurface::FakeOutputSurface( | 45 FakeOutputSurface::FakeOutputSurface( |
| 45 std::unique_ptr<SoftwareOutputDevice> software_device, | 46 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 46 bool delegated_rendering) | 47 bool delegated_rendering) |
| 47 : OutputSurface(std::move(software_device)), | 48 : OutputSurface(std::move(software_device)), |
| 48 client_(NULL), | 49 client_(NULL), |
| 49 num_sent_frames_(0), | 50 num_sent_frames_(0), |
| 50 has_external_stencil_test_(false), | 51 has_external_stencil_test_(false), |
| 51 suspended_for_recycle_(false), | 52 suspended_for_recycle_(false), |
| 52 framebuffer_(0), | 53 framebuffer_(0), |
| 53 overlay_candidate_validator_(nullptr) { | 54 overlay_candidate_validator_(nullptr) { |
| 54 capabilities_.delegated_rendering = delegated_rendering; | 55 capabilities_.delegated_rendering = delegated_rendering; |
| 55 } | 56 } |
| 56 | 57 |
| 57 FakeOutputSurface::FakeOutputSurface( | 58 FakeOutputSurface::FakeOutputSurface( |
| 58 scoped_refptr<ContextProvider> context_provider, | 59 std::unique_ptr<ContextProvider::DeferredCreate> context_provider_create, |
| 59 std::unique_ptr<SoftwareOutputDevice> software_device, | 60 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 60 bool delegated_rendering) | 61 bool delegated_rendering) |
| 61 : OutputSurface(context_provider, std::move(software_device)), | 62 : OutputSurface(std::move(context_provider_create), |
| 63 std::move(software_device)), |
| 62 client_(NULL), | 64 client_(NULL), |
| 63 num_sent_frames_(0), | 65 num_sent_frames_(0), |
| 64 has_external_stencil_test_(false), | 66 has_external_stencil_test_(false), |
| 65 suspended_for_recycle_(false), | 67 suspended_for_recycle_(false), |
| 66 framebuffer_(0), | 68 framebuffer_(0), |
| 67 overlay_candidate_validator_(nullptr) { | 69 overlay_candidate_validator_(nullptr) { |
| 68 capabilities_.delegated_rendering = delegated_rendering; | 70 capabilities_.delegated_rendering = delegated_rendering; |
| 69 } | 71 } |
| 70 | 72 |
| 71 FakeOutputSurface::~FakeOutputSurface() {} | 73 FakeOutputSurface::~FakeOutputSurface() {} |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 const { | 145 const { |
| 144 return overlay_candidate_validator_; | 146 return overlay_candidate_validator_; |
| 145 } | 147 } |
| 146 | 148 |
| 147 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( | 149 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( |
| 148 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { | 150 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { |
| 149 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); | 151 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); |
| 150 } | 152 } |
| 151 | 153 |
| 152 } // namespace cc | 154 } // namespace cc |
| OLD | NEW |