| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class TestContextSupport : public gpu::ContextSupport { | 24 class TestContextSupport : public gpu::ContextSupport { |
| 25 public: | 25 public: |
| 26 TestContextSupport(); | 26 TestContextSupport(); |
| 27 ~TestContextSupport() override; | 27 ~TestContextSupport() override; |
| 28 | 28 |
| 29 // gpu::ContextSupport implementation. | 29 // gpu::ContextSupport implementation. |
| 30 void SignalSyncToken(const gpu::SyncToken& sync_token, | 30 void SignalSyncToken(const gpu::SyncToken& sync_token, |
| 31 const base::Closure& callback) override; | 31 const base::Closure& callback) override; |
| 32 void SignalQuery(uint32_t query, const base::Closure& callback) override; | 32 void SignalQuery(uint32_t query, const base::Closure& callback) override; |
| 33 void SetAggressivelyFreeResources(bool aggressively_free_resources) override; | 33 void TrimResources() override; |
| 34 void Swap() override; | 34 void Swap() override; |
| 35 void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; | 35 void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; |
| 36 void CommitOverlayPlanes() override; | 36 void CommitOverlayPlanes() override; |
| 37 void ScheduleOverlayPlane(int plane_z_order, | 37 void ScheduleOverlayPlane(int plane_z_order, |
| 38 gfx::OverlayTransform plane_transform, | 38 gfx::OverlayTransform plane_transform, |
| 39 unsigned overlay_texture_id, | 39 unsigned overlay_texture_id, |
| 40 const gfx::Rect& display_bounds, | 40 const gfx::Rect& display_bounds, |
| 41 const gfx::RectF& uv_rect) override; | 41 const gfx::RectF& uv_rect) override; |
| 42 uint64_t ShareGroupTracingGUID() const override; | 42 uint64_t ShareGroupTracingGUID() const override; |
| 43 void SetErrorMessageCallback( | 43 void SetErrorMessageCallback( |
| 44 const base::Callback<void(const char*, int32_t)>& callback) override; | 44 const base::Callback<void(const char*, int32_t)>& callback) override; |
| 45 void SetClientVisible(int client_id, bool is_visible) override; | 45 std::unique_ptr<ScopedVisibility> ClientBecameVisible() override; |
| 46 void ClientBecameNotVisible( |
| 47 std::unique_ptr<ScopedVisibility> visibility) override; |
| 46 bool AnyClientsVisible() const override; | 48 bool AnyClientsVisible() const override; |
| 47 | 49 |
| 48 void CallAllSyncPointCallbacks(); | 50 void CallAllSyncPointCallbacks(); |
| 49 | 51 |
| 50 typedef base::Callback<void(int plane_z_order, | 52 typedef base::Callback<void(int plane_z_order, |
| 51 gfx::OverlayTransform plane_transform, | 53 gfx::OverlayTransform plane_transform, |
| 52 unsigned overlay_texture_id, | 54 unsigned overlay_texture_id, |
| 53 const gfx::Rect& display_bounds, | 55 const gfx::Rect& display_bounds, |
| 54 const gfx::RectF& crop_rect)> | 56 const gfx::RectF& crop_rect)> |
| 55 ScheduleOverlayPlaneCallback; | 57 ScheduleOverlayPlaneCallback; |
| 56 void SetScheduleOverlayPlaneCallback( | 58 void SetScheduleOverlayPlaneCallback( |
| 57 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback); | 59 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback); |
| 58 | 60 |
| 59 // If set true, callbacks triggering will be in a reverse order as SignalQuery | 61 // If set true, callbacks triggering will be in a reverse order as SignalQuery |
| 60 // calls. | 62 // calls. |
| 61 void set_out_of_order_callbacks(bool out_of_order_callbacks) { | 63 void set_out_of_order_callbacks(bool out_of_order_callbacks) { |
| 62 out_of_order_callbacks_ = out_of_order_callbacks; | 64 out_of_order_callbacks_ = out_of_order_callbacks; |
| 63 } | 65 } |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 std::vector<base::Closure> sync_point_callbacks_; | 68 std::vector<base::Closure> sync_point_callbacks_; |
| 67 ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_; | 69 ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_; |
| 68 bool out_of_order_callbacks_; | 70 bool out_of_order_callbacks_ = false; |
| 69 std::set<int> visible_clients_; | 71 uint32_t num_visible_clients_ = 0; |
| 70 | 72 |
| 71 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; | 73 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(TestContextSupport); | 75 DISALLOW_COPY_AND_ASSIGN(TestContextSupport); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace cc | 78 } // namespace cc |
| 77 | 79 |
| 78 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_ | 80 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_ |
| OLD | NEW |