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 bool delegated_rendering) | 19 bool delegated_rendering) |
20 : OutputSurface(context_provider), | 20 : OutputSurface(context_provider), |
21 client_(NULL), | 21 client_(nullptr), |
22 num_sent_frames_(0), | 22 num_sent_frames_(0), |
23 needs_begin_frame_(false), | 23 needs_begin_frame_(false), |
24 has_external_stencil_test_(false), | 24 has_external_stencil_test_(false), |
25 fake_weak_ptr_factory_(this) { | 25 fake_weak_ptr_factory_(this) { |
26 if (delegated_rendering) { | 26 if (delegated_rendering) { |
27 capabilities_.delegated_rendering = true; | 27 capabilities_.delegated_rendering = true; |
28 capabilities_.max_frames_pending = 1; | 28 capabilities_.max_frames_pending = 1; |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 FakeOutputSurface::FakeOutputSurface( | 32 FakeOutputSurface::FakeOutputSurface( |
33 scoped_ptr<SoftwareOutputDevice> software_device, | 33 scoped_ptr<SoftwareOutputDevice> software_device, |
34 bool delegated_rendering) | 34 bool delegated_rendering) |
35 : OutputSurface(software_device.Pass()), | 35 : OutputSurface(software_device.Pass()), |
36 client_(NULL), | 36 client_(nullptr), |
37 num_sent_frames_(0), | 37 num_sent_frames_(0), |
38 has_external_stencil_test_(false), | 38 has_external_stencil_test_(false), |
39 fake_weak_ptr_factory_(this) { | 39 fake_weak_ptr_factory_(this) { |
40 if (delegated_rendering) { | 40 if (delegated_rendering) { |
41 capabilities_.delegated_rendering = true; | 41 capabilities_.delegated_rendering = true; |
42 capabilities_.max_frames_pending = 1; | 42 capabilities_.max_frames_pending = 1; |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 FakeOutputSurface::FakeOutputSurface( | 46 FakeOutputSurface::FakeOutputSurface( |
47 scoped_refptr<ContextProvider> context_provider, | 47 scoped_refptr<ContextProvider> context_provider, |
48 scoped_ptr<SoftwareOutputDevice> software_device, | 48 scoped_ptr<SoftwareOutputDevice> software_device, |
49 bool delegated_rendering) | 49 bool delegated_rendering) |
50 : OutputSurface(context_provider, software_device.Pass()), | 50 : OutputSurface(context_provider, software_device.Pass()), |
51 client_(NULL), | 51 client_(nullptr), |
52 num_sent_frames_(0), | 52 num_sent_frames_(0), |
53 has_external_stencil_test_(false), | 53 has_external_stencil_test_(false), |
54 fake_weak_ptr_factory_(this) { | 54 fake_weak_ptr_factory_(this) { |
55 if (delegated_rendering) { | 55 if (delegated_rendering) { |
56 capabilities_.delegated_rendering = true; | 56 capabilities_.delegated_rendering = true; |
57 capabilities_.max_frames_pending = 1; | 57 capabilities_.max_frames_pending = 1; |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 FakeOutputSurface::~FakeOutputSurface() {} | 61 FakeOutputSurface::~FakeOutputSurface() {} |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 bool FakeOutputSurface::HasExternalStencilTest() const { | 135 bool FakeOutputSurface::HasExternalStencilTest() const { |
136 return has_external_stencil_test_; | 136 return has_external_stencil_test_; |
137 } | 137 } |
138 | 138 |
139 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( | 139 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( |
140 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { | 140 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { |
141 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); | 141 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); |
142 } | 142 } |
143 | 143 |
144 } // namespace cc | 144 } // namespace cc |
OLD | NEW |