Flutter Engine
The Flutter Engine
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"
9#include "flutter/shell/platform/common/public/flutter_texture_registrar.h"
10#include "flutter/shell/platform/windows/egl/proc_table.h"
11#include "flutter/shell/platform/windows/external_texture.h"
12
13namespace flutter {
14
15// An abstraction of an pixel-buffer based texture.
17 public:
20 void* user_data,
21 std::shared_ptr<egl::ProcTable> gl);
22
24
25 // |ExternalTexture|
26 bool PopulateTexture(size_t width,
27 size_t height,
28 FlutterOpenGLTexture* opengl_texture) override;
29
30 private:
31 // Attempts to copy the pixel buffer returned by |texture_callback_| to
32 // OpenGL.
33 // The |width| and |height| will be set to the actual bounds of the copied
34 // pixel buffer.
35 // Returns true on success or false if the pixel buffer returned
36 // by |texture_callback_| was invalid.
37 bool CopyPixelBuffer(size_t& width, size_t& height);
38
39 const FlutterDesktopPixelBufferTextureCallback texture_callback_ = nullptr;
40 void* const user_data_ = nullptr;
41 std::shared_ptr<egl::ProcTable> gl_;
42 GLuint gl_texture_ = 0;
43
44 FML_DISALLOW_COPY_AND_ASSIGN(ExternalTexturePixelBuffer);
45};
46
47} // namespace flutter
48
49#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_EXTERNAL_TEXTURE_PIXELBUFFER_H_
bool PopulateTexture(size_t width, size_t height, FlutterOpenGLTexture *opengl_texture) override
ExternalTexturePixelBuffer(const FlutterDesktopPixelBufferTextureCallback texture_callback, void *user_data, std::shared_ptr< egl::ProcTable > gl)
const FlutterDesktopPixelBuffer *(* FlutterDesktopPixelBufferTextureCallback)(size_t width, size_t height, void *user_data)
gl
Definition: malisc.py:41
int32_t height
int32_t width
void * user_data
FlutterDesktopPixelBufferTextureCallback texture_callback