| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 OutputSurface::SwapBuffers(frame); | 81 OutputSurface::SwapBuffers(frame); |
| 82 frame->AssignTo(&last_sent_frame_); | 82 frame->AssignTo(&last_sent_frame_); |
| 83 ++num_sent_frames_; | 83 ++num_sent_frames_; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void FakeOutputSurface::SetNeedsBeginImplFrame(bool enable) { | 87 void FakeOutputSurface::SetNeedsBeginImplFrame(bool enable) { |
| 88 needs_begin_impl_frame_ = enable; | 88 needs_begin_impl_frame_ = enable; |
| 89 OutputSurface::SetNeedsBeginImplFrame(enable); | 89 OutputSurface::SetNeedsBeginImplFrame(enable); |
| 90 | 90 |
| 91 // If there is not BeginImplFrame emulation from the FrameRateController, | 91 // If there is not BeginImplFrame emulation from the BeginFrameSource, |
| 92 // then we just post a BeginImplFrame to emulate it as part of the test. | 92 // then we just post a BeginImplFrame to emulate it as part of the test. |
| 93 if (enable && !frame_rate_controller_) { | 93 if (enable && !frame_rate_controller_) { |
| 94 base::MessageLoop::current()->PostDelayedTask( | 94 base::MessageLoop::current()->PostDelayedTask( |
| 95 FROM_HERE, base::Bind(&FakeOutputSurface::OnBeginImplFrame, | 95 FROM_HERE, base::Bind(&FakeOutputSurface::OnBeginImplFrame, |
| 96 fake_weak_ptr_factory_.GetWeakPtr()), | 96 fake_weak_ptr_factory_.GetWeakPtr()), |
| 97 base::TimeDelta::FromMilliseconds(16)); | 97 base::TimeDelta::FromMilliseconds(16)); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 void FakeOutputSurface::OnBeginImplFrame() { | 101 void FakeOutputSurface::OnBeginImplFrame() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool FakeOutputSurface::HasExternalStencilTest() const { | 142 bool FakeOutputSurface::HasExternalStencilTest() const { |
| 143 return has_external_stencil_test_; | 143 return has_external_stencil_test_; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( | 146 void FakeOutputSurface::SetMemoryPolicyToSetAtBind( |
| 147 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { | 147 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind) { |
| 148 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); | 148 memory_policy_to_set_at_bind_.swap(memory_policy_to_set_at_bind); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace cc | 151 } // namespace cc |
| OLD | NEW |