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 #ifndef CC_TEST_TEST_CONTEXT_SUPPORT_H_ | 5 #ifndef CC_TEST_TEST_CONTEXT_SUPPORT_H_ |
6 #define CC_TEST_TEST_CONTEXT_SUPPORT_H_ | 6 #define CC_TEST_TEST_CONTEXT_SUPPORT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 TestContextSupport(); | 22 TestContextSupport(); |
23 ~TestContextSupport() override; | 23 ~TestContextSupport() override; |
24 | 24 |
25 // gpu::ContextSupport implementation. | 25 // gpu::ContextSupport implementation. |
26 void SignalSyncPoint(uint32 sync_point, | 26 void SignalSyncPoint(uint32 sync_point, |
27 const base::Closure& callback) override; | 27 const base::Closure& callback) override; |
28 void SignalSyncToken(const gpu::SyncToken& sync_token, | 28 void SignalSyncToken(const gpu::SyncToken& sync_token, |
29 const base::Closure& callback) override; | 29 const base::Closure& callback) override; |
30 void SignalQuery(uint32 query, const base::Closure& callback) override; | 30 void SignalQuery(uint32 query, const base::Closure& callback) override; |
31 void SetSurfaceVisible(bool visible) override; | |
32 void SetAggressivelyFreeResources(bool aggressively_free_resources) override; | 31 void SetAggressivelyFreeResources(bool aggressively_free_resources) override; |
33 void Swap() override; | 32 void Swap() override; |
34 void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; | 33 void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; |
35 uint32 InsertFutureSyncPointCHROMIUM() override; | 34 uint32 InsertFutureSyncPointCHROMIUM() override; |
36 void RetireSyncPointCHROMIUM(uint32 sync_point) override; | 35 void RetireSyncPointCHROMIUM(uint32 sync_point) override; |
37 void ScheduleOverlayPlane(int plane_z_order, | 36 void ScheduleOverlayPlane(int plane_z_order, |
38 gfx::OverlayTransform plane_transform, | 37 gfx::OverlayTransform plane_transform, |
39 unsigned overlay_texture_id, | 38 unsigned overlay_texture_id, |
40 const gfx::Rect& display_bounds, | 39 const gfx::Rect& display_bounds, |
41 const gfx::RectF& uv_rect) override; | 40 const gfx::RectF& uv_rect) override; |
42 uint64_t ShareGroupTracingGUID() const override; | 41 uint64_t ShareGroupTracingGUID() const override; |
43 | 42 |
44 void CallAllSyncPointCallbacks(); | 43 void CallAllSyncPointCallbacks(); |
45 | 44 |
46 typedef base::Callback<void(bool visible)> SurfaceVisibleCallback; | |
47 void SetSurfaceVisibleCallback( | |
48 const SurfaceVisibleCallback& set_visible_callback); | |
49 | |
50 typedef base::Callback<void(int plane_z_order, | 45 typedef base::Callback<void(int plane_z_order, |
51 gfx::OverlayTransform plane_transform, | 46 gfx::OverlayTransform plane_transform, |
52 unsigned overlay_texture_id, | 47 unsigned overlay_texture_id, |
53 const gfx::Rect& display_bounds, | 48 const gfx::Rect& display_bounds, |
54 const gfx::RectF& crop_rect)> | 49 const gfx::RectF& crop_rect)> |
55 ScheduleOverlayPlaneCallback; | 50 ScheduleOverlayPlaneCallback; |
56 void SetScheduleOverlayPlaneCallback( | 51 void SetScheduleOverlayPlaneCallback( |
57 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback); | 52 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback); |
58 | 53 |
59 // If set true, callbacks triggering will be in a reverse order as SignalQuery | 54 // If set true, callbacks triggering will be in a reverse order as SignalQuery |
60 // calls. | 55 // calls. |
61 void set_out_of_order_callbacks(bool out_of_order_callbacks) { | 56 void set_out_of_order_callbacks(bool out_of_order_callbacks) { |
62 out_of_order_callbacks_ = out_of_order_callbacks; | 57 out_of_order_callbacks_ = out_of_order_callbacks; |
63 } | 58 } |
64 | 59 |
65 private: | 60 private: |
66 std::vector<base::Closure> sync_point_callbacks_; | 61 std::vector<base::Closure> sync_point_callbacks_; |
67 SurfaceVisibleCallback set_visible_callback_; | |
68 ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_; | 62 ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_; |
69 bool out_of_order_callbacks_; | 63 bool out_of_order_callbacks_; |
70 | 64 |
71 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; | 65 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; |
72 | 66 |
73 DISALLOW_COPY_AND_ASSIGN(TestContextSupport); | 67 DISALLOW_COPY_AND_ASSIGN(TestContextSupport); |
74 }; | 68 }; |
75 | 69 |
76 } // namespace cc | 70 } // namespace cc |
77 | 71 |
78 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_ | 72 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_ |
OLD | NEW |