Flutter Windows Embedder
external_texture_d3d.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter 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 FLUTTER_SHELL_PLATFORM_WINDOWS_EXTERNAL_TEXTURE_D3D_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_EXTERNAL_TEXTURE_D3D_H_
7 
8 #include "flutter/fml/macros.h"
11 
12 namespace flutter {
13 
14 // An external texture that is backed by a DXGI surface.
16  public:
20  void* user_data,
21  const AngleSurfaceManager* surface_manager,
22  const GlProcs& gl_procs);
23  virtual ~ExternalTextureD3d();
24 
25  // |ExternalTexture|
26  bool PopulateTexture(size_t width,
27  size_t height,
28  FlutterOpenGLTexture* opengl_texture) override;
29 
30  private:
31  // Creates or updates the backing texture and associates it with the provided
32  // surface.
33  bool CreateOrUpdateTexture(
34  const FlutterDesktopGpuSurfaceDescriptor* descriptor);
35  // Detaches the previously attached surface, if any.
36  void ReleaseImage();
37 
39  const FlutterDesktopGpuSurfaceTextureCallback texture_callback_;
40  void* const user_data_;
41  const AngleSurfaceManager* surface_manager_;
42  const GlProcs& gl_;
43  GLuint gl_texture_ = 0;
44  EGLSurface egl_surface_ = EGL_NO_SURFACE;
45  void* last_surface_handle_ = nullptr;
46 
47  FML_DISALLOW_COPY_AND_ASSIGN(ExternalTextureD3d);
48 };
49 
50 } // namespace flutter
51 
52 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_EXTERNAL_TEXTURE_D3D_H_
flutter::ExternalTextureD3d
Definition: external_texture_d3d.h:15
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:47
angle_surface_manager.h
type
enum flutter::testing::@66::KeyboardChange::Type type
FlutterDesktopGpuSurfaceType
FlutterDesktopGpuSurfaceType
Definition: flutter_texture_registrar.h:32
flutter::AngleSurfaceManager
Definition: angle_surface_manager.h:28
external_texture.h
flutter
Definition: accessibility_bridge_windows.cc:11
FlutterDesktopGpuSurfaceDescriptor
Definition: flutter_texture_registrar.h:70
flutter::ExternalTextureD3d::~ExternalTextureD3d
virtual ~ExternalTextureD3d()
Definition: external_texture_d3d.cc:24
flutter::GlProcs
Definition: external_texture.h:30
flutter::ExternalTextureD3d::PopulateTexture
bool PopulateTexture(size_t width, size_t height, FlutterOpenGLTexture *opengl_texture) override
Definition: external_texture_d3d.cc:32
FlutterDesktopGpuSurfaceTextureCallback
const typedef FlutterDesktopGpuSurfaceDescriptor *(* FlutterDesktopGpuSurfaceTextureCallback)(size_t width, size_t height, void *user_data)
Definition: flutter_texture_registrar.h:125
flutter::ExternalTexture
Definition: external_texture.h:40
flutter::ExternalTextureD3d::ExternalTextureD3d
ExternalTextureD3d(FlutterDesktopGpuSurfaceType type, const FlutterDesktopGpuSurfaceTextureCallback texture_callback, void *user_data, const AngleSurfaceManager *surface_manager, const GlProcs &gl_procs)
Definition: external_texture_d3d.cc:12
texture_callback
FlutterDesktopPixelBufferTextureCallback texture_callback
Definition: texture_registrar_unittests.cc:26