8#define GL_GLEXT_PROTOTYPES
9#include <GLES2/gl2ext.h>
12#include "flutter/third_party/skia/include/core/SkColorSpace.h"
13#include "flutter/third_party/skia/include/gpu/ganesh/GrBackendSurface.h"
14#include "flutter/third_party/skia/include/gpu/ganesh/GrDirectContext.h"
15#include "flutter/third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
16#include "flutter/third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
17#include "flutter/third_party/skia/include/gpu/ganesh/gl/GrGLTypes.h"
24 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade)
28 if (texture_name_ != 0) {
29 glDeleteTextures(1, &texture_name_);
33void SurfaceTextureExternalTextureGLSkia::ProcessFrame(
PaintContext& context,
34 const SkRect& bounds) {
37 glGenTextures(1, &texture_name_);
45 GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_,
48 GrBackendTextures::MakeGL(1, 1, skgpu::Mipmapped::kNo, textureInfo);
50 context.
gr_context, backendTexture, kTopLeft_GrSurfaceOrigin,
51 kRGBA_8888_SkColorType, kPremul_SkAlphaType,
nullptr));
54void SurfaceTextureExternalTextureGLSkia::Detach() {
static sk_sp< DlImage > Make(const SkImage *image)
~SurfaceTextureExternalTextureGLSkia() override
SurfaceTextureExternalTextureGLSkia(int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &surface_texture, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
Instances of external textures peered to android.graphics.SurfaceTexture.
sk_sp< flutter::DlImage > dl_image_
void Attach(int gl_tex_id)
Attaches the given OpenGL texture handle to the surface texture via a bind operation.
virtual void Detach()
Provides an opportunity for the subclasses to sever the connection between the OpenGL texture resourc...
void Update()
Update the surface texture contents and transformation matrix.
#define FML_CHECK(condition)
GrDirectContext * gr_context