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