OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test_context_support.h" | 5 #include "cc/test/test_context_support.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 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 void TestContextSupport::PartialSwapBuffers(gfx::Rect sub_buffer) { | 59 void TestContextSupport::PartialSwapBuffers(gfx::Rect sub_buffer) { |
60 last_swap_type_ = PARTIAL_SWAP; | 60 last_swap_type_ = PARTIAL_SWAP; |
61 last_partial_swap_rect_ = sub_buffer; | 61 last_partial_swap_rect_ = sub_buffer; |
62 base::MessageLoop::current()->PostTask( | 62 base::MessageLoop::current()->PostTask( |
63 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete, | 63 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete, |
64 weak_ptr_factory_.GetWeakPtr())); | 64 weak_ptr_factory_.GetWeakPtr())); |
65 CallAllSyncPointCallbacks(); | 65 CallAllSyncPointCallbacks(); |
66 } | 66 } |
67 | 67 |
| 68 void TestContextSupport::SetOverlayPlane(int plane_id, |
| 69 int texture_id, |
| 70 gfx::Rect sub_buffer) {} |
| 71 |
68 void TestContextSupport::SetSwapBuffersCompleteCallback( | 72 void TestContextSupport::SetSwapBuffersCompleteCallback( |
69 const base::Closure& callback) { | 73 const base::Closure& callback) { |
70 swap_buffers_complete_callback_ = callback; | 74 swap_buffers_complete_callback_ = callback; |
71 } | 75 } |
72 | 76 |
73 void TestContextSupport::OnSwapBuffersComplete() { | 77 void TestContextSupport::OnSwapBuffersComplete() { |
74 if (!swap_buffers_complete_callback_.is_null()) | 78 if (!swap_buffers_complete_callback_.is_null()) |
75 swap_buffers_complete_callback_.Run(); | 79 swap_buffers_complete_callback_.Run(); |
76 } | 80 } |
77 | 81 |
78 } // namespace cc | 82 } // namespace cc |
OLD | NEW |