| 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 11 matching lines...) Expand all Loading... |
| 22 const base::Closure& callback) OVERRIDE; | 22 const base::Closure& callback) OVERRIDE; |
| 23 virtual void SignalQuery(uint32 query, | 23 virtual void SignalQuery(uint32 query, |
| 24 const base::Closure& callback) OVERRIDE; | 24 const base::Closure& callback) OVERRIDE; |
| 25 virtual void SetSurfaceVisible(bool visible) OVERRIDE; | 25 virtual void SetSurfaceVisible(bool visible) OVERRIDE; |
| 26 virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) | 26 virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) |
| 27 OVERRIDE; | 27 OVERRIDE; |
| 28 virtual void Swap() OVERRIDE; | 28 virtual void Swap() OVERRIDE; |
| 29 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) OVERRIDE; | 29 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) OVERRIDE; |
| 30 virtual void SetSwapBuffersCompleteCallback( | 30 virtual void SetSwapBuffersCompleteCallback( |
| 31 const base::Closure& callback) OVERRIDE; | 31 const base::Closure& callback) OVERRIDE; |
| 32 virtual void ScheduleOverlayPlane(int plane_z_order, |
| 33 unsigned plane_transform, |
| 34 unsigned overlay_texture_id, |
| 35 const gfx::Rect& display_bounds, |
| 36 gfx::RectF uv_rect) OVERRIDE; |
| 32 | 37 |
| 33 void CallAllSyncPointCallbacks(); | 38 void CallAllSyncPointCallbacks(); |
| 34 | 39 |
| 35 typedef base::Callback<void(bool visible)> SurfaceVisibleCallback; | 40 typedef base::Callback<void(bool visible)> SurfaceVisibleCallback; |
| 36 void SetSurfaceVisibleCallback( | 41 void SetSurfaceVisibleCallback( |
| 37 const SurfaceVisibleCallback& set_visible_callback); | 42 const SurfaceVisibleCallback& set_visible_callback); |
| 38 | 43 |
| 44 typedef base::Callback<void(int plane_z_order, |
| 45 unsigned plane_transform, |
| 46 unsigned overlay_texture_id, |
| 47 const gfx::Rect& display_bounds, |
| 48 gfx::RectF uv_rect)> ScheduleOverlayPlaneCallback; |
| 49 void SetScheduleOverlayPlaneCallback( |
| 50 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback); |
| 51 |
| 39 enum SwapType { | 52 enum SwapType { |
| 40 NO_SWAP, | 53 NO_SWAP, |
| 41 SWAP, | 54 SWAP, |
| 42 PARTIAL_SWAP | 55 PARTIAL_SWAP |
| 43 }; | 56 }; |
| 44 | 57 |
| 45 SwapType last_swap_type() const { return last_swap_type_; } | 58 SwapType last_swap_type() const { return last_swap_type_; } |
| 46 gfx::Rect last_partial_swap_rect() const { | 59 gfx::Rect last_partial_swap_rect() const { |
| 47 return last_partial_swap_rect_; | 60 return last_partial_swap_rect_; |
| 48 } | 61 } |
| 49 | 62 |
| 50 private: | 63 private: |
| 51 void OnSwapBuffersComplete(); | 64 void OnSwapBuffersComplete(); |
| 52 | 65 |
| 53 std::vector<base::Closure> sync_point_callbacks_; | 66 std::vector<base::Closure> sync_point_callbacks_; |
| 54 SurfaceVisibleCallback set_visible_callback_; | 67 SurfaceVisibleCallback set_visible_callback_; |
| 68 ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_; |
| 55 | 69 |
| 56 base::Closure swap_buffers_complete_callback_; | 70 base::Closure swap_buffers_complete_callback_; |
| 57 | 71 |
| 58 SwapType last_swap_type_; | 72 SwapType last_swap_type_; |
| 59 gfx::Rect last_partial_swap_rect_; | 73 gfx::Rect last_partial_swap_rect_; |
| 60 | 74 |
| 61 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; | 75 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_; |
| 62 | 76 |
| 63 DISALLOW_COPY_AND_ASSIGN(TestContextSupport); | 77 DISALLOW_COPY_AND_ASSIGN(TestContextSupport); |
| 64 }; | 78 }; |
| 65 | 79 |
| 66 } // namespace cc | 80 } // namespace cc |
| 67 | 81 |
| 68 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_ | 82 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_ |
| OLD | NEW |