Flutter Windows Embedder
external_texture_pixelbuffer.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_PIXELBUFFER_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_EXTERNAL_TEXTURE_PIXELBUFFER_H_
7 
8 #include "flutter/fml/macros.h"
11 
12 namespace flutter {
13 
14 // An abstraction of an pixel-buffer based texture.
16  public:
19  void* user_data,
20  const GlProcs& gl_procs);
21 
23 
24  // |ExternalTexture|
25  bool PopulateTexture(size_t width,
26  size_t height,
27  FlutterOpenGLTexture* opengl_texture) override;
28 
29  private:
30  // Attempts to copy the pixel buffer returned by |texture_callback_| to
31  // OpenGL.
32  // The |width| and |height| will be set to the actual bounds of the copied
33  // pixel buffer.
34  // Returns true on success or false if the pixel buffer returned
35  // by |texture_callback_| was invalid.
36  bool CopyPixelBuffer(size_t& width, size_t& height);
37 
38  const FlutterDesktopPixelBufferTextureCallback texture_callback_ = nullptr;
39  void* const user_data_ = nullptr;
40  const GlProcs& gl_;
41  GLuint gl_texture_ = 0;
42 
43  FML_DISALLOW_COPY_AND_ASSIGN(ExternalTexturePixelBuffer);
44 };
45 
46 } // namespace flutter
47 
48 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_EXTERNAL_TEXTURE_PIXELBUFFER_H_
flutter::ExternalTexturePixelBuffer::PopulateTexture
bool PopulateTexture(size_t width, size_t height, FlutterOpenGLTexture *opengl_texture) override
Definition: external_texture_pixelbuffer.cc:23
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:47
external_texture.h
flutter
Definition: accessibility_bridge_windows.cc:11
FlutterDesktopPixelBufferTextureCallback
const typedef FlutterDesktopPixelBuffer *(* FlutterDesktopPixelBufferTextureCallback)(size_t width, size_t height, void *user_data)
Definition: flutter_texture_registrar.h:116
flutter::ExternalTexturePixelBuffer::ExternalTexturePixelBuffer
ExternalTexturePixelBuffer(const FlutterDesktopPixelBufferTextureCallback texture_callback, void *user_data, const GlProcs &gl_procs)
Definition: external_texture_pixelbuffer.cc:9
flutter_texture_registrar.h
flutter::ExternalTexturePixelBuffer
Definition: external_texture_pixelbuffer.h:15
flutter::GlProcs
Definition: external_texture.h:30
flutter::ExternalTexturePixelBuffer::~ExternalTexturePixelBuffer
virtual ~ExternalTexturePixelBuffer()
Definition: external_texture_pixelbuffer.cc:17
flutter::ExternalTexture
Definition: external_texture.h:40
texture_callback
FlutterDesktopPixelBufferTextureCallback texture_callback
Definition: texture_registrar_unittests.cc:26