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_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | |
6 #define CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "media/video/picture.h" | |
12 #include "ui/gl/gl_bindings.h" | |
13 | |
14 namespace content { | |
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(bool use_backing_pixmaps); | |
23 ~Gles2TextureToEglImageTranslator(); | |
24 | |
25 // Translates texture into EGLImage and back. | |
26 EGLImageKHR TranslateToEglImage(EGLDisplay egl_display, | |
27 EGLContext egl_context, | |
28 uint32 texture, | |
29 const gfx::Size& dimensions); | |
30 uint32 TranslateToTexture(EGLImageKHR egl_image); | |
31 void DestroyEglImage(EGLDisplay egl_display, EGLImageKHR egl_image); | |
32 | |
33 private: | |
34 bool use_backing_pixmaps_; | |
35 typedef std::map<EGLImageKHR, Pixmap> ImagePixmap; | |
36 ImagePixmap eglimage_pixmap_; | |
37 DISALLOW_COPY_AND_ASSIGN(Gles2TextureToEglImageTranslator); | |
38 }; | |
39 | |
40 } // namespace content | |
41 | |
42 #endif // CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | |
OLD | NEW |