OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 // Creates and draws textures used by the video decoder. | 78 // Creates and draws textures used by the video decoder. |
79 // This class is not thread safe and thus all the methods of this class | 79 // This class is not thread safe and thus all the methods of this class |
80 // (except for ctor/dtor) ensure they're being run on a single thread. | 80 // (except for ctor/dtor) ensure they're being run on a single thread. |
81 class RenderingHelper { | 81 class RenderingHelper { |
82 public: | 82 public: |
83 | 83 |
84 RenderingHelper(); | 84 RenderingHelper(); |
85 ~RenderingHelper(); | 85 ~RenderingHelper(); |
86 | 86 |
87 static bool InitializeOneOff(); | 87 // Initialize GL. This method must be called on the rendering |
| 88 // thread. |
| 89 static void InitializeOneOff(base::WaitableEvent* done); |
88 | 90 |
89 // Create the render context and windows by the specified dimensions. | 91 // Setup the platform window to display test results. This method |
| 92 // must be called on the main thread. |
| 93 void Setup(); |
| 94 |
| 95 // Tear down the platform window. This method must be called on the |
| 96 // main thread. |
| 97 void TearDown(); |
| 98 |
| 99 // Create the render context and windows by the specified |
| 100 // dimensions. This method must be called on the rendering thread. |
90 void Initialize(const RenderingHelperParams& params, | 101 void Initialize(const RenderingHelperParams& params, |
91 base::WaitableEvent* done); | 102 base::WaitableEvent* done); |
92 | 103 |
93 // Undo the effects of Initialize() and signal |*done|. | 104 // Undo the effects of Initialize() and signal |*done|. This method |
| 105 // must be called on the rendering thread. |
94 void UnInitialize(base::WaitableEvent* done); | 106 void UnInitialize(base::WaitableEvent* done); |
95 | 107 |
96 // Return a newly-created GLES2 texture id of the specified size, and | 108 // Return a newly-created GLES2 texture id of the specified size, and |
97 // signal |*done|. | 109 // signal |*done|. |
98 void CreateTexture(uint32 texture_target, | 110 void CreateTexture(uint32 texture_target, |
99 uint32* texture_id, | 111 uint32* texture_id, |
100 const gfx::Size& size, | 112 const gfx::Size& size, |
101 base::WaitableEvent* done); | 113 base::WaitableEvent* done); |
102 | 114 |
103 // Render thumbnail in the |texture_id| to the FBO buffer using target | 115 // Render thumbnail in the |texture_id| to the FBO buffer using target |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 base::CancelableClosure render_task_; | 215 base::CancelableClosure render_task_; |
204 base::TimeTicks vsync_timebase_; | 216 base::TimeTicks vsync_timebase_; |
205 base::TimeDelta vsync_interval_; | 217 base::TimeDelta vsync_interval_; |
206 | 218 |
207 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); | 219 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); |
208 }; | 220 }; |
209 | 221 |
210 } // namespace content | 222 } // namespace content |
211 | 223 |
212 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 224 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
OLD | NEW |