diff --git a/BUILD.gn b/BUILD.gn index 32421b752ed24..5ff1cd769a812 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -7,6 +7,7 @@ import("//flutter/common/config.gni") import("//flutter/examples/examples.gni") import("//flutter/shell/platform/config.gni") import("//flutter/shell/platform/glfw/config.gni") +import("//flutter/shell/platform/tizen/config.gni") import("//flutter/testing/testing.gni") import("//third_party/dart/build/dart/copy_tree.gni") @@ -228,6 +229,10 @@ group("unittests") { public_deps += [ "//flutter/shell/platform/glfw:flutter_glfw_unittests" ] } + if (build_tizen_shell) { + public_deps += + [ "//flutter/shell/platform/tizen:flutter_tizen_unittests" ] + } } if (is_mac) { diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index 45519610ae9f9..0e5fb51a2e040 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,11 +13,10 @@ group("platform") { deps = [ "android" ] } else if (is_linux) { deps = [] - if (enable_desktop_embeddings) { - deps += [ "linux" ] - } if (build_tizen_shell) { deps += [ "tizen" ] + } else if (enable_desktop_embeddings) { + deps += [ "linux" ] } } else if (is_win) { deps = [] diff --git a/shell/platform/common/BUILD.gn b/shell/platform/common/BUILD.gn index 33f9521cec178..29bf2b2bf04a9 100644 --- a/shell/platform/common/BUILD.gn +++ b/shell/platform/common/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//flutter/common/config.gni") +import("//flutter/shell/platform/config.gni") import("//flutter/shell/platform/tizen/config.gni") import("//flutter/testing/testing.gni") @@ -192,6 +193,7 @@ if (enable_unittests) { "//flutter/fml:string_conversion", "//flutter/shell/platform/common/client_wrapper:client_wrapper", "//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs", + "//flutter/shell/platform/embedder:embedder_as_internal_library", "//flutter/testing", ] diff --git a/shell/platform/tizen/BUILD.gn b/shell/platform/tizen/BUILD.gn index 18bc5e2f7b447..bd33143429e3a 100644 --- a/shell/platform/tizen/BUILD.gn +++ b/shell/platform/tizen/BUILD.gn @@ -3,7 +3,9 @@ # found in the LICENSE file. import("//flutter/shell/platform/common/client_wrapper/publish.gni") +import("//flutter/shell/platform/config.gni") import("//flutter/shell/platform/tizen/config.gni") +import("//flutter/testing/testing.gni") # Sets the rpath of dependent targets (shared libs) to $ORIGIN. # We assume that the flutter_engine library exists next to the embedder library @@ -24,6 +26,29 @@ source_set("flutter_engine") { deps = [ "//flutter/shell/platform/embedder:flutter_engine" ] } +_flutter_tizen_source = [ + "channels/key_event_channel.cc", + "channels/lifecycle_channel.cc", + "channels/navigation_channel.cc", + "channels/platform_view_channel.cc", + "channels/text_input_channel.cc", + "flutter_tizen.cc", + "flutter_tizen_engine.cc", + "flutter_tizen_texture_registrar.cc", + "key_event_handler.cc", + "tizen_event_loop.cc", + "tizen_renderer.cc", + "touch_event_handler.cc", +] + +_libs_minimum = [ + "ecore", + "ecore_imf", + "ecore_input", + "eina", + "wayland-client", +] + _public_headers = [ "public/flutter_platform_view.h", "public/flutter_tizen.h", @@ -33,42 +58,54 @@ _public_headers = [ # added to the compiler's search paths. Since we are not using the Tizen CLI # builder, we have to add them manually. config("tizen_rootstrap_include_dirs") { + local_prefix = "$custom_sysroot/usr" + + if (enable_desktop_embeddings && target_cpu == "x64") { + defines = [ "__X64_SHELL__" ] + local_prefix += "/local" + } + include_dirs = [ - "$custom_sysroot/usr/include", - "$custom_sysroot/usr/include/appfw", - "$custom_sysroot/usr/include/base", - "$custom_sysroot/usr/include/dlog", - "$custom_sysroot/usr/include/ecore-1", - "$custom_sysroot/usr/include/ecore-imf-1", - "$custom_sysroot/usr/include/ecore-input-1", - "$custom_sysroot/usr/include/ecore-wayland-1", - "$custom_sysroot/usr/include/ecore-wl2-1", - "$custom_sysroot/usr/include/efl-1", - "$custom_sysroot/usr/include/eina-1", - "$custom_sysroot/usr/include/eina-1/eina", - "$custom_sysroot/usr/include/emile-1", - "$custom_sysroot/usr/include/eo-1", - "$custom_sysroot/usr/include/feedback", - "$custom_sysroot/usr/include/system", - "$custom_sysroot/usr/include/wayland-extension", + local_prefix + "/include", + local_prefix + "/include/appfw", + local_prefix + "/include/base", + local_prefix + "/include/dlog", + local_prefix + "/include/ecore-1", + local_prefix + "/include/ecore-imf-1", + local_prefix + "/include/ecore-input-1", + local_prefix + "/include/ecore-wayland-1", + local_prefix + "/include/ecore-wl2-1", + local_prefix + "/include/efl-1", + local_prefix + "/include/eina-1", + local_prefix + "/include/eina-1/eina", + local_prefix + "/include/emile-1", + local_prefix + "/include/eo-1", + local_prefix + "/include/feedback", + local_prefix + "/include/system", + local_prefix + "/include/wayland-extension", ] # Contain headers that the Evas_GL renderer depends on. include_dirs += [ - "$custom_sysroot/usr/include/ecore-con-1", - "$custom_sysroot/usr/include/ecore-evas-1", - "$custom_sysroot/usr/include/ecore-file-1", - "$custom_sysroot/usr/include/edje-1", - "$custom_sysroot/usr/include/eet-1", - "$custom_sysroot/usr/include/efl-1/interfaces", - "$custom_sysroot/usr/include/efreet-1", - "$custom_sysroot/usr/include/elementary-1", - "$custom_sysroot/usr/include/ethumb-1", - "$custom_sysroot/usr/include/ethumb-client-1", - "$custom_sysroot/usr/include/evas-1", + local_prefix + "/include/ecore-con-1", + local_prefix + "/include/ecore-evas-1", + local_prefix + "/include/ecore-file-1", + local_prefix + "/include/edje-1", + local_prefix + "/include/eet-1", + local_prefix + "/include/efl-1/interfaces", + local_prefix + "/include/efreet-1", + local_prefix + "/include/elementary-1", + local_prefix + "/include/ethumb-1", + local_prefix + "/include/ethumb-client-1", + local_prefix + "/include/evas-1", ] - lib_dirs = [ "$custom_sysroot/usr/lib" ] + if (enable_desktop_embeddings && target_cpu == "x64") { + include_dirs += [ local_prefix + "/include/eldbus-1" ] + lib_dirs = [ local_prefix + "/lib/x86_64-linux-gnu" ] + } else { + lib_dirs = [ local_prefix + "/lib" ] + } } # Template for the embedder build. Used to generate embedders for different @@ -86,48 +123,37 @@ template("embedder_for_profile") { shared_library("flutter_tizen_${target_name}") { public = _public_headers - sources = [ - "channels/key_event_channel.cc", - "channels/lifecycle_channel.cc", + sources = _flutter_tizen_source + sources += [ "channels/localization_channel.cc", - "channels/navigation_channel.cc", "channels/platform_channel.cc", - "channels/platform_view_channel.cc", "channels/settings_channel.cc", - "channels/text_input_channel.cc", "external_texture_pixel_gl.cc", "external_texture_surface_gl.cc", - "flutter_tizen.cc", - "flutter_tizen_engine.cc", - "flutter_tizen_texture_registrar.cc", - "key_event_handler.cc", - "tizen_event_loop.cc", "tizen_log.cc", - "tizen_renderer.cc", - "touch_event_handler.cc", ] - libs = [ - "base-utils-i18n", - "capi-appfw-application", - "capi-base-common", - "capi-system-system-settings", - "dlog", - "ecore", - "ecore_imf", - "ecore_input", - "eina", - "EGL", - "feedback", - "GLESv2", - "tbm", - "tdm-client", - "wayland-client", - ] + libs = _libs_minimum + + if (!enable_desktop_embeddings) { + libs += [ + "base-utils-i18n", + "capi-appfw-application", + "capi-base-common", + "capi-system-info", + "capi-system-system-settings", + "dlog", + "feedback", + "tbm", + "tdm-client", + "EGL", + "GLESv2", + ] + } defines = invoker.defines - if (use_evas_gl_renderer) { + if (use_evas_gl_renderer || enable_desktop_embeddings) { sources += [ "tizen_renderer_evas_gl.cc" ] libs += [ @@ -167,6 +193,11 @@ template("embedder_for_profile") { "//flutter/shell/platform/common/client_wrapper:client_wrapper", "//third_party/rapidjson", ] + + if (enable_desktop_embeddings) { + deps += + [ "//flutter/shell/platform/embedder:embedder_as_internal_library" ] + } } } @@ -188,6 +219,102 @@ embedder_for_profile("common") { defines = [ "COMMON_PROFILE" ] } +test_fixtures("flutter_tizen_fixtures") { + fixtures = [] +} + +template("embedder_executable") { + forward_variables_from(invoker, [ "unit_test" ]) + + if (!defined(unit_test)) { + unit_test = false + } + + executable("${target_name}") { + if (unit_test) { + testonly = true + } + + public = _public_headers + + sources = _flutter_tizen_source + sources += [ + "channels/localization_channel_stub.cc", + "channels/platform_channel_stub.cc", + "channels/settings_channel_stub.cc", + "tizen_log_stub.cc", + "tizen_renderer_evas_gl.cc", + ] + + if (defined(invoker.sources)) { + sources += invoker.sources + } + + libs = _libs_minimum + + libs += [ + "ecore_evas", + "elementary", + "evas", + ] + + defines = [ "TIZEN_RENDERER_EVAS_GL" ] + + cflags_cc = [ + "-Wno-newline-eof", + "-Wno-macro-redefined", + ] + + public_configs = [ "//flutter:config" ] + + configs += [ + ":tizen_rootstrap_include_dirs", + "//flutter/shell/platform/common:desktop_library_implementation", + ] + + deps = [ + "//flutter/runtime:libdart", + "//flutter/shell/platform/common:common_cpp", + "//flutter/shell/platform/common:common_cpp_input", + "//flutter/shell/platform/common:common_cpp_library_headers", + "//flutter/shell/platform/common/client_wrapper:client_wrapper", + "//flutter/shell/platform/embedder:embedder_headers", + "//third_party/rapidjson", + ] + + if (defined(invoker.deps)) { + deps += invoker.deps + } + + if (defined(invoker.public_deps)) { + public_deps = invoker.public_deps + } + } +} + +embedder_executable("flutter_tizen_unittests") { + unit_test = true + + sources = [ + "flutter_tizen_engine_unittest.cc", + "testing/mock_engine.cc", + ] + + public_deps = [ "//third_party/googletest:gtest" ] + + deps = [ + ":flutter_tizen_fixtures", + "//flutter/shell/platform/embedder:embedder_test_utils", + "//flutter/testing", + ] +} + +embedder_executable("flutter_tizen_shell") { + sources = [ "flutter_tizen_shell.cc" ] + + public_deps = [ ":flutter_engine" ] +} + publish_client_wrapper_core("publish_cpp_client_wrapper") { visibility = [ ":*" ] } @@ -216,11 +343,17 @@ copy("copy_icu") { group("tizen") { deps = [ ":copy_icu", - ":flutter_tizen_common", - ":flutter_tizen_mobile", - ":flutter_tizen_tv", - ":flutter_tizen_wearable", ":publish_cpp_client_wrapper", ":publish_headers_tizen", ] + if (enable_desktop_embeddings) { + deps += [ ":flutter_tizen_shell" ] + } else { + deps += [ + ":flutter_tizen_common", + ":flutter_tizen_mobile", + ":flutter_tizen_tv", + ":flutter_tizen_wearable", + ] + } } diff --git a/shell/platform/tizen/channels/localization_channel.cc b/shell/platform/tizen/channels/localization_channel.cc index e86d904a96fff..4a911cf94e042 100644 --- a/shell/platform/tizen/channels/localization_channel.cc +++ b/shell/platform/tizen/channels/localization_channel.cc @@ -5,6 +5,7 @@ #include "localization_channel.h" #include + #include #include "flutter/shell/platform/tizen/flutter_tizen_engine.h" diff --git a/shell/platform/tizen/channels/localization_channel_stub.cc b/shell/platform/tizen/channels/localization_channel_stub.cc new file mode 100644 index 0000000000000..66c4f19f0fad3 --- /dev/null +++ b/shell/platform/tizen/channels/localization_channel_stub.cc @@ -0,0 +1,17 @@ +// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "localization_channel.h" + +namespace flutter { + +LocalizationChannel::LocalizationChannel(FlutterTizenEngine* engine) { + engine_ = nullptr; +} + +LocalizationChannel::~LocalizationChannel() {} + +void LocalizationChannel::SendLocales() {} + +} // namespace flutter diff --git a/shell/platform/tizen/channels/platform_channel_stub.cc b/shell/platform/tizen/channels/platform_channel_stub.cc new file mode 100644 index 0000000000000..22a1ffdbbd090 --- /dev/null +++ b/shell/platform/tizen/channels/platform_channel_stub.cc @@ -0,0 +1,30 @@ +// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "platform_channel.h" + +namespace flutter { + +PlatformChannel::PlatformChannel(BinaryMessenger* messenger, + TizenRenderer* renderer) { + renderer_ = nullptr; +} + +PlatformChannel::~PlatformChannel() {} + +void PlatformChannel::HandleMethodCall( + const MethodCall& call, + std::unique_ptr> result) {} + +namespace clipboard { + +void GetData(const MethodCall& call, + std::unique_ptr> result) {} + +void SetData(const MethodCall& call, + std::unique_ptr> result) {} + +} // namespace clipboard + +} // namespace flutter diff --git a/shell/platform/tizen/channels/settings_channel.h b/shell/platform/tizen/channels/settings_channel.h index db7af4b5dae4e..17f23203b28c6 100644 --- a/shell/platform/tizen/channels/settings_channel.h +++ b/shell/platform/tizen/channels/settings_channel.h @@ -5,7 +5,13 @@ #ifndef EMBEDDER_SETTINGS_CHANNEL_H_ #define EMBEDDER_SETTINGS_CHANNEL_H_ +#ifndef __X64_SHELL__ #include +#else +typedef enum { + SYSTEM_SETTINGS_KEY_MAX, +} system_settings_key_e; +#endif #include diff --git a/shell/platform/tizen/channels/settings_channel_stub.cc b/shell/platform/tizen/channels/settings_channel_stub.cc new file mode 100644 index 0000000000000..0f38c29a48516 --- /dev/null +++ b/shell/platform/tizen/channels/settings_channel_stub.cc @@ -0,0 +1,18 @@ +// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "settings_channel.h" + +namespace flutter { + +SettingsChannel::SettingsChannel(BinaryMessenger* messenger) {} + +SettingsChannel::~SettingsChannel() {} + +void SettingsChannel::SendSettingsEvent() {} + +void SettingsChannel::OnSettingsChangedCallback(system_settings_key_e key, + void* user_data) {} + +} // namespace flutter diff --git a/shell/platform/tizen/channels/text_input_channel.cc b/shell/platform/tizen/channels/text_input_channel.cc index 388fe2dbc143d..fb7064ee42507 100644 --- a/shell/platform/tizen/channels/text_input_channel.cc +++ b/shell/platform/tizen/channels/text_input_channel.cc @@ -409,6 +409,8 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) { #ifdef WEARABLE_PROFILE // Hardware keyboard not supported on watches. bool is_ime = true; +#elif __X64_SHELL__ + bool is_ime = false; #else bool is_ime = strcmp(ecore_device_name_get(event->dev), "ime") == 0; #endif diff --git a/shell/platform/tizen/flutter_tizen_engine_unittest.cc b/shell/platform/tizen/flutter_tizen_engine_unittest.cc new file mode 100644 index 0000000000000..4acce271181b7 --- /dev/null +++ b/shell/platform/tizen/flutter_tizen_engine_unittest.cc @@ -0,0 +1,115 @@ +// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved. +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "flutter/shell/platform/tizen/flutter_tizen_engine.h" +#include "gtest/gtest.h" + +namespace flutter { +namespace testing { + +class FlutterTizenEngineTestSimple : public ::testing::Test { + protected: + void SetUp() { ecore_init(); } +}; + +TEST_F(FlutterTizenEngineTestSimple, Create_Headless) { + flutter::FlutterTizenEngine* tizen_engine = + new flutter::FlutterTizenEngine(false); + EXPECT_TRUE(tizen_engine != nullptr); + delete tizen_engine; +} + +// TODO +TEST_F(FlutterTizenEngineTestSimple, DISABLED_Create_Headed) { + flutter::FlutterTizenEngine* tizen_engine = + new flutter::FlutterTizenEngine(true); + EXPECT_TRUE(tizen_engine != nullptr); + delete tizen_engine; +} + +class FlutterTizenEngineTest : public ::testing::Test { + public: + FlutterTizenEngineTest() { + ecore_init(); + + std::string tpk_root; + char path[256]; + EXPECT_TRUE(getcwd(path, sizeof(path)) != NULL); + tpk_root = path + std::string("/tpkroot"); + + assets_path_ = tpk_root + "/res/flutter_assets"; + icu_data_path_ = tpk_root + "/res/icudtl.dat"; + aot_lib_path_ = tpk_root + "/lib/libapp.so"; + + switches_.push_back("--disable-observatory"); + } + + protected: + void SetUp() { + engine_prop_.assets_path = assets_path_.c_str(); + engine_prop_.icu_data_path = icu_data_path_.c_str(); + engine_prop_.aot_library_path = aot_lib_path_.c_str(); + engine_prop_.switches = switches_.data(); + engine_prop_.switches_count = switches_.size(); + + auto engine = std::make_unique(false); + engine_ = engine.release(); + } + + void TearDown() { + if (engine_) { + delete engine_; + } + engine_ = nullptr; + } + + std::string assets_path_; + std::string icu_data_path_; + std::string aot_lib_path_; + flutter::FlutterTizenEngine* engine_; + FlutterDesktopEngineProperties engine_prop_ = {}; + std::vector switches_; +}; + +TEST_F(FlutterTizenEngineTest, Run) { + EXPECT_TRUE(engine_ != nullptr); + EXPECT_TRUE(engine_->RunEngine(engine_prop_)); + EXPECT_TRUE(true); +} + +// TODO +TEST_F(FlutterTizenEngineTest, DISABLED_Run_Twice) { + EXPECT_TRUE(engine_ != nullptr); + EXPECT_TRUE(engine_->RunEngine(engine_prop_)); + EXPECT_FALSE(engine_->RunEngine(engine_prop_)); + EXPECT_TRUE(true); +} + +TEST_F(FlutterTizenEngineTest, Stop) { + EXPECT_TRUE(engine_ != nullptr); + EXPECT_TRUE(engine_->RunEngine(engine_prop_)); + EXPECT_TRUE(engine_->StopEngine()); +} + +TEST_F(FlutterTizenEngineTest, Stop_Twice) { + EXPECT_TRUE(engine_ != nullptr); + EXPECT_TRUE(engine_->RunEngine(engine_prop_)); + EXPECT_TRUE(engine_->StopEngine()); + EXPECT_FALSE(engine_->StopEngine()); +} + +TEST_F(FlutterTizenEngineTest, GetPluginRegistrar) { + EXPECT_TRUE(engine_ != nullptr); + EXPECT_TRUE(engine_->GetPluginRegistrar() != nullptr); +} + +// TODO +TEST_F(FlutterTizenEngineTest, DISABLED_GetTextureRegistrar) { + EXPECT_TRUE(engine_ != nullptr); + EXPECT_TRUE(engine_->GetTextureRegistrar() != nullptr); +} + +} // namespace testing +} // namespace flutter diff --git a/shell/platform/tizen/flutter_tizen_shell.cc b/shell/platform/tizen/flutter_tizen_shell.cc new file mode 100644 index 0000000000000..1c6749b3439c3 --- /dev/null +++ b/shell/platform/tizen/flutter_tizen_shell.cc @@ -0,0 +1,116 @@ +#include +#include +#include +#include +#include + +#include "flutter/shell/platform/tizen/flutter_tizen_engine.h" +#include "flutter/shell/platform/tizen/public/flutter_tizen.h" + +extern int gApp_width; +extern int gApp_height; + +std::string TPK_ROOT_PATH = "/tpkroot"; +std::string LIB_PATH = "/lib"; +std::string RES_PATH = "/res"; + +class FlutterApp { + public: + explicit FlutterApp() {} + virtual ~FlutterApp() {} + + bool OnCreate() { + printf("Launching a Flutter application...\n"); + std::string assets_path; + std::string icu_data_path; + std::string aot_lib_path; + FlutterDesktopEngineProperties engine_prop = {}; + std::vector switches; + + std::string tpk_root; + if (app_path_.empty()) { + char path[256]; + getcwd(path, sizeof(path)); + tpk_root = path + std::string("/tpkroot"); + } else { + tpk_root = app_path_; + } + + assets_path = tpk_root + "/res/flutter_assets"; + icu_data_path = tpk_root + "/res/icudtl.dat"; + aot_lib_path = tpk_root + "/lib/libapp.so"; + + switches.push_back("--disable-observatory"); + switches.push_back("--verbose-logging"); + switches.push_back("--enable-dart-profiling"); + switches.push_back("--enable-checked-mode"); + + engine_prop.assets_path = assets_path.c_str(); + engine_prop.icu_data_path = icu_data_path.c_str(); + engine_prop.aot_library_path = aot_lib_path.c_str(); + engine_prop.switches = switches.data(); + engine_prop.switches_count = switches.size(); + engine_ = FlutterDesktopRunEngine(engine_prop, true); + + if (!engine_) { + printf("Could not launch a Flutter application.\n"); + return false; + } + // RegisterPlugins(this); + return true; + } + + void OnTerminate() { + printf("Shutting down the application..."); + + FlutterDesktopShutdownEngine(engine_); + engine_ = nullptr; + + ecore_shutdown(); + } + + int Run(int argc, char** argv) { + ecore_init(); + elm_init(0, 0); + elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); + elm_config_accel_preference_set("opengl"); + + for (int i = 1; i < argc; i++) { + if (strstr(argv[i], "--width=") == argv[i]) { + gApp_width = std::atoi(argv[i] + strlen("--width=")); + } else if (strstr(argv[i], "--height=") == argv[i]) { + gApp_height = std::atoi(argv[i] + strlen("--height=")); + } else if (strstr(argv[i], "--tpkroot=") == argv[i]) { + app_path_ = argv[i] + strlen("--tpkroot="); + } + } + + ecore_idler_add( + [](void* data) -> Eina_Bool { + FlutterApp* app = (FlutterApp*)data; + app->OnCreate(); + return ECORE_CALLBACK_CANCEL; + }, + this); + ecore_main_loop_begin(); + OnTerminate(); + return 0; + } + + FlutterDesktopPluginRegistrarRef GetRegistrarForPlugin( + const std::string& plugin_name) { + if (engine_) { + return FlutterDesktopGetPluginRegistrar(engine_, plugin_name.c_str()); + } + return nullptr; + } + + private: + std::string app_path_ = {}; + FlutterDesktopEngineRef engine_ = nullptr; +}; + +int main(int argc, char* argv[]) { + auto app = new FlutterApp(); + return app->Run(argc, argv); +} diff --git a/shell/platform/tizen/flutter_tizen_texture_registrar.cc b/shell/platform/tizen/flutter_tizen_texture_registrar.cc index c7620ed0465f2..e84cd4d68a49d 100644 --- a/shell/platform/tizen/flutter_tizen_texture_registrar.cc +++ b/shell/platform/tizen/flutter_tizen_texture_registrar.cc @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/shell/platform/tizen/flutter_tizen_texture_registrar.h" +#include "flutter_tizen_texture_registrar.h" #include #include +#ifndef __X64_SHELL__ #include "flutter/shell/platform/tizen/external_texture_pixel_gl.h" #include "flutter/shell/platform/tizen/external_texture_surface_gl.h" +#endif #include "flutter/shell/platform/tizen/flutter_tizen_engine.h" #include "flutter/shell/platform/tizen/tizen_log.h" @@ -88,6 +90,10 @@ bool FlutterTizenTextureRegistrar::PopulateTexture( std::unique_ptr FlutterTizenTextureRegistrar::CreateExternalTexture( const FlutterDesktopTextureInfo* texture_info) { +#ifdef __X64_SHELL__ + FT_UNIMPLEMENTED(); + return nullptr; +#else switch (texture_info->type) { case kFlutterDesktopPixelBufferTexture: return std::make_unique( @@ -104,6 +110,7 @@ FlutterTizenTextureRegistrar::CreateExternalTexture( FT_LOGE("Invalid texture type."); return nullptr; } +#endif } } // namespace flutter diff --git a/shell/platform/tizen/key_event_handler.cc b/shell/platform/tizen/key_event_handler.cc index 820a85477a303..2567eba300fbd 100644 --- a/shell/platform/tizen/key_event_handler.cc +++ b/shell/platform/tizen/key_event_handler.cc @@ -4,7 +4,18 @@ #include "key_event_handler.h" +#ifndef __X64_SHELL__ #include +#else + +namespace { + +void ui_app_exit(void) { + exit(0); +} + +}; // namespace +#endif #include "flutter/shell/platform/tizen/flutter_tizen_engine.h" #include "flutter/shell/platform/tizen/tizen_log.h" diff --git a/shell/platform/tizen/key_event_handler.h b/shell/platform/tizen/key_event_handler.h index 07ce8b8615770..662a9d509c4c3 100644 --- a/shell/platform/tizen/key_event_handler.h +++ b/shell/platform/tizen/key_event_handler.h @@ -5,6 +5,10 @@ #ifndef EMBEDDER_KEY_EVENT_HANDLER_H_ #define EMBEDDER_KEY_EVENT_HANDLER_H_ +#ifdef __X64_SHELL__ +#include +#endif + #include #include diff --git a/shell/platform/tizen/testing/mock_engine.cc b/shell/platform/tizen/testing/mock_engine.cc new file mode 100644 index 0000000000000..7dbe9e19d75f1 --- /dev/null +++ b/shell/platform/tizen/testing/mock_engine.cc @@ -0,0 +1,331 @@ +// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. +// Copyright 2013 The Flutter Authors. All rights reserved. + +#include + +#include "flutter/shell/platform/embedder/embedder.h" +#include "gtest/gtest.h" + +const int32_t kFlutterSemanticsCustomActionIdBatchEnd = -1; + +struct _FlutterEngine { + bool running; + FlutterPlatformMessageCallback platform_message_callback; + FlutterTaskRunnerPostTaskCallback platform_post_task_callback; + void* user_data; + + _FlutterEngine(FlutterPlatformMessageCallback platform_message_callback, + FlutterTaskRunnerPostTaskCallback platform_post_task_callback, + void* user_data) + : running(false), + platform_message_callback(platform_message_callback), + platform_post_task_callback(platform_post_task_callback), + user_data(user_data) {} +}; + +struct _FlutterPlatformMessageResponseHandle { + FlutterDataCallback data_callback; + void* user_data; + std::string channel; + bool released; + + // Constructor for a response handle generated by the engine. + explicit _FlutterPlatformMessageResponseHandle(std::string channel) + : data_callback(nullptr), + user_data(nullptr), + channel(channel), + released(false) {} + + // Constructor for a response handle generated by the shell. + _FlutterPlatformMessageResponseHandle(FlutterDataCallback data_callback, + void* user_data) + : data_callback(data_callback), user_data(user_data), released(false) {} +}; + +struct _FlutterTaskRunner { + uint64_t task; + std::string channel; + const FlutterPlatformMessageResponseHandle* response_handle; + uint8_t* message; + size_t message_size; + + _FlutterTaskRunner( + uint64_t task, + const std::string& channel, + const FlutterPlatformMessageResponseHandle* response_handle, + const uint8_t* message, + size_t message_size) + : task(task), + channel(channel), + response_handle(response_handle), + message_size(message_size) { + if (message_size > 0) { + this->message = static_cast(malloc(message_size)); + memcpy(this->message, message, message_size); + } else { + this->message = nullptr; + } + } + ~_FlutterTaskRunner() { + if (response_handle != nullptr) { + EXPECT_TRUE(response_handle->released); + delete response_handle; + } + free(message); + } +}; + +// Send a message from the engine. +static void send_message(FLUTTER_API_SYMBOL(FlutterEngine) engine, + const std::string& channel, + const uint8_t* message, + size_t message_size) { + FlutterTask task; + task.runner = + new _FlutterTaskRunner(1234, channel, nullptr, message, message_size); + task.task = task.runner->task; + engine->platform_post_task_callback(task, 0, engine->user_data); +} + +FlutterEngineResult FlutterEngineCreateAOTData( + const FlutterEngineAOTDataSource* source, + FlutterEngineAOTData* data_out) { + *data_out = nullptr; + return kSuccess; +} + +FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data) { + return kSuccess; +} + +FlutterEngineResult FlutterEngineInitialize(size_t version, + const FlutterRendererConfig* config, + const FlutterProjectArgs* args, + void* user_data, + FLUTTER_API_SYMBOL(FlutterEngine) * + engine_out) { + EXPECT_NE(config, nullptr); + + EXPECT_NE(args, nullptr); + EXPECT_NE(args->platform_message_callback, nullptr); + EXPECT_NE(args->custom_task_runners, nullptr); + EXPECT_NE(args->custom_task_runners->platform_task_runner, nullptr); + EXPECT_NE(args->custom_task_runners->platform_task_runner->post_task_callback, + nullptr); + EXPECT_NE(user_data, nullptr); + + *engine_out = new _FlutterEngine( + args->platform_message_callback, + args->custom_task_runners->platform_task_runner->post_task_callback, + user_data); + return kSuccess; +} + +FlutterEngineResult FlutterEngineRunInitialized( + FLUTTER_API_SYMBOL(FlutterEngine) engine) { + engine->running = true; + return kSuccess; +} + +FlutterEngineResult FlutterEngineRun(size_t version, + const FlutterRendererConfig* config, + const FlutterProjectArgs* args, + void* user_data, + FLUTTER_API_SYMBOL(FlutterEngine) * + engine_out) { + EXPECT_NE(config, nullptr); + EXPECT_NE(args, nullptr); + EXPECT_NE(user_data, nullptr); + EXPECT_NE(engine_out, nullptr); + + FlutterEngineResult result = + FlutterEngineInitialize(version, config, args, user_data, engine_out); + if (result != kSuccess) { + return result; + } + return FlutterEngineRunInitialized(*engine_out); +} + +FlutterEngineResult FlutterEngineShutdown(FLUTTER_API_SYMBOL(FlutterEngine) + engine) { + delete engine; + return kSuccess; +} + +FlutterEngineResult FlutterEngineDeinitialize(FLUTTER_API_SYMBOL(FlutterEngine) + engine) { + return kSuccess; +} + +FlutterEngineResult FlutterEngineSendWindowMetricsEvent( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + const FlutterWindowMetricsEvent* event) { + EXPECT_TRUE(engine->running); + return kSuccess; +} + +FlutterEngineResult FlutterEngineSendPointerEvent( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + const FlutterPointerEvent* events, + size_t events_count) { + return kSuccess; +} + +FLUTTER_EXPORT +FlutterEngineResult FlutterEngineSendPlatformMessage( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + const FlutterPlatformMessage* message) { + EXPECT_TRUE(engine->running); + return kSuccess; +} + +FlutterEngineResult FlutterPlatformMessageCreateResponseHandle( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + FlutterDataCallback data_callback, + void* user_data, + FlutterPlatformMessageResponseHandle** response_out) { + EXPECT_TRUE(engine->running); + EXPECT_NE(data_callback, nullptr); + EXPECT_NE(user_data, nullptr); + + _FlutterPlatformMessageResponseHandle* handle = + new _FlutterPlatformMessageResponseHandle(data_callback, user_data); + + *response_out = handle; + return kSuccess; +} + +FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + FlutterPlatformMessageResponseHandle* response) { + EXPECT_NE(engine, nullptr); + EXPECT_NE(response, nullptr); + + EXPECT_TRUE(engine->running); + + EXPECT_FALSE(response->released); + response->released = true; + + return kSuccess; +} + +FlutterEngineResult FlutterEngineSendPlatformMessageResponse( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + const FlutterPlatformMessageResponseHandle* handle, + const uint8_t* data, + size_t data_length) { + EXPECT_NE(engine, nullptr); + EXPECT_NE(handle, nullptr); + + EXPECT_TRUE(engine->running); + + // Send a message so the shell can check the responses received. + if (handle->channel != "test/responses") { + send_message(engine, "test/responses", data, data_length); + } + + EXPECT_FALSE(handle->released); + + delete handle; + + return kSuccess; +} + +FlutterEngineResult FlutterEngineRunTask(FLUTTER_API_SYMBOL(FlutterEngine) + engine, + const FlutterTask* task) { + EXPECT_NE(engine, nullptr); + EXPECT_NE(task, nullptr); + EXPECT_NE(task->runner, nullptr); + + FlutterTaskRunner runner = task->runner; + EXPECT_NE(runner, nullptr); + const FlutterPlatformMessageResponseHandle* response_handle = + runner->response_handle; + if (response_handle != nullptr) { + EXPECT_NE(response_handle->data_callback, nullptr); + response_handle->data_callback(runner->message, runner->message_size, + response_handle->user_data); + } else { + _FlutterPlatformMessageResponseHandle* handle = + new _FlutterPlatformMessageResponseHandle(runner->channel); + + FlutterPlatformMessage message; + message.struct_size = sizeof(FlutterPlatformMessage); + message.channel = runner->channel.c_str(); + message.message = runner->message; + message.message_size = runner->message_size; + message.response_handle = handle; + engine->platform_message_callback(&message, engine->user_data); + } + + delete runner; + + return kSuccess; +} + +bool FlutterEngineRunsAOTCompiledDartCode() { + return false; +} + +FlutterEngineResult FlutterEngineUpdateLocales(FLUTTER_API_SYMBOL(FlutterEngine) + engine, + const FlutterLocale** locales, + size_t locales_count) { + return kSuccess; +} + +FlutterEngineResult FlutterEngineUpdateSemanticsEnabled( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + bool enabled) { + return kSuccess; +} + +FlutterEngineResult FlutterEngineDispatchSemanticsAction( + FLUTTER_API_SYMBOL(FlutterEngine) engine, + uint64_t id, + FlutterSemanticsAction action, + const uint8_t* data, + size_t data_length) { + return kSuccess; +} + +uint64_t FlutterEngineGetCurrentTime() { + const auto elapsed_time = std::chrono::steady_clock::now().time_since_epoch(); + return std::chrono::duration_cast(elapsed_time) + .count(); +} + +FlutterEngineResult FlutterEngineGetProcAddresses( + FlutterEngineProcTable* table) { + if (!table) { + return kInvalidArguments; + } + + FlutterEngineProcTable empty_table = {}; + *table = empty_table; + + table->CreateAOTData = &FlutterEngineCreateAOTData; + table->CollectAOTData = &FlutterEngineCollectAOTData; + table->Run = &FlutterEngineRun; + table->Shutdown = &FlutterEngineShutdown; + table->Initialize = &FlutterEngineInitialize; + table->Deinitialize = &FlutterEngineDeinitialize; + table->RunInitialized = &FlutterEngineRunInitialized; + table->SendWindowMetricsEvent = &FlutterEngineSendWindowMetricsEvent; + table->SendPointerEvent = &FlutterEngineSendPointerEvent; + table->SendPlatformMessage = &FlutterEngineSendPlatformMessage; + table->PlatformMessageCreateResponseHandle = + &FlutterPlatformMessageCreateResponseHandle; + table->PlatformMessageReleaseResponseHandle = + &FlutterPlatformMessageReleaseResponseHandle; + table->SendPlatformMessageResponse = + &FlutterEngineSendPlatformMessageResponse; + table->RunTask = &FlutterEngineRunTask; + table->UpdateLocales = &FlutterEngineUpdateLocales; + table->UpdateSemanticsEnabled = &FlutterEngineUpdateSemanticsEnabled; + table->DispatchSemanticsAction = &FlutterEngineDispatchSemanticsAction; + table->RunsAOTCompiledDartCode = &FlutterEngineRunsAOTCompiledDartCode; + + return kSuccess; +} diff --git a/shell/platform/tizen/tizen_evas_gl_helper.h b/shell/platform/tizen/tizen_evas_gl_helper.h new file mode 100644 index 0000000000000..be5a0d84f36ca --- /dev/null +++ b/shell/platform/tizen/tizen_evas_gl_helper.h @@ -0,0 +1,687 @@ +// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file has same content as tizen's file(Evas_GL_GLES3_Helpers.h). +// https://docs.tizen.org/application/native/api/mobile/6.0/group__Evas__GL__GLES3__Helpers.html + +#ifndef EMBEDDER_TIZEN_EVAS_GL_HELPER_H_ +#define EMBEDDER_TIZEN_EVAS_GL_HELPER_H_ + +/** + * @file Evas_GL_GLES3_Helpers.h + * @defgroup Evas_GL_GLES3_Helpers Evas GL GLES3 helpers + * @ingroup Evas_GL + */ + +/** + * @brief Provides a set of helper functions and macros to use GLES 3.0 with + * @ref Evas_GL "Evas GL". + * + * This file redefines all the OpenGL-ES 2.0 and OpenGL-ES 3.0 functions as +follow: + * @code +#define glFunction __evas_gl_glapi->glFunction + * @endcode + * + * Extension functions can then be checked for existence simply by writing: + * @code +if (glExtensionFunction) + { + ... + glExtensionFunction(...); + ... + } + * @endcode + * + * When using Elementary @ref GLView, please include the header file + * @ref Elementary_GL_Helpers "Elementary_GL_Helpers.h" instead. + * + * This header file should be included when using @ref Evas_GL "Evas GL" + * directly at a low level and with an OpenGL-ES 3.0 context only. + * + * @note When this file is included, all @c glFunctions are now macros, which + * means that the @ref Evas_GL_API struct can't be used anyore. + * + * @see @ref elm_opengl_page + */ +#ifndef _EVAS_GL_GLES3_HELPERS_H +#define _EVAS_GL_GLES3_HELPERS_H + +#include + +// local convenience macros + +/** + * @addtogroup Evas_GL_GLES3_Helpers + * @{ + */ + +/** + * @brief Macro to place at the beginning of any function using GLES 3.0 APIs + * + * Normally, it is necessary to call each function using its pointer as in: + * @code +glapi->glFunction(); + * @endcode + * + * When using this macro, developers can then call all @c glFunctions without + * changing their code: + * @code +EVAS_GL_GLES3_USE(evasgl, context); // Add this at the beginning +glFunction(); // All calls 'look' normal + * @endcode + * + * @note Please use @ref ELEMENTARY_GLVIEW_USE() instead, when possible. + * @since_tizen 2.4 + */ +#define EVAS_GL_GLES3_USE(evasgl, context) \ + Evas_GL_API* __evas_gl_glapi = evas_gl_context_api_get(evasgl, context); + +/** + * @brief Macro to place at the beginning of any function using GLES 3.0 APIs + * + * This is similar to @ref EVAS_GL_GLES3_USE except that it will return from + * the function if the GL API can not be used. + * + * @note Please use @ref ELEMENTARY_GLVIEW_USE() instead, when possible. + * @since_tizen 2.4 + */ +#define EVAS_GL_GLES3_USE_OR_RETURN(evasgl, context, retval) \ + Evas_GL_API* __evas_gl_glapi = evas_gl_context_api_get(evasgl, context); \ + if (!__evas_gl_glapi) \ + return retval; + +// End of the convenience functions + +// Global convenience macros + +/** + * @brief Convenience macro to use the GL helpers in simple applications: +declare + * + * @c EVAS_GL_GLOBAL_GLES3_DECLARE should be used in a global header for the + * application. For example, in a platform-specific compatibility header file. + * + * To be used with OpenGL-ES 3.0 contexts. + * + * Example of a global header file @c main.h: + * @code +#include +// other includes... + +EVAS_GL_GLOBAL_GLES3_DECLARE() + +// ... + * @endcode + * + * @note Please use @ref ELEMENTARY_GLVIEW_USE() instead, when possible. + * + * @see @ref ELEMENTARY_GLVIEW_GLOBAL_DECLARE + * @see @ref EVAS_GL_GLOBAL_GLES3_DEFINE + * @see @ref EVAS_GL_GLOBAL_GLES3_USE + * + * @since_tizen 2.4 + */ +#define EVAS_GL_GLOBAL_GLES3_DECLARE() extern Evas_GL_API* __evas_gl_glapi; + +/** + * @brief Convenience macro to use the GL helpers in simple applications: define + * + * To be used with OpenGL-ES 3.0 contexts. + * + * Example of a file @c glview.c: + * + * @code +#include "main.h" +EVAS_GL_GLOBAL_GLES3_DEFINE() + +// ... + +static inline void +evgl_init(...) +{ + // ... + evasgl = evas_gl_new(canvas); + // ... + ctx = evas_gl_context_version_create(evasgl, NULL, EVAS_GL_GLES_3_X); + EVAS_GL_GLOBAL_GLES3_USE(evasgl, ctx); + // ... +} + +// ... + * @endcode + * + * @see @ref ELEMENTARY_GLVIEW_GLOBAL_DEFINE + * @see @ref EVAS_GL_GLOBAL_GLES3_DECLARE + * @see @ref EVAS_GL_GLOBAL_GLES3_USE + * + * @since_tizen 2.4 + */ +#define EVAS_GL_GLOBAL_GLES3_DEFINE() Evas_GL_API* __evas_gl_glapi = NULL; + +/** + * @brief Convenience macro to use the GL helpers in simple applications: use + * + * This macro will set the global variable holding the GL API so that it's + * available to the application. + * + * It should be used right after setting up the GL context object. + * + * @see @ref ELEMENTARY_GLVIEW_GLOBAL_USE + * @see @ref EVAS_GL_GLOBAL_GLES3_DECLARE + * @see @ref EVAS_GL_GLOBAL_GLES3_DEFINE + * + * @since_tizen 2.4 + */ +#define EVAS_GL_GLOBAL_GLES3_USE(evgl, ctx) \ + do { \ + __evas_gl_glapi = evas_gl_context_api_get(evgl, ctx); \ + } while (0) + +// End of the convenience functions (global) +/** @} */ + +#define glActiveTexture __evas_gl_glapi->glActiveTexture +#define glAttachShader __evas_gl_glapi->glAttachShader +#define glBindAttribLocation __evas_gl_glapi->glBindAttribLocation +#define glBindBuffer __evas_gl_glapi->glBindBuffer +#define glBindFramebuffer __evas_gl_glapi->glBindFramebuffer +#define glBindRenderbuffer __evas_gl_glapi->glBindRenderbuffer +#define glBindTexture __evas_gl_glapi->glBindTexture +#define glBlendColor __evas_gl_glapi->glBlendColor +#define glBlendEquation __evas_gl_glapi->glBlendEquation +#define glBlendEquationSeparate __evas_gl_glapi->glBlendEquationSeparate +#define glBlendFunc __evas_gl_glapi->glBlendFunc +#define glBlendFuncSeparate __evas_gl_glapi->glBlendFuncSeparate +#define glBufferData __evas_gl_glapi->glBufferData +#define glBufferSubData __evas_gl_glapi->glBufferSubData +#define glCheckFramebufferStatus __evas_gl_glapi->glCheckFramebufferStatus +#define glClear __evas_gl_glapi->glClear +#define glClearColor __evas_gl_glapi->glClearColor +#define glClearDepthf __evas_gl_glapi->glClearDepthf +#define glClearStencil __evas_gl_glapi->glClearStencil +#define glColorMask __evas_gl_glapi->glColorMask +#define glCompileShader __evas_gl_glapi->glCompileShader +#define glCompressedTexImage2D __evas_gl_glapi->glCompressedTexImage2D +#define glCompressedTexSubImage2D __evas_gl_glapi->glCompressedTexSubImage2D +#define glCopyTexImage2D __evas_gl_glapi->glCopyTexImage2D +#define glCopyTexSubImage2D __evas_gl_glapi->glCopyTexSubImage2D +#define glCreateProgram __evas_gl_glapi->glCreateProgram +#define glCreateShader __evas_gl_glapi->glCreateShader +#define glCullFace __evas_gl_glapi->glCullFace +#define glDeleteBuffers __evas_gl_glapi->glDeleteBuffers +#define glDeleteFramebuffers __evas_gl_glapi->glDeleteFramebuffers +#define glDeleteProgram __evas_gl_glapi->glDeleteProgram +#define glDeleteRenderbuffers __evas_gl_glapi->glDeleteRenderbuffers +#define glDeleteShader __evas_gl_glapi->glDeleteShader +#define glDeleteTextures __evas_gl_glapi->glDeleteTextures +#define glDepthFunc __evas_gl_glapi->glDepthFunc +#define glDepthMask __evas_gl_glapi->glDepthMask +#define glDepthRangef __evas_gl_glapi->glDepthRangef +#define glDetachShader __evas_gl_glapi->glDetachShader +#define glDisable __evas_gl_glapi->glDisable +#define glDisableVertexAttribArray __evas_gl_glapi->glDisableVertexAttribArray +#define glDrawArrays __evas_gl_glapi->glDrawArrays +#define glDrawElements __evas_gl_glapi->glDrawElements +#define glEnable __evas_gl_glapi->glEnable +#define glEnableVertexAttribArray __evas_gl_glapi->glEnableVertexAttribArray +#define glFinish __evas_gl_glapi->glFinish +#define glFlush __evas_gl_glapi->glFlush +#define glFramebufferRenderbuffer __evas_gl_glapi->glFramebufferRenderbuffer +#define glFramebufferTexture2D __evas_gl_glapi->glFramebufferTexture2D +#define glFrontFace __evas_gl_glapi->glFrontFace +#define glGenBuffers __evas_gl_glapi->glGenBuffers +#define glGenerateMipmap __evas_gl_glapi->glGenerateMipmap +#define glGenFramebuffers __evas_gl_glapi->glGenFramebuffers +#define glGenRenderbuffers __evas_gl_glapi->glGenRenderbuffers +#define glGenTextures __evas_gl_glapi->glGenTextures +#define glGetActiveAttrib __evas_gl_glapi->glGetActiveAttrib +#define glGetActiveUniform __evas_gl_glapi->glGetActiveUniform +#define glGetAttachedShaders __evas_gl_glapi->glGetAttachedShaders +#define glGetAttribLocation __evas_gl_glapi->glGetAttribLocation +#define glGetBooleanv __evas_gl_glapi->glGetBooleanv +#define glGetBufferParameteriv __evas_gl_glapi->glGetBufferParameteriv +#define glGetError __evas_gl_glapi->glGetError +#define glGetFloatv __evas_gl_glapi->glGetFloatv +#define glGetFramebufferAttachmentParameteriv \ + __evas_gl_glapi->glGetFramebufferAttachmentParameteriv +#define glGetIntegerv __evas_gl_glapi->glGetIntegerv +#define glGetProgramiv __evas_gl_glapi->glGetProgramiv +#define glGetProgramInfoLog __evas_gl_glapi->glGetProgramInfoLog +#define glGetRenderbufferParameteriv \ + __evas_gl_glapi->glGetRenderbufferParameteriv +#define glGetShaderiv __evas_gl_glapi->glGetShaderiv +#define glGetShaderInfoLog __evas_gl_glapi->glGetShaderInfoLog +#define glGetShaderPrecisionFormat __evas_gl_glapi->glGetShaderPrecisionFormat +#define glGetShaderSource __evas_gl_glapi->glGetShaderSource +#define glGetString __evas_gl_glapi->glGetString +#define glGetTexParameterfv __evas_gl_glapi->glGetTexParameterfv +#define glGetTexParameteriv __evas_gl_glapi->glGetTexParameteriv +#define glGetUniformfv __evas_gl_glapi->glGetUniformfv +#define glGetUniformiv __evas_gl_glapi->glGetUniformiv +#define glGetUniformLocation __evas_gl_glapi->glGetUniformLocation +#define glGetVertexAttribfv __evas_gl_glapi->glGetVertexAttribfv +#define glGetVertexAttribiv __evas_gl_glapi->glGetVertexAttribiv +#define glGetVertexAttribPointerv __evas_gl_glapi->glGetVertexAttribPointerv +#define glHint __evas_gl_glapi->glHint +#define glIsBuffer __evas_gl_glapi->glIsBuffer +#define glIsEnabled __evas_gl_glapi->glIsEnabled +#define glIsFramebuffer __evas_gl_glapi->glIsFramebuffer +#define glIsProgram __evas_gl_glapi->glIsProgram +#define glIsRenderbuffer __evas_gl_glapi->glIsRenderbuffer +#define glIsShader __evas_gl_glapi->glIsShader +#define glIsTexture __evas_gl_glapi->glIsTexture +#define glLineWidth __evas_gl_glapi->glLineWidth +#define glLinkProgram __evas_gl_glapi->glLinkProgram +#define glPixelStorei __evas_gl_glapi->glPixelStorei +#define glPolygonOffset __evas_gl_glapi->glPolygonOffset +#define glReadPixels __evas_gl_glapi->glReadPixels +#define glReleaseShaderCompiler __evas_gl_glapi->glReleaseShaderCompiler +#define glRenderbufferStorage __evas_gl_glapi->glRenderbufferStorage +#define glSampleCoverage __evas_gl_glapi->glSampleCoverage +#define glScissor __evas_gl_glapi->glScissor +#define glShaderBinary __evas_gl_glapi->glShaderBinary +#define glShaderSource __evas_gl_glapi->glShaderSource +#define glStencilFunc __evas_gl_glapi->glStencilFunc +#define glStencilFuncSeparate __evas_gl_glapi->glStencilFuncSeparate +#define glStencilMask __evas_gl_glapi->glStencilMask +#define glStencilMaskSeparate __evas_gl_glapi->glStencilMaskSeparate +#define glStencilOp __evas_gl_glapi->glStencilOp +#define glStencilOpSeparate __evas_gl_glapi->glStencilOpSeparate +#define glTexImage2D __evas_gl_glapi->glTexImage2D +#define glTexParameterf __evas_gl_glapi->glTexParameterf +#define glTexParameterfv __evas_gl_glapi->glTexParameterfv +#define glTexParameteri __evas_gl_glapi->glTexParameteri +#define glTexParameteriv __evas_gl_glapi->glTexParameteriv +#define glTexSubImage2D __evas_gl_glapi->glTexSubImage2D +#define glUniform1f __evas_gl_glapi->glUniform1f +#define glUniform1fv __evas_gl_glapi->glUniform1fv +#define glUniform1i __evas_gl_glapi->glUniform1i +#define glUniform1iv __evas_gl_glapi->glUniform1iv +#define glUniform2f __evas_gl_glapi->glUniform2f +#define glUniform2fv __evas_gl_glapi->glUniform2fv +#define glUniform2i __evas_gl_glapi->glUniform2i +#define glUniform2iv __evas_gl_glapi->glUniform2iv +#define glUniform3f __evas_gl_glapi->glUniform3f +#define glUniform3fv __evas_gl_glapi->glUniform3fv +#define glUniform3i __evas_gl_glapi->glUniform3i +#define glUniform3iv __evas_gl_glapi->glUniform3iv +#define glUniform4f __evas_gl_glapi->glUniform4f +#define glUniform4fv __evas_gl_glapi->glUniform4fv +#define glUniform4i __evas_gl_glapi->glUniform4i +#define glUniform4iv __evas_gl_glapi->glUniform4iv +#define glUniformMatrix2fv __evas_gl_glapi->glUniformMatrix2fv +#define glUniformMatrix3fv __evas_gl_glapi->glUniformMatrix3fv +#define glUniformMatrix4fv __evas_gl_glapi->glUniformMatrix4fv +#define glUseProgram __evas_gl_glapi->glUseProgram +#define glValidateProgram __evas_gl_glapi->glValidateProgram +#define glVertexAttrib1f __evas_gl_glapi->glVertexAttrib1f +#define glVertexAttrib1fv __evas_gl_glapi->glVertexAttrib1fv +#define glVertexAttrib2f __evas_gl_glapi->glVertexAttrib2f +#define glVertexAttrib2fv __evas_gl_glapi->glVertexAttrib2fv +#define glVertexAttrib3f __evas_gl_glapi->glVertexAttrib3f +#define glVertexAttrib3fv __evas_gl_glapi->glVertexAttrib3fv +#define glVertexAttrib4f __evas_gl_glapi->glVertexAttrib4f +#define glVertexAttrib4fv __evas_gl_glapi->glVertexAttrib4fv +#define glVertexAttribPointer __evas_gl_glapi->glVertexAttribPointer +#define glViewport __evas_gl_glapi->glViewport + +// GLES 2.0 extensions +#define glGetProgramBinaryOES __evas_gl_glapi->glGetProgramBinaryOES +#define glProgramBinaryOES __evas_gl_glapi->glProgramBinaryOES +#define glMapBufferOES __evas_gl_glapi->glMapBufferOES +#define glUnmapBufferOES __evas_gl_glapi->glUnmapBufferOES +#define glGetBufferPointervOES __evas_gl_glapi->glGetBufferPointervOES +#define glTexImage3DOES __evas_gl_glapi->glTexImage3DOES +#define glTexSubImage3DOES __evas_gl_glapi->glTexSubImage3DOES +#define glCopyTexSubImage3DOES __evas_gl_glapi->glCopyTexSubImage3DOES +#define glCompressedTexImage3DOES __evas_gl_glapi->glCompressedTexImage3DOES +#define glCompressedTexSubImage3DOES \ + __evas_gl_glapi->glCompressedTexSubImage3DOES +#define glFramebufferTexture3DOES __evas_gl_glapi->glFramebufferTexture3DOES +#define glBindVertexArrayOES __evas_gl_glapi->glBindVertexArrayOES +#define glDeleteVertexArraysOES __evas_gl_glapi->glDeleteVertexArraysOES +#define glGenVertexArraysOES __evas_gl_glapi->glGenVertexArraysOES +#define glIsVertexArrayOES __evas_gl_glapi->glIsVertexArrayOES +#define glGetPerfMonitorGroupsAMD __evas_gl_glapi->glGetPerfMonitorGroupsAMD +#define glGetPerfMonitorCountersAMD __evas_gl_glapi->glGetPerfMonitorCountersAMD +#define glGetPerfMonitorGroupStringAMD \ + __evas_gl_glapi->glGetPerfMonitorGroupStringAMD +#define glGetPerfMonitorCounterStringAMD \ + __evas_gl_glapi->glGetPerfMonitorCounterStringAMD +#define glGetPerfMonitorCounterInfoAMD \ + __evas_gl_glapi->glGetPerfMonitorCounterInfoAMD +#define glGenPerfMonitorsAMD __evas_gl_glapi->glGenPerfMonitorsAMD +#define glDeletePerfMonitorsAMD __evas_gl_glapi->glDeletePerfMonitorsAMD +#define glSelectPerfMonitorCountersAMD \ + __evas_gl_glapi->glSelectPerfMonitorCountersAMD +#define glBeginPerfMonitorAMD __evas_gl_glapi->glBeginPerfMonitorAMD +#define glEndPerfMonitorAMD __evas_gl_glapi->glEndPerfMonitorAMD +#define glGetPerfMonitorCounterDataAMD \ + __evas_gl_glapi->glGetPerfMonitorCounterDataAMD +#define glCopyTextureLevelsAPPLE __evas_gl_glapi->glCopyTextureLevelsAPPLE +#define glRenderbufferStorageMultisampleAPPLE \ + __evas_gl_glapi->glRenderbufferStorageMultisampleAPPLE +#define glResolveMultisampleFramebufferAPPLE \ + __evas_gl_glapi->glResolveMultisampleFramebufferAPPLE +#define glFenceSyncAPPLE __evas_gl_glapi->glFenceSyncAPPLE +#define glIsSyncAPPLE __evas_gl_glapi->glIsSyncAPPLE +#define glDeleteSyncAPPLE __evas_gl_glapi->glDeleteSyncAPPLE +#define glClientWaitSyncAPPLE __evas_gl_glapi->glClientWaitSyncAPPLE +#define glWaitSyncAPPLE __evas_gl_glapi->glWaitSyncAPPLE +#define glGetInteger64vAPPLE __evas_gl_glapi->glGetInteger64vAPPLE +#define glGetSyncivAPPLE __evas_gl_glapi->glGetSyncivAPPLE +#define glDiscardFramebufferEXT __evas_gl_glapi->glDiscardFramebufferEXT +#define glMapBufferRangeEXT __evas_gl_glapi->glMapBufferRangeEXT +#define glFlushMappedBufferRangeEXT __evas_gl_glapi->glFlushMappedBufferRangeEXT +#define glMultiDrawArraysEXT __evas_gl_glapi->glMultiDrawArraysEXT +#define glMultiDrawElementsEXT __evas_gl_glapi->glMultiDrawElementsEXT +#define glRenderbufferStorageMultisampleEXT \ + __evas_gl_glapi->glRenderbufferStorageMultisampleEXT +#define glFramebufferTexture2DMultisampleEXT \ + __evas_gl_glapi->glFramebufferTexture2DMultisampleEXT +#define glGetGraphicsResetStatusEXT __evas_gl_glapi->glGetGraphicsResetStatusEXT +#define glReadnPixelsEXT __evas_gl_glapi->glReadnPixelsEXT +#define glGetnUniformfvEXT __evas_gl_glapi->glGetnUniformfvEXT +#define glGetnUniformivEXT __evas_gl_glapi->glGetnUniformivEXT +#define glTexStorage1DEXT __evas_gl_glapi->glTexStorage1DEXT +#define glTexStorage2DEXT __evas_gl_glapi->glTexStorage2DEXT +#define glTexStorage3DEXT __evas_gl_glapi->glTexStorage3DEXT +#define glTextureStorage1DEXT __evas_gl_glapi->glTextureStorage1DEXT +#define glTextureStorage2DEXT __evas_gl_glapi->glTextureStorage2DEXT +#define glTextureStorage3DEXT __evas_gl_glapi->glTextureStorage3DEXT +#define glRenderbufferStorageMultisampleIMG \ + __evas_gl_glapi->glRenderbufferStorageMultisampleIMG +#define glFramebufferTexture2DMultisampleIMG \ + __evas_gl_glapi->glFramebufferTexture2DMultisampleIMG +#define glDeleteFencesNV __evas_gl_glapi->glDeleteFencesNV +#define glGenFencesNV __evas_gl_glapi->glGenFencesNV +#define glIsFenceNV __evas_gl_glapi->glIsFenceNV +#define glTestFenceNV __evas_gl_glapi->glTestFenceNV +#define glGetFenceivNV __evas_gl_glapi->glGetFenceivNV +#define glFinishFenceNV __evas_gl_glapi->glFinishFenceNV +#define glSetFenceNV __evas_gl_glapi->glSetFenceNV +#define glGetDriverControlsQCOM __evas_gl_glapi->glGetDriverControlsQCOM +#define glGetDriverControlStringQCOM \ + __evas_gl_glapi->glGetDriverControlStringQCOM +#define glEnableDriverControlQCOM __evas_gl_glapi->glEnableDriverControlQCOM +#define glDisableDriverControlQCOM __evas_gl_glapi->glDisableDriverControlQCOM +#define glExtGetTexturesQCOM __evas_gl_glapi->glExtGetTexturesQCOM +#define glExtGetBuffersQCOM __evas_gl_glapi->glExtGetBuffersQCOM +#define glExtGetRenderbuffersQCOM __evas_gl_glapi->glExtGetRenderbuffersQCOM +#define glExtGetFramebuffersQCOM __evas_gl_glapi->glExtGetFramebuffersQCOM +#define glExtGetTexLevelParameterivQCOM \ + __evas_gl_glapi->glExtGetTexLevelParameterivQCOM +#define glExtTexObjectStateOverrideiQCOM \ + __evas_gl_glapi->glExtTexObjectStateOverrideiQCOM +#define glExtGetTexSubImageQCOM __evas_gl_glapi->glExtGetTexSubImageQCOM +#define glExtGetBufferPointervQCOM __evas_gl_glapi->glExtGetBufferPointervQCOM +#define glExtGetShadersQCOM __evas_gl_glapi->glExtGetShadersQCOM +#define glExtGetProgramsQCOM __evas_gl_glapi->glExtGetProgramsQCOM +#define glExtIsProgramBinaryQCOM __evas_gl_glapi->glExtIsProgramBinaryQCOM +#define glExtGetProgramBinarySourceQCOM \ + __evas_gl_glapi->glExtGetProgramBinarySourceQCOM +#define glStartTilingQCOM __evas_gl_glapi->glStartTilingQCOM +#define glEndTilingQCOM __evas_gl_glapi->glEndTilingQCOM + +// glEvasGL functions +#define glEvasGLImageTargetTexture2DOES \ + __evas_gl_glapi->glEvasGLImageTargetTexture2DOES +#define glEvasGLImageTargetRenderbufferStorageOES \ + __evas_gl_glapi->glEvasGLImageTargetRenderbufferStorageOES + +// Evas GL glue layer +#define evasglCreateImage __evas_gl_glapi->evasglCreateImage +#define evasglCreateImageForContext __evas_gl_glapi->evasglCreateImageForContext +#define evasglDestroyImage __evas_gl_glapi->evasglDestroyImage +#define evasglCreateSync __evas_gl_glapi->evasglCreateSync +#define evasglDestroySync __evas_gl_glapi->evasglDestroySync +#define evasglClientWaitSync __evas_gl_glapi->evasglClientWaitSync +#define evasglSignalSync __evas_gl_glapi->evasglSignalSync +#define evasglGetSyncAttrib __evas_gl_glapi->evasglGetSyncAttrib +#define evasglWaitSync __evas_gl_glapi->evasglWaitSync + +// GLES 3.0 functions +#define glBeginQuery __evas_gl_glapi->glBeginQuery +#define glBeginTransformFeedback __evas_gl_glapi->glBeginTransformFeedback +#define glBindBufferBase __evas_gl_glapi->glBindBufferBase +#define glBindBufferRange __evas_gl_glapi->glBindBufferRange +#define glBindSampler __evas_gl_glapi->glBindSampler +#define glBindTransformFeedback __evas_gl_glapi->glBindTransformFeedback +#define glBindVertexArray __evas_gl_glapi->glBindVertexArray +#define glBlitFramebuffer __evas_gl_glapi->glBlitFramebuffer +#define glClearBufferfi __evas_gl_glapi->glClearBufferfi +#define glClearBufferfv __evas_gl_glapi->glClearBufferfv +#define glClearBufferiv __evas_gl_glapi->glClearBufferiv +#define glClearBufferuiv __evas_gl_glapi->glClearBufferuiv +#define glClientWaitSync __evas_gl_glapi->glClientWaitSync +#define glCompressedTexImage3D __evas_gl_glapi->glCompressedTexImage3D +#define glCompressedTexSubImage3D __evas_gl_glapi->glCompressedTexSubImage3D +#define glCopyBufferSubData __evas_gl_glapi->glCopyBufferSubData +#define glCopyTexSubImage3D __evas_gl_glapi->glCopyTexSubImage3D +#define glDeleteQueries __evas_gl_glapi->glDeleteQueries +#define glDeleteSamplers __evas_gl_glapi->glDeleteSamplers +#define glDeleteSync __evas_gl_glapi->glDeleteSync +#define glDeleteTransformFeedbacks __evas_gl_glapi->glDeleteTransformFeedbacks +#define glDeleteVertexArrays __evas_gl_glapi->glDeleteVertexArrays +#define glDrawArraysInstanced __evas_gl_glapi->glDrawArraysInstanced +#define glDrawBuffers __evas_gl_glapi->glDrawBuffers +#define glDrawElementsInstanced __evas_gl_glapi->glDrawElementsInstanced +#define glDrawRangeElements __evas_gl_glapi->glDrawRangeElements +#define glEndQuery __evas_gl_glapi->glEndQuery +#define glEndTransformFeedback __evas_gl_glapi->glEndTransformFeedback +#define glFenceSync __evas_gl_glapi->glFenceSync +#define glFlushMappedBufferRange __evas_gl_glapi->glFlushMappedBufferRange +#define glFramebufferTextureLayer __evas_gl_glapi->glFramebufferTextureLayer +#define glGenQueries __evas_gl_glapi->glGenQueries +#define glGenSamplers __evas_gl_glapi->glGenSamplers +#define glGenTransformFeedbacks __evas_gl_glapi->glGenTransformFeedbacks +#define glGenVertexArrays __evas_gl_glapi->glGenVertexArrays +#define glGetActiveUniformBlockiv __evas_gl_glapi->glGetActiveUniformBlockiv +#define glGetActiveUniformBlockName __evas_gl_glapi->glGetActiveUniformBlockName +#define glGetActiveUniformsiv __evas_gl_glapi->glGetActiveUniformsiv +#define glGetBufferParameteri64v __evas_gl_glapi->glGetBufferParameteri64v +#define glGetBufferPointerv __evas_gl_glapi->glGetBufferPointerv +#define glGetFragDataLocation __evas_gl_glapi->glGetFragDataLocation +#define glGetInteger64i_v __evas_gl_glapi->glGetInteger64i_v +#define glGetInteger64v __evas_gl_glapi->glGetInteger64v +#define glGetIntegeri_v __evas_gl_glapi->glGetIntegeri_v +#define glGetInternalformativ __evas_gl_glapi->glGetInternalformativ +#define glGetProgramBinary __evas_gl_glapi->glGetProgramBinary +#define glGetQueryiv __evas_gl_glapi->glGetQueryiv +#define glGetQueryObjectuiv __evas_gl_glapi->glGetQueryObjectuiv +#define glGetSamplerParameterfv __evas_gl_glapi->glGetSamplerParameterfv +#define glGetSamplerParameteriv __evas_gl_glapi->glGetSamplerParameteriv +#define glGetStringi __evas_gl_glapi->glGetStringi +#define glGetSynciv __evas_gl_glapi->glGetSynciv +#define glGetTransformFeedbackVarying \ + __evas_gl_glapi->glGetTransformFeedbackVarying +#define glGetUniformBlockIndex __evas_gl_glapi->glGetUniformBlockIndex +#define glGetUniformIndices __evas_gl_glapi->glGetUniformIndices +#define glGetUniformuiv __evas_gl_glapi->glGetUniformuiv +#define glGetVertexAttribIiv __evas_gl_glapi->glGetVertexAttribIiv +#define glGetVertexAttribIuiv __evas_gl_glapi->glGetVertexAttribIuiv +#define glInvalidateFramebuffer __evas_gl_glapi->glInvalidateFramebuffer +#define glInvalidateSubFramebuffer __evas_gl_glapi->glInvalidateSubFramebuffer +#define glIsQuery __evas_gl_glapi->glIsQuery +#define glIsSampler __evas_gl_glapi->glIsSampler +#define glIsSync __evas_gl_glapi->glIsSync +#define glIsTransformFeedback __evas_gl_glapi->glIsTransformFeedback +#define glIsVertexArray __evas_gl_glapi->glIsVertexArray +#define glMapBufferRange __evas_gl_glapi->glMapBufferRange +#define glPauseTransformFeedback __evas_gl_glapi->glPauseTransformFeedback +#define glProgramBinary __evas_gl_glapi->glProgramBinary +#define glProgramParameteri __evas_gl_glapi->glProgramParameteri +#define glReadBuffer __evas_gl_glapi->glReadBuffer +#define glRenderbufferStorageMultisample \ + __evas_gl_glapi->glRenderbufferStorageMultisample +#define glResumeTransformFeedback __evas_gl_glapi->glResumeTransformFeedback +#define glSamplerParameterf __evas_gl_glapi->glSamplerParameterf +#define glSamplerParameterfv __evas_gl_glapi->glSamplerParameterfv +#define glSamplerParameteri __evas_gl_glapi->glSamplerParameteri +#define glSamplerParameteriv __evas_gl_glapi->glSamplerParameteriv +#define glTexImage3D __evas_gl_glapi->glTexImage3D +#define glTexStorage2D __evas_gl_glapi->glTexStorage2D +#define glTexStorage3D __evas_gl_glapi->glTexStorage3D +#define glTexSubImage3D __evas_gl_glapi->glTexSubImage3D +#define glTransformFeedbackVaryings __evas_gl_glapi->glTransformFeedbackVaryings +#define glUniform1ui __evas_gl_glapi->glUniform1ui +#define glUniform1uiv __evas_gl_glapi->glUniform1uiv +#define glUniform2ui __evas_gl_glapi->glUniform2ui +#define glUniform2uiv __evas_gl_glapi->glUniform2uiv +#define glUniform3ui __evas_gl_glapi->glUniform3ui +#define glUniform3uiv __evas_gl_glapi->glUniform3uiv +#define glUniform4ui __evas_gl_glapi->glUniform4ui +#define glUniform4uiv __evas_gl_glapi->glUniform4uiv +#define glUniformBlockBinding __evas_gl_glapi->glUniformBlockBinding +#define glUniformMatrix2x3fv __evas_gl_glapi->glUniformMatrix2x3fv +#define glUniformMatrix3x2fv __evas_gl_glapi->glUniformMatrix3x2fv +#define glUniformMatrix2x4fv __evas_gl_glapi->glUniformMatrix2x4fv +#define glUniformMatrix4x2fv __evas_gl_glapi->glUniformMatrix4x2fv +#define glUniformMatrix3x4fv __evas_gl_glapi->glUniformMatrix3x4fv +#define glUniformMatrix4x3fv __evas_gl_glapi->glUniformMatrix4x3fv +#define glUnmapBuffer __evas_gl_glapi->glUnmapBuffer +#define glVertexAttribDivisor __evas_gl_glapi->glVertexAttribDivisor +#define glVertexAttribI4i __evas_gl_glapi->glVertexAttribI4i +#define glVertexAttribI4iv __evas_gl_glapi->glVertexAttribI4iv +#define glVertexAttribI4ui __evas_gl_glapi->glVertexAttribI4ui +#define glVertexAttribI4uiv __evas_gl_glapi->glVertexAttribI4uiv +#define glVertexAttribIPointer __evas_gl_glapi->glVertexAttribIPointer +#define glWaitSync __evas_gl_glapi->glWaitSync + +// GLES 3.1 +#define glDispatchCompute __evas_gl_glapi->glDispatchCompute +#define glDispatchComputeIndirect __evas_gl_glapi->glDispatchComputeIndirect +#define glDrawArraysIndirect __evas_gl_glapi->glDrawArraysIndirect +#define glDrawElementsIndirect __evas_gl_glapi->glDrawElementsIndirect +#define glFramebufferParameteri __evas_gl_glapi->glFramebufferParameteri +#define glGetFramebufferParameteriv __evas_gl_glapi->glGetFramebufferParameteriv +#define glGetProgramInterfaceiv __evas_gl_glapi->glGetProgramInterfaceiv +#define glGetProgramResourceIndex __evas_gl_glapi->glGetProgramResourceIndex +#define glGetProgramResourceName __evas_gl_glapi->glGetProgramResourceName +#define glGetProgramResourceiv __evas_gl_glapi->glGetProgramResourceiv +#define glGetProgramResourceLocation \ + __evas_gl_glapi->glGetProgramResourceLocation +#define glUseProgramStages __evas_gl_glapi->glUseProgramStages +#define glActiveShaderProgram __evas_gl_glapi->glActiveShaderProgram +#define glCreateShaderProgramv __evas_gl_glapi->glCreateShaderProgramv +#define glBindProgramPipeline __evas_gl_glapi->glBindProgramPipeline +#define glDeleteProgramPipelines __evas_gl_glapi->glDeleteProgramPipelines +#define glGenProgramPipelines __evas_gl_glapi->glGenProgramPipelines +#define glIsProgramPipeline __evas_gl_glapi->glIsProgramPipeline +#define glGetProgramPipelineiv __evas_gl_glapi->glGetProgramPipelineiv +#define glProgramUniform1i __evas_gl_glapi->glProgramUniform1i +#define glProgramUniform2i __evas_gl_glapi->glProgramUniform2i +#define glProgramUniform3i __evas_gl_glapi->glProgramUniform3i +#define glProgramUniform4i __evas_gl_glapi->glProgramUniform4i +#define glProgramUniform1ui __evas_gl_glapi->glProgramUniform1ui +#define glProgramUniform2ui __evas_gl_glapi->glProgramUniform2ui +#define glProgramUniform3ui __evas_gl_glapi->glProgramUniform3ui +#define glProgramUniform4ui __evas_gl_glapi->glProgramUniform4ui +#define glProgramUniform1f __evas_gl_glapi->glProgramUniform1f +#define glProgramUniform2f __evas_gl_glapi->glProgramUniform2f +#define glProgramUniform3f __evas_gl_glapi->glProgramUniform3f +#define glProgramUniform4f __evas_gl_glapi->glProgramUniform4f +#define glProgramUniform1iv __evas_gl_glapi->glProgramUniform1iv +#define glProgramUniform2iv __evas_gl_glapi->glProgramUniform2iv +#define glProgramUniform3iv __evas_gl_glapi->glProgramUniform3iv +#define glProgramUniform4iv __evas_gl_glapi->glProgramUniform4iv +#define glProgramUniform1uiv __evas_gl_glapi->glProgramUniform1uiv +#define glProgramUniform2uiv __evas_gl_glapi->glProgramUniform2uiv +#define glProgramUniform3uiv __evas_gl_glapi->glProgramUniform3uiv +#define glProgramUniform4uiv __evas_gl_glapi->glProgramUniform4uiv +#define glProgramUniform1fv __evas_gl_glapi->glProgramUniform1fv +#define glProgramUniform2fv __evas_gl_glapi->glProgramUniform2fv +#define glProgramUniform3fv __evas_gl_glapi->glProgramUniform3fv +#define glProgramUniform4fv __evas_gl_glapi->glProgramUniform4fv +#define glProgramUniformMatrix2fv __evas_gl_glapi->glProgramUniformMatrix2fv +#define glProgramUniformMatrix3fv __evas_gl_glapi->glProgramUniformMatrix3fv +#define glProgramUniformMatrix4fv __evas_gl_glapi->glProgramUniformMatrix4fv +#define glProgramUniformMatrix2x3fv __evas_gl_glapi->glProgramUniformMatrix2x3fv +#define glProgramUniformMatrix3x2fv __evas_gl_glapi->glProgramUniformMatrix3x2fv +#define glProgramUniformMatrix2x4fv __evas_gl_glapi->glProgramUniformMatrix2x4fv +#define glProgramUniformMatrix4x2fv __evas_gl_glapi->glProgramUniformMatrix4x2fv +#define glProgramUniformMatrix3x4fv __evas_gl_glapi->glProgramUniformMatrix3x4fv +#define glProgramUniformMatrix4x3fv __evas_gl_glapi->glProgramUniformMatrix4x3fv +#define glValidateProgramPipeline __evas_gl_glapi->glValidateProgramPipeline +#define glGetProgramPipelineInfoLog __evas_gl_glapi->glGetProgramPipelineInfoLog +#define glBindImageTexture __evas_gl_glapi->glBindImageTexture +#define glGetBooleani_v __evas_gl_glapi->glGetBooleani_v +#define glMemoryBarrier __evas_gl_glapi->glMemoryBarrier +#define glMemoryBarrierByRegion __evas_gl_glapi->glMemoryBarrierByRegion +#define glTexStorage2DMultisample __evas_gl_glapi->glTexStorage2DMultisample +#define glGetMultisamplefv __evas_gl_glapi->glGetMultisamplefv +#define glSampleMaski __evas_gl_glapi->glSampleMaski +#define glGetTexLevelParameteriv __evas_gl_glapi->glGetTexLevelParameteriv +#define glGetTexLevelParameterfv __evas_gl_glapi->glGetTexLevelParameterfv +#define glBindVertexBuffer __evas_gl_glapi->glBindVertexBuffer +#define glVertexAttribFormat __evas_gl_glapi->glVertexAttribFormat +#define glVertexAttribIFormat __evas_gl_glapi->glVertexAttribIFormat +#define glVertexAttribBinding __evas_gl_glapi->glVertexAttribBinding +#define glVertexBindingDivisor __evas_gl_glapi->glVertexBindingDivisor + +// GLES 3.2 +#define glBlendBarrier __evas_gl_glapi->glBlendBarrier +#define glCopyImageSubData __evas_gl_glapi->glCopyImageSubData +#define glDebugMessageControl __evas_gl_glapi->glDebugMessageControl +#define glDebugMessageInsert __evas_gl_glapi->glDebugMessageInsert +#define glDebugMessageCallback __evas_gl_glapi->glDebugMessageCallback +#define glGetDebugMessageLog __evas_gl_glapi->glGetDebugMessageLog +#define glPushDebugGroup __evas_gl_glapi->glPushDebugGroup +#define glPopDebugGroup __evas_gl_glapi->glPopDebugGroup +#define glObjectLabel __evas_gl_glapi->glObjectLabel +#define glGetObjectLabel __evas_gl_glapi->glGetObjectLabel +#define glObjectPtrLabel __evas_gl_glapi->glObjectPtrLabel +#define glGetObjectPtrLabel __evas_gl_glapi->glGetObjectPtrLabel +#define glGetPointerv __evas_gl_glapi->glGetPointerv +#define glEnablei __evas_gl_glapi->glEnablei +#define glDisablei __evas_gl_glapi->glDisablei +#define glBlendEquationi __evas_gl_glapi->glBlendEquationi +#define glBlendEquationSeparatei __evas_gl_glapi->glBlendEquationSeparatei +#define glBlendFunci __evas_gl_glapi->glBlendFunci +#define glBlendFuncSeparatei __evas_gl_glapi->glBlendFuncSeparatei +#define glColorMaski __evas_gl_glapi->glColorMaski +#define glIsEnabledi __evas_gl_glapi->glIsEnabledi +#define glDrawElementsBaseVertex __evas_gl_glapi->glDrawElementsBaseVertex +#define glDrawRangeElementsBaseVertex \ + __evas_gl_glapi->glDrawRangeElementsBaseVertex +#define glDrawElementsInstancedBaseVertex \ + __evas_gl_glapi->glDrawElementsInstancedBaseVertex +#define glFramebufferTexture __evas_gl_glapi->glFramebufferTexture +#define glPrimitiveBoundingBox __evas_gl_glapi->glPrimitiveBoundingBox +#define glGetGraphicsResetStatus __evas_gl_glapi->glGetGraphicsResetStatus +#define glReadnPixels __evas_gl_glapi->glReadnPixels +#define glGetnUniformfv __evas_gl_glapi->glGetnUniformfv +#define glGetnUniformiv __evas_gl_glapi->glGetnUniformiv +#define glGetnUniformuiv __evas_gl_glapi->glGetnUniformuiv +#define glMinSampleShading __evas_gl_glapi->glMinSampleShading +#define glPatchParameteri __evas_gl_glapi->glPatchParameteri +#define glTexParameterIiv __evas_gl_glapi->glTexParameterIiv +#define glTexParameterIuiv __evas_gl_glapi->glTexParameterIuiv +#define glGetTexParameterIiv __evas_gl_glapi->glGetTexParameterIiv +#define glGetTexParameterIuiv __evas_gl_glapi->glGetTexParameterIuiv +#define glSamplerParameterIiv __evas_gl_glapi->glSamplerParameterIiv +#define glSamplerParameterIuiv __evas_gl_glapi->glSamplerParameterIuiv +#define glGetSamplerParameterIiv __evas_gl_glapi->glGetSamplerParameterIiv +#define glGetSamplerParameterIuiv __evas_gl_glapi->glGetSamplerParameterIuiv +#define glTexBuffer __evas_gl_glapi->glTexBuffer +#define glTexBufferRange __evas_gl_glapi->glTexBufferRange +#define glTexStorage3DMultisample __evas_gl_glapi->glTexStorage3DMultisample + +/** + * @ingroup Evas_GL_GLES3_Helpers + * @brief Macro to check that the GL APIs are properly set (GLES 3.0) + * @since_tizen 2.4 + */ +#define EVAS_GL_GLES3_API_CHECK() \ + ((__evas_gl_glapi != NULL) && \ + (__evas_gl_glapi->version == EVAS_GL_API_VERSION) && (glBeginQuery)) + +/** + * @} + */ + +#endif + +#endif // EMBEDDER_TIZEN_EVAS_GL_HELPER_H_ diff --git a/shell/platform/tizen/tizen_event_loop.h b/shell/platform/tizen/tizen_event_loop.h index e275e3bcf940a..013f926d92df1 100644 --- a/shell/platform/tizen/tizen_event_loop.h +++ b/shell/platform/tizen/tizen_event_loop.h @@ -72,6 +72,7 @@ class TizenEventLoop { TizenEventLoop& operator=(const TizenEventLoop&) = delete; static void ExcuteTaskEvents(void* data, void* buffer, unsigned int nbyte); + static Eina_Bool TaskTimerCallback(void* data); static TaskTimePoint TimePointFromFlutterTime( diff --git a/shell/platform/tizen/tizen_log.cc b/shell/platform/tizen/tizen_log.cc index 17a2dcf146e5f..17cb8e735369d 100644 --- a/shell/platform/tizen/tizen_log.cc +++ b/shell/platform/tizen/tizen_log.cc @@ -70,5 +70,4 @@ void StartLogging() { } is_running = true; } - } // namespace flutter diff --git a/shell/platform/tizen/tizen_log.h b/shell/platform/tizen/tizen_log.h index f529f36f56052..8411acd0577e5 100644 --- a/shell/platform/tizen/tizen_log.h +++ b/shell/platform/tizen/tizen_log.h @@ -5,7 +5,16 @@ #ifndef EMBEDDER_TIZEN_LOG_H_ #define EMBEDDER_TIZEN_LOG_H_ +#ifndef __X64_SHELL__ #include +#else +#define log_priority int +#define DLOG_DEBUG 0 +#define DLOG_WARN 1 +#define DLOG_INFO 2 +#define DLOG_ERROR 3 +int dlog_print(log_priority prio, const char* tag, const char* fmt, ...); +#endif #include #include @@ -26,7 +35,12 @@ log_priority GetMinLoggingLevel(); // This is the only valid log tag that TV devices can understand. #define LOG_TAG "ConsoleMessage" +#ifndef __MODULE__ +#define __MODULE__ strrchr("/" __FILE__, '/') + 1 +#endif + #undef __LOG + #ifdef TV_PROFILE // dlog_print() cannot be used because it implicitly passes LOG_ID_APPS as // a log id, which is ignored by TV devices. Instead, an internal function diff --git a/shell/platform/tizen/tizen_log_stub.cc b/shell/platform/tizen/tizen_log_stub.cc new file mode 100644 index 0000000000000..b248a4bb464a4 --- /dev/null +++ b/shell/platform/tizen/tizen_log_stub.cc @@ -0,0 +1,27 @@ +// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include +#include "tizen_log.h" + +int dlog_print(log_priority prio, const char* tag, const char* fmt, ...) { + va_list arglist; + va_start(arglist, fmt); + vprintf(fmt, arglist); + va_end(arglist); + printf("\n"); + return 0; +} + +namespace flutter { + +void SetMinLoggingLevel(log_priority p){}; + +log_priority GetMinLoggingLevel() { + return DLOG_ERROR; +}; + +void StartLogging() {} + +} // namespace flutter diff --git a/shell/platform/tizen/tizen_renderer_evas_gl.cc b/shell/platform/tizen/tizen_renderer_evas_gl.cc index 5dfa505a8a4cc..8eb03cad262bc 100644 --- a/shell/platform/tizen/tizen_renderer_evas_gl.cc +++ b/shell/platform/tizen/tizen_renderer_evas_gl.cc @@ -4,7 +4,13 @@ #include "tizen_renderer_evas_gl.h" +#ifdef __X64_SHELL__ +#include "tizen_evas_gl_helper.h" +int gApp_width = 800; +int gApp_height = 600; +#else #include +#endif Evas_GL* g_evas_gl = nullptr; EVAS_GL_GLOBAL_GLES3_DEFINE(); @@ -601,11 +607,12 @@ bool TizenRendererEvasGL::SetupEvasGL() { gl_config_->depth_bits = EVAS_GL_DEPTH_NONE; gl_config_->stencil_bits = EVAS_GL_STENCIL_NONE; +#ifndef __X64_SHELL__ gl_context_ = evas_gl_context_version_create(evas_gl_, NULL, EVAS_GL_GLES_3_X); gl_resource_context_ = evas_gl_context_version_create(evas_gl_, gl_context_, EVAS_GL_GLES_3_X); - +#endif if (gl_context_ == nullptr) { FT_LOGW( "Failed to create evas gl context with EVAS_GL_GLES_3_X, try to use " @@ -647,6 +654,10 @@ Evas_Object* TizenRendererEvasGL::SetupEvasWindow(int32_t& width, return nullptr; } +#ifdef __X64_SHELL__ + width = gApp_width; + height = gApp_height; +#endif elm_win_alpha_set(evas_window_, EINA_FALSE); evas_object_move(evas_window_, 0, 0); evas_object_resize(evas_window_, width, height); diff --git a/shell/platform/tizen/touch_event_handler.h b/shell/platform/tizen/touch_event_handler.h index e5f764af86e9a..8d2a6c6facbb7 100644 --- a/shell/platform/tizen/touch_event_handler.h +++ b/shell/platform/tizen/touch_event_handler.h @@ -5,6 +5,10 @@ #ifndef EMBEDDER_TOUCH_EVENT_HANDLER_H_ #define EMBEDDER_TOUCH_EVENT_HANDLER_H_ +#ifdef __X64_SHELL__ +#include +#endif + #include #include