| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace base { |
| 11 class WaitableEvent; |
| 12 } |
| 13 |
| 14 namespace video_test_util { |
| 15 |
| 16 // Creates and draws textures used by the video decoder. |
| 17 // This class is not thread safe and thus all the methods of this class |
| 18 // (except for ctor/dtor) ensure they're being run on a single thread. |
| 19 class RenderingHelper { |
| 20 public: |
| 21 // Create a platform specifc implementation this object. |
| 22 static RenderingHelper* Create(); |
| 23 |
| 24 // Platform specific setup. |
| 25 static void InitializePlatform(); |
| 26 |
| 27 RenderingHelper() {} |
| 28 virtual ~RenderingHelper() {} |
| 29 |
| 30 // Create the window and render context. |
| 31 virtual void Initialize(bool suppress_swap_to_display, |
| 32 int num_windows, |
| 33 int width, |
| 34 int height, |
| 35 base::WaitableEvent* done) = 0; |
| 36 |
| 37 // Undo the effects of Initialize() and signal |*done|. |
| 38 virtual void UnInitialize(base::WaitableEvent* done) = 0; |
| 39 |
| 40 // Return a newly-created GLES2 texture id rendering to a specific window, and |
| 41 // signal |*done|. |
| 42 virtual void CreateTexture(int window_id, |
| 43 uint32* texture_id, |
| 44 base::WaitableEvent* done) = 0; |
| 45 |
| 46 // Render |texture_id| to the screen (unless |suppress_swap_to_display_|). |
| 47 virtual void RenderTexture(uint32 texture_id) = 0; |
| 48 |
| 49 // Delete |texture_id|. |
| 50 virtual void DeleteTexture(uint32 texture_id) = 0; |
| 51 |
| 52 // Get the platform specific handle to the OpenGL context. |
| 53 virtual void* GetGLContext() = 0; |
| 54 |
| 55 // Get the platform specific handle to the OpenGL display. |
| 56 virtual void* GetGLDisplay() = 0; |
| 57 }; |
| 58 |
| 59 } // namespace video_test_util |
| 60 |
| 61 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| OLD | NEW |