• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 The Chromium Embedded Framework 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 CEF_LIBCEF_BROWSER_GPU_EXTERNAL_TEXTURE_MANAGER_H_
6 #define CEF_LIBCEF_BROWSER_GPU_EXTERNAL_TEXTURE_MANAGER_H_
7 #pragma once
8 
9 #include <map>
10 
11 #include "gpu/command_buffer/service/texture_manager.h"
12 #include "gpu/gpu_export.h"
13 #include "ui/gl/gl_image.h"
14 #include "ui/gl/gl_surface_egl.h"
15 
16 namespace gl {
17 class GLImage;
18 }
19 
20 namespace gpu {
21 namespace gles2 {
22 
23 class GPU_GLES2_EXPORT ExternalTextureManager {
24  public:
25   ExternalTextureManager();
26   ~ExternalTextureManager();
27 
28   void* CreateTexture(GLuint texture_id,
29                       uint32_t width,
30                       uint32_t height,
31                       TextureManager* tex_man);
32 
33   void LockTexture(void* handle);
34   void UnlockTexture(void* handle);
35 
36   void DeleteTexture(void* handle, TextureManager* tex_man);
37 
38  private:
39   using ExternalSurfaceMap = std::map<void*, scoped_refptr<gl::GLImage>>;
40   ExternalSurfaceMap surfaceMap_;
41 };
42 
43 }  // namespace gles2
44 }  // namespace gpu
45 
46 #endif  // CEF_LIBCEF_BROWSER_GPU_EXTERNAL_TEXTURE_MANAGER_H_
47