8#define GL_GLEXT_PROTOTYPES
9#include <GLES2/gl2ext.h>
11#include "flutter/third_party/skia/include/core/SkColorSpace.h"
12#include "flutter/third_party/skia/include/gpu/ganesh/GrBackendSurface.h"
13#include "flutter/third_party/skia/include/gpu/ganesh/GrDirectContext.h"
14#include "flutter/third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
15#include "flutter/third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
16#include "flutter/third_party/skia/include/gpu/ganesh/gl/GrGLTypes.h"
23 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade)
27 if (texture_name_ != 0) {
28 glDeleteTextures(1, &texture_name_);
32void SurfaceTextureExternalTextureGLSkia::ProcessFrame(
PaintContext& context,
33 const SkRect& bounds) {
36 glGenTextures(1, &texture_name_);
44 GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_,
47 GrBackendTextures::MakeGL(1, 1, skgpu::Mipmapped::kNo, textureInfo);
49 context.
gr_context, backendTexture, kTopLeft_GrSurfaceOrigin,
50 kRGBA_8888_SkColorType, kPremul_SkAlphaType,
nullptr));
53void 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