Skip to content

Commit

Permalink
Add macro definition when creating EmbedderExternalTextureGLImpeller
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowei-guan committed Jul 8, 2024
1 parent c1f2b65 commit f5ed1e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions shell/platform/embedder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ template("embedder_source_set") {
sources += [
"embedder_external_texture_gl.cc",
"embedder_external_texture_gl.h",
"embedder_external_texture_gl_impeller.cc",
"embedder_external_texture_gl_impeller.h",
"embedder_surface_gl.cc",
"embedder_surface_gl.h",
]

if (impeller_supports_rendering) {
sources += [
"embedder_external_texture_gl_impeller.cc",
"embedder_external_texture_gl_impeller.h",
"embedder_surface_gl_impeller.cc",
"embedder_surface_gl_impeller.h",
]
Expand Down
9 changes: 5 additions & 4 deletions shell/platform/embedder/embedder_external_texture_resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "flutter/shell/platform/embedder/embedder_external_texture_resolver.h"

#ifdef SHELL_ENABLE_GL
#if defined(SHELL_ENABLE_GL) && defined(IMPELLER_SUPPORTS_RENDERING)
#include "flutter/shell/platform/embedder/embedder_external_texture_gl_impeller.h"
#endif

Expand All @@ -30,13 +30,14 @@ std::unique_ptr<Texture>
EmbedderExternalTextureResolver::ResolveExternalTexture(int64_t texture_id) {
#ifdef SHELL_ENABLE_GL
if (gl_callback_) {
#ifdef IMPELLER_SUPPORTS_RENDERING
if (enable_impeller_) {
return std::make_unique<EmbedderExternalTextureGLImpeller>(texture_id,
gl_callback_);
} else {
return std::make_unique<EmbedderExternalTextureGL>(texture_id,
gl_callback_);
}
#endif
return std::make_unique<EmbedderExternalTextureGL>(texture_id,
gl_callback_);
}
#endif

Expand Down

0 comments on commit f5ed1e0

Please sign in to comment.