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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 void FakeOutputSurface::OnBeginFrame() { | 98 void FakeOutputSurface::OnBeginFrame() { |
99 client_->BeginFrame(CreateBeginFrameArgsForTesting()); | 99 client_->BeginFrame(CreateBeginFrameArgsForTesting()); |
100 } | 100 } |
101 | 101 |
102 | 102 |
103 bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { | 103 bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { |
104 if (OutputSurface::BindToClient(client)) { | 104 if (OutputSurface::BindToClient(client)) { |
105 client_ = client; | 105 client_ = client; |
106 if (memory_policy_to_set_at_bind_) { | 106 if (memory_policy_to_set_at_bind_) { |
107 client_->SetMemoryPolicy(*memory_policy_to_set_at_bind_.get()); | 107 client_->SetMemoryPolicy(*memory_policy_to_set_at_bind_.get()); |
108 memory_policy_to_set_at_bind_.reset(); | 108 memory_policy_to_set_at_bind_ = nullptr; |
109 } | 109 } |
110 return true; | 110 return true; |
111 } else { | 111 } else { |
112 return false; | 112 return false; |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 void FakeOutputSurface::SetTreeActivationCallback( | 116 void FakeOutputSurface::SetTreeActivationCallback( |
117 const base::Closure& callback) { | 117 const base::Closure& callback) { |
118 DCHECK(client_); | 118 DCHECK(client_); |
(...skipping 16 matching lines...) Expand all 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 |