Skip to content

Revert impeller render texture code for gles #131

@xiaowei-guan

Description

@xiaowei-guan

we can remove render texture code for Impeller + gles,because flutter engine has provided same interface for Skia + Impeller

https://github.com/flutter-tizen/embedder/blob/master/flutter/shell/platform/tizen/external_texture_pixel_egl_impeller.cc
https://github.com/flutter-tizen/embedder/blob/master/flutter/shell/platform/tizen/external_texture_surface_egl_impeller.cc

The following code is now failing to render successfully. I will check it.

https://github.com/flutter/flutter/blob/master/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.cc#L130-L170

sk_sp<DlImage> EmbedderExternalTextureGL::ResolveTextureImpeller(
    int64_t texture_id,
    impeller::AiksContext* aiks_context,
    const SkISize& size) {
  std::unique_ptr<FlutterOpenGLTexture> texture =
      external_texture_callback_(texture_id, size.width(), size.height());

  if (!texture) {
    return nullptr;
  }

  impeller::TextureDescriptor desc;
  desc.size = impeller::ISize(texture->width, texture->height);

  impeller::ContextGLES& context =
      impeller::ContextGLES::Cast(*aiks_context->GetContext());
  impeller::HandleGLES handle = context.GetReactor()->CreateHandle(
      impeller::HandleType::kTexture, texture->target);
  std::shared_ptr<impeller::TextureGLES> image =
      impeller::TextureGLES::WrapTexture(context.GetReactor(), desc, handle);

  if (!image) {
    // In case Skia rejects the image, call the release proc so that
    // embedders can perform collection of intermediates.
    if (texture->destruction_callback) {
      texture->destruction_callback(texture->user_data);
    }
    FML_LOG(ERROR) << "Could not create external texture";
    return nullptr;
  }
  if (texture->destruction_callback &&
      !context.GetReactor()->RegisterCleanupCallback(
          handle,
          [callback = texture->destruction_callback,
           user_data = texture->user_data]() { callback(user_data); })) {
    FML_LOG(ERROR) << "Could not register destruction callback";
    return nullptr;
  }

  return impeller::DlImageImpeller::Make(image);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions