Skip to content

Commit ac657e0

Browse files
committed
[Tizen] Support EmbedderExternalTextureGL for impeller
1 parent d107fdd commit ac657e0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ sk_sp<DlImage> EmbedderExternalTextureGL::ResolveTextureImpeller(
140140
}
141141

142142
impeller::TextureDescriptor desc;
143+
desc.type = impeller::TextureType::kTextureExternalOES;
144+
desc.storage_mode = impeller::StorageMode::kDevicePrivate;
145+
desc.format = impeller::PixelFormat::kR8G8B8A8UNormInt;
146+
desc.mip_count = 1;
143147
desc.size = impeller::ISize(texture->width, texture->height);
144148

145149
impeller::ContextGLES& context =
@@ -148,6 +152,9 @@ sk_sp<DlImage> EmbedderExternalTextureGL::ResolveTextureImpeller(
148152
impeller::HandleType::kTexture, texture->target);
149153
std::shared_ptr<impeller::TextureGLES> image =
150154
impeller::TextureGLES::WrapTexture(context.GetReactor(), desc, handle);
155+
image->MarkContentsInitialized();
156+
image->SetCoordinateSystem(
157+
impeller::TextureCoordinateSystem::kUploadFromHost);
151158

152159
if (!image) {
153160
// In case Skia rejects the image, call the release proc so that
@@ -158,6 +165,14 @@ sk_sp<DlImage> EmbedderExternalTextureGL::ResolveTextureImpeller(
158165
FML_LOG(ERROR) << "Could not create external texture";
159166
return nullptr;
160167
}
168+
169+
if (!texture->bind_callback(texture->user_data)) {
170+
if (texture->destruction_callback) {
171+
texture->destruction_callback(texture->user_data);
172+
}
173+
return nullptr;
174+
}
175+
161176
if (texture->destruction_callback &&
162177
!context.GetReactor()->RegisterCleanupCallback(
163178
handle,

0 commit comments

Comments
 (0)