Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shell/platform/tizen/channels/platform_view_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,5 @@ void PlatformViewChannel::OnTouch(

result->Success();
}

} // namespace flutter
6 changes: 3 additions & 3 deletions shell/platform/tizen/external_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ enum class ExternalTextureExtensionType { kNone, kNativeSurface, kDmaBuffer };

struct ExternalTextureGLState {
GLuint gl_texture;
ExternalTextureExtensionType gl_extention;
ExternalTextureExtensionType gl_extension;
};

static std::atomic_long next_texture_id = {1};

// An adaptation class of flutter engine and external texture interface.
class ExternalTexture : public std::enable_shared_from_this<ExternalTexture> {
public:
ExternalTexture(ExternalTextureExtensionType gl_extention =
ExternalTexture(ExternalTextureExtensionType gl_extension =
ExternalTextureExtensionType::kNone)
: state_(std::make_unique<ExternalTextureGLState>()),
texture_id_(next_texture_id++) {
state_->gl_extention = gl_extention;
state_->gl_extension = gl_extension;
}
virtual ~ExternalTexture() = default;

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/tizen/external_texture_surface_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace flutter {
class ExternalTextureSurfaceGL : public ExternalTexture {
public:
ExternalTextureSurfaceGL(
ExternalTextureExtensionType gl_extention,
ExternalTextureExtensionType gl_extension,
FlutterDesktopGpuBufferTextureCallback texture_callback,
FlutterDesktopGpuBufferDestructionCallback destruction_callback,
void* user_data);
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/tizen/external_texture_surface_gl_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
namespace flutter {

ExternalTextureSurfaceGL::ExternalTextureSurfaceGL(
ExternalTextureExtensionType gl_extention,
ExternalTextureExtensionType gl_extension,
FlutterDesktopGpuBufferTextureCallback texture_callback,
FlutterDesktopGpuBufferDestructionCallback destruction_callback,
void* user_data)
: ExternalTexture(gl_extention),
: ExternalTexture(gl_extension),
texture_callback_(texture_callback),
destruction_callback_(destruction_callback),
user_data_(user_data) {}
Expand Down
14 changes: 7 additions & 7 deletions shell/platform/tizen/external_texture_surface_gl_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ static void OnCollectTexture(void* textureGL) {
}

ExternalTextureSurfaceGL::ExternalTextureSurfaceGL(
ExternalTextureExtensionType gl_extention,
ExternalTextureExtensionType gl_extension,
FlutterDesktopGpuBufferTextureCallback texture_callback,
FlutterDesktopGpuBufferDestructionCallback destruction_callback,
void* user_data)
: ExternalTexture(gl_extention),
: ExternalTexture(gl_extension),
texture_callback_(texture_callback),
destruction_callback_(destruction_callback),
user_data_(user_data) {}
Expand Down Expand Up @@ -90,12 +90,12 @@ bool ExternalTextureSurfaceGL::PopulateTexture(

#ifdef TIZEN_RENDERER_EVAS_GL
EvasGLImage egl_src_image = nullptr;
if (state_->gl_extention == ExternalTextureExtensionType::kNativeSurface) {
if (state_->gl_extension == ExternalTextureExtensionType::kNativeSurface) {
int attribs[] = {EVAS_GL_IMAGE_PRESERVED, GL_TRUE, 0};
egl_src_image = evasglCreateImageForContext(
g_evas_gl, evas_gl_current_context_get(g_evas_gl),
EVAS_GL_NATIVE_SURFACE_TIZEN, tbm_surface, attribs);
} else if (state_->gl_extention == ExternalTextureExtensionType::kDmaBuffer) {
} else if (state_->gl_extension == ExternalTextureExtensionType::kDmaBuffer) {
FT_LOG(Error)
<< "EGL_EXT_image_dma_buf_import is not supported this renderer.";
return false;
Expand Down Expand Up @@ -127,13 +127,13 @@ bool ExternalTextureSurfaceGL::PopulateTexture(
eglGetProcAddress("eglCreateImageKHR"));
EGLImageKHR egl_src_image = nullptr;

if (state_->gl_extention == ExternalTextureExtensionType::kNativeSurface) {
if (state_->gl_extension == ExternalTextureExtensionType::kNativeSurface) {
const EGLint attribs[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE,
EGL_NONE};
egl_src_image =
n_eglCreateImageKHR(eglGetCurrentDisplay(), EGL_NO_CONTEXT,
EGL_NATIVE_SURFACE_TIZEN, tbm_surface, attribs);
} else if (state_->gl_extention == ExternalTextureExtensionType::kDmaBuffer) {
} else if (state_->gl_extension == ExternalTextureExtensionType::kDmaBuffer) {
EGLint attribs[50];
int atti = 0;
int plane_fd_ext[4] = {EGL_DMA_BUF_PLANE0_FD_EXT, EGL_DMA_BUF_PLANE1_FD_EXT,
Expand Down Expand Up @@ -172,7 +172,7 @@ bool ExternalTextureSurfaceGL::PopulateTexture(
}

if (!egl_src_image) {
if (state_->gl_extention != ExternalTextureExtensionType::kNone) {
if (state_->gl_extension != ExternalTextureExtensionType::kNone) {
FT_LOG(Error) << "eglCreateImageKHR failed with an error "
<< eglGetError() << " for texture ID: " << texture_id_;
} else {
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/tizen/flutter_tizen_texture_registrar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ FlutterTizenTextureRegistrar::CreateExternalTexture(
case kFlutterDesktopGpuBufferTexture:
ExternalTextureExtensionType gl_extension =
ExternalTextureExtensionType::kNone;
if (engine_->renderer()->IsSupportedExtention(
if (engine_->renderer()->IsSupportedExtension(
"EGL_TIZEN_image_native_surface")) {
gl_extension = ExternalTextureExtensionType::kNativeSurface;
} else if (engine_->renderer()->IsSupportedExtention(
} else if (engine_->renderer()->IsSupportedExtension(
"EGL_EXT_image_dma_buf_import")) {
gl_extension = ExternalTextureExtensionType::kDmaBuffer;
}
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/tizen/tizen_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class TizenRenderer {
int32_t height,
int32_t degree) = 0;
virtual void SetPreferredOrientations(const std::vector<int>& rotations) = 0;
virtual bool IsSupportedExtention(const char* name) = 0;
virtual bool IsSupportedExtension(const char* name) = 0;

protected:
explicit TizenRenderer(Geometry geometry,
Expand Down
9 changes: 3 additions & 6 deletions shell/platform/tizen/tizen_renderer_ecore_wl2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ bool TizenRendererEcoreWl2::SetupEglSurface() {
FT_LOG(Error) << "ChooseEGLConfiguration() failed.";
return false;
}
egl_extention_str_ = eglQueryString(egl_display_, EGL_EXTENSIONS);
egl_extension_str_ = eglQueryString(egl_display_, EGL_EXTENSIONS);

const EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
egl_context_ = eglCreateContext(egl_display_, egl_config_, EGL_NO_CONTEXT,
Expand Down Expand Up @@ -590,11 +590,8 @@ void TizenRendererEcoreWl2::SetPreferredOrientations(
rotations.size());
}

bool TizenRendererEcoreWl2::IsSupportedExtention(const char* name) {
if (strstr(egl_extention_str_.c_str(), name)) {
return true;
}
return false;
bool TizenRendererEcoreWl2::IsSupportedExtension(const char* name) {
return strstr(egl_extension_str_.c_str(), name);
}

void TizenRendererEcoreWl2::SetTizenPolicyNotificationLevel(int level) {
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/tizen/tizen_renderer_ecore_wl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TizenRendererEcoreWl2 : public TizenRenderer {
int32_t height,
int32_t angle) override;
void SetPreferredOrientations(const std::vector<int>& rotations) override;
bool IsSupportedExtention(const char* name) override;
bool IsSupportedExtension(const char* name) override;

private:
bool InitializeRenderer();
Expand Down Expand Up @@ -85,7 +85,7 @@ class TizenRendererEcoreWl2 : public TizenRenderer {
EGLContext egl_resource_context_ = EGL_NO_CONTEXT;
EGLSurface egl_resource_surface_ = EGL_NO_SURFACE;

std::string egl_extention_str_;
std::string egl_extension_str_;

tizen_policy* tizen_policy_ = nullptr;
};
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/tizen/tizen_renderer_evas_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ void TizenRendererEvasGL::SetPreferredOrientations(
rotations.size());
}

bool TizenRendererEvasGL::IsSupportedExtention(const char* name) {
bool TizenRendererEvasGL::IsSupportedExtension(const char* name) {
return strcmp(name, "EGL_TIZEN_image_native_surface") == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/tizen/tizen_renderer_evas_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TizenRendererEvasGL : public TizenRenderer {
int32_t height,
int32_t angle) override;
void SetPreferredOrientations(const std::vector<int>& rotations) override;
bool IsSupportedExtention(const char* name) override;
bool IsSupportedExtension(const char* name) override;

Evas_Object* GetImageHandle();

Expand Down