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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 TestContextSupport::TestContextSupport() | 17 TestContextSupport::TestContextSupport() |
18 : out_of_order_callbacks_(false), weak_ptr_factory_(this) {} | 18 : out_of_order_callbacks_(false), weak_ptr_factory_(this) {} |
19 | 19 |
20 TestContextSupport::~TestContextSupport() {} | 20 TestContextSupport::~TestContextSupport() {} |
21 | 21 |
22 void TestContextSupport::SignalSyncPoint(uint32_t sync_point, | |
23 const base::Closure& callback) { | |
24 sync_point_callbacks_.push_back(callback); | |
25 base::ThreadTaskRunnerHandle::Get()->PostTask( | |
26 FROM_HERE, base::Bind(&TestContextSupport::CallAllSyncPointCallbacks, | |
27 weak_ptr_factory_.GetWeakPtr())); | |
28 } | |
29 | |
30 void TestContextSupport::SignalSyncToken(const gpu::SyncToken& sync_token, | 22 void TestContextSupport::SignalSyncToken(const gpu::SyncToken& sync_token, |
31 const base::Closure& callback) { | 23 const base::Closure& callback) { |
32 sync_point_callbacks_.push_back(callback); | 24 sync_point_callbacks_.push_back(callback); |
33 base::ThreadTaskRunnerHandle::Get()->PostTask( | 25 base::ThreadTaskRunnerHandle::Get()->PostTask( |
34 FROM_HERE, base::Bind(&TestContextSupport::CallAllSyncPointCallbacks, | 26 FROM_HERE, base::Bind(&TestContextSupport::CallAllSyncPointCallbacks, |
35 weak_ptr_factory_.GetWeakPtr())); | 27 weak_ptr_factory_.GetWeakPtr())); |
36 } | 28 } |
37 | 29 |
38 void TestContextSupport::SignalQuery(uint32_t query, | 30 void TestContextSupport::SignalQuery(uint32_t query, |
39 const base::Closure& callback) { | 31 const base::Closure& callback) { |
(...skipping 24 matching lines...) Expand all Loading... |
64 } | 56 } |
65 | 57 |
66 void TestContextSupport::SetScheduleOverlayPlaneCallback( | 58 void TestContextSupport::SetScheduleOverlayPlaneCallback( |
67 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback) { | 59 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback) { |
68 schedule_overlay_plane_callback_ = schedule_overlay_plane_callback; | 60 schedule_overlay_plane_callback_ = schedule_overlay_plane_callback; |
69 } | 61 } |
70 | 62 |
71 void TestContextSupport::Swap() { | 63 void TestContextSupport::Swap() { |
72 } | 64 } |
73 | 65 |
74 uint32_t TestContextSupport::InsertFutureSyncPointCHROMIUM() { | |
75 NOTIMPLEMENTED(); | |
76 return 0; | |
77 } | |
78 | |
79 void TestContextSupport::RetireSyncPointCHROMIUM(uint32_t sync_point) { | |
80 NOTIMPLEMENTED(); | |
81 } | |
82 | |
83 void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) { | 66 void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) { |
84 } | 67 } |
85 | 68 |
86 void TestContextSupport::CommitOverlayPlanes() {} | 69 void TestContextSupport::CommitOverlayPlanes() {} |
87 | 70 |
88 void TestContextSupport::ScheduleOverlayPlane( | 71 void TestContextSupport::ScheduleOverlayPlane( |
89 int plane_z_order, | 72 int plane_z_order, |
90 gfx::OverlayTransform plane_transform, | 73 gfx::OverlayTransform plane_transform, |
91 unsigned overlay_texture_id, | 74 unsigned overlay_texture_id, |
92 const gfx::Rect& display_bounds, | 75 const gfx::Rect& display_bounds, |
93 const gfx::RectF& uv_rect) { | 76 const gfx::RectF& uv_rect) { |
94 if (!schedule_overlay_plane_callback_.is_null()) { | 77 if (!schedule_overlay_plane_callback_.is_null()) { |
95 schedule_overlay_plane_callback_.Run(plane_z_order, | 78 schedule_overlay_plane_callback_.Run(plane_z_order, |
96 plane_transform, | 79 plane_transform, |
97 overlay_texture_id, | 80 overlay_texture_id, |
98 display_bounds, | 81 display_bounds, |
99 uv_rect); | 82 uv_rect); |
100 } | 83 } |
101 } | 84 } |
102 | 85 |
103 uint64_t TestContextSupport::ShareGroupTracingGUID() const { | 86 uint64_t TestContextSupport::ShareGroupTracingGUID() const { |
104 NOTIMPLEMENTED(); | 87 NOTIMPLEMENTED(); |
105 return 0; | 88 return 0; |
106 } | 89 } |
107 | 90 |
108 } // namespace cc | 91 } // namespace cc |
OLD | NEW |