Chromium Code Reviews| 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 : OutputSurface(context_provider, worker_context_provider), | 21 : OutputSurface(context_provider, worker_context_provider, nullptr), |
| 22 client_(NULL), | 22 client_(NULL), |
| 23 num_sent_frames_(0), | 23 num_sent_frames_(0), |
| 24 has_external_stencil_test_(false), | 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), | 25 suspended_for_recycle_(false), |
| 39 framebuffer_(0), | 26 framebuffer_(0), |
| 40 overlay_candidate_validator_(nullptr) { | 27 overlay_candidate_validator_(nullptr) { |
| 41 capabilities_.delegated_rendering = delegated_rendering; | 28 capabilities_.delegated_rendering = delegated_rendering; |
| 42 } | 29 } |
| 43 | 30 |
| 44 FakeOutputSurface::FakeOutputSurface( | 31 FakeOutputSurface::FakeOutputSurface( |
| 45 std::unique_ptr<SoftwareOutputDevice> software_device, | 32 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 46 bool delegated_rendering) | 33 bool delegated_rendering) |
| 47 : OutputSurface(std::move(software_device)), | 34 : OutputSurface(nullptr, nullptr, std::move(software_device)), |
| 48 client_(NULL), | 35 client_(NULL), |
| 49 num_sent_frames_(0), | 36 num_sent_frames_(0), |
| 50 has_external_stencil_test_(false), | 37 has_external_stencil_test_(false), |
| 51 suspended_for_recycle_(false), | 38 suspended_for_recycle_(false), |
| 52 framebuffer_(0), | 39 framebuffer_(0), |
| 53 overlay_candidate_validator_(nullptr) { | 40 overlay_candidate_validator_(nullptr) { |
| 54 capabilities_.delegated_rendering = delegated_rendering; | 41 capabilities_.delegated_rendering = delegated_rendering; |
| 55 } | 42 } |
| 56 | 43 |
| 57 FakeOutputSurface::FakeOutputSurface( | 44 FakeOutputSurface::FakeOutputSurface( |
|
piman
2016/05/23 22:23:51
nit, if you want, you can trivially delegate the o
danakj
2016/05/23 22:28:55
Good plan.
| |
| 58 scoped_refptr<ContextProvider> context_provider, | 45 scoped_refptr<ContextProvider> context_provider, |
| 46 scoped_refptr<ContextProvider> worker_context_provider, | |
| 59 std::unique_ptr<SoftwareOutputDevice> software_device, | 47 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 60 bool delegated_rendering) | 48 bool delegated_rendering) |
| 61 : OutputSurface(context_provider, std::move(software_device)), | 49 : OutputSurface(std::move(context_provider), |
| 50 std::move(worker_context_provider), | |
| 51 std::move(software_device)), | |
| 62 client_(NULL), | 52 client_(NULL), |
| 63 num_sent_frames_(0), | 53 num_sent_frames_(0), |
| 64 has_external_stencil_test_(false), | 54 has_external_stencil_test_(false), |
| 65 suspended_for_recycle_(false), | 55 suspended_for_recycle_(false), |
| 66 framebuffer_(0), | 56 framebuffer_(0), |
| 67 overlay_candidate_validator_(nullptr) { | 57 overlay_candidate_validator_(nullptr) { |
| 68 capabilities_.delegated_rendering = delegated_rendering; | 58 capabilities_.delegated_rendering = delegated_rendering; |
| 69 } | 59 } |
| 70 | 60 |
| 71 FakeOutputSurface::~FakeOutputSurface() {} | 61 FakeOutputSurface::~FakeOutputSurface() {} |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 const { | 133 const { |
| 144 return overlay_candidate_validator_; | 134 return overlay_candidate_validator_; |
| 145 } | 135 } |
| 146 | 136 |
| 147 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( | 137 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( |
| 148 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { | 138 std::unique_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { |
| 149 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); | 139 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); |
| 150 } | 140 } |
| 151 | 141 |
| 152 } // namespace cc | 142 } // namespace cc |
| OLD | NEW |