OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | |
6 #define CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | |
7 | |
8 #include <EGL/egl.h> | |
9 #include <EGL/eglext.h> | |
10 #include <GLES2/gl2.h> | |
11 #include <GLES2/gl2ext.h> | |
12 | |
13 #include "base/basictypes.h" | |
14 #include "media/video/picture.h" | |
15 | |
16 // Class to wrap egl-opengles related operations. | |
17 // PPAPI will give the textures to OmxVideoDecodeAccelerator. | |
18 // OmxVideoDecodeAccelerator will use this class to convert | |
19 // these texture into EGLImage and back. | |
20 class Gles2TextureToEglImageTranslator { | |
21 public: | |
22 Gles2TextureToEglImageTranslator(Display* display, int32 gles2_context_id); | |
23 ~Gles2TextureToEglImageTranslator(); | |
24 | |
25 // Translates texture into EGLImage and back. | |
26 EGLImageKHR TranslateToEglImage(uint32 texture); | |
27 uint32 TranslateToTexture(EGLImageKHR egl_image); | |
28 void DestroyEglImage(EGLImageKHR egl_image); | |
29 | |
30 private: | |
31 int32 gles2_context_id_; | |
32 gfx::Size size_; | |
33 EGLDisplay egl_display_; | |
34 EGLContext egl_context_; | |
35 EGLSurface egl_surface_; | |
36 DISALLOW_IMPLICIT_CONSTRUCTORS(Gles2TextureToEglImageTranslator); | |
37 }; | |
38 | |
39 #endif // CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | |
OLD | NEW |