From 3b09be8566ceed7fed7ee3e854b38ad4fbed450c Mon Sep 17 00:00:00 2001 From: Swift Kim Date: Thu, 15 Apr 2021 17:13:02 +0900 Subject: [PATCH] Enable arm64 build (#63) * Enable arm64 build * Update azure-pipelines.yml * Add the common profile --- azure-pipelines.yml | 32 ++++++++++++++----- .../tizen/channels/text_input_channel.cc | 4 ++- shell/platform/tizen/flutter_tizen.cc | 6 ++-- shell/platform/tizen/tizen_embedder_engine.cc | 4 +++ shell/platform/tizen/tizen_embedder_engine.h | 2 +- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 875420e0d0006..c4ff87fd66d09 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,6 +23,18 @@ jobs: arch: arm mode: debug targetTriple: armv7l-tizen-linux-gnueabi + tizen-arm64-release: + arch: arm64 + mode: release + targetTriple: aarch64-tizen-linux-gnu + tizen-arm64-profile: + arch: arm64 + mode: profile + targetTriple: aarch64-tizen-linux-gnu + tizen-arm64-debug: + arch: arm64 + mode: debug + targetTriple: aarch64-tizen-linux-gnu tizen-x86-debug: arch: x86 mode: debug @@ -80,12 +92,15 @@ jobs: ninja -C output/tizen40/out/linux_$(mode)_$(arch) displayName: Build for Tizen 4.0 workingDirectory: $(buildroot) + condition: ne(variables['arch'], 'arm64') failOnStderr: true - bash: | OUTDIR=$(Build.StagingDirectory) + cp default/out/linux_$(mode)_$(arch)/libflutter_engine.so $OUTDIR cp default/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR - cp tizen40/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR/libflutter_tizen40.so - cp tizen40/out/linux_$(mode)_$(arch)/libflutter_engine.so $OUTDIR + if [[ "$(arch)" != "arm64" ]]; then + cp tizen40/out/linux_$(mode)_$(arch)/libflutter_tizen.so $OUTDIR/libflutter_tizen40.so + fi displayName: Copy artifacts workingDirectory: $(buildroot)/output failOnStderr: true @@ -93,7 +108,6 @@ jobs: artifact: $(System.JobName) - job: release dependsOn: build - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) pool: name: Default demands: agent.os -equals Linux @@ -122,12 +136,14 @@ jobs: cp $(Pipeline.Workspace)/src/third_party/icu/flutter/icudtl.dat common mv $(Pipeline.Workspace)/tizen-* . for platform in linux windows darwin; do - for mode in release profile; do - curl -o tmp.zip https://storage.googleapis.com/flutter_infra/flutter/$(upstreamVersion)/android-arm-$mode/$platform-x64.zip 2> /dev/null - unzip tmp.zip -d tizen-arm-$mode/$platform-x64 && rm tmp.zip + for arch in arm arm64; do + for mode in release profile; do + curl -o tmp.zip https://storage.googleapis.com/flutter_infra/flutter/$(upstreamVersion)/android-$arch-$mode/$platform-x64.zip 2> /dev/null + unzip tmp.zip -d tizen-$arch-$mode/$platform-x64 && rm tmp.zip + done + zip -r $(Build.StagingDirectory)/$platform-x64.zip * + rm -r tizen-$arch-*/$platform-x64 done - zip -r $(Build.StagingDirectory)/$platform-x64.zip * - rm -r tizen-arm-*/$platform-x64 done displayName: Create releases workingDirectory: $(Build.BinariesDirectory) diff --git a/shell/platform/tizen/channels/text_input_channel.cc b/shell/platform/tizen/channels/text_input_channel.cc index 71cf840326b35..9cc41dda502fc 100644 --- a/shell/platform/tizen/channels/text_input_channel.cc +++ b/shell/platform/tizen/channels/text_input_channel.cc @@ -277,8 +277,10 @@ TextInputChannel::TextInputChannel(flutter::BinaryMessenger* messenger, imf_context_ = ecore_imf_context_add(GetImfMethod()); } if (imf_context_) { + // Caution: Conversion between incompatible types (int to void*). ecore_imf_context_client_window_set( - imf_context_, (void*)engine_->tizen_renderer->GetEcoreWindowId()); + imf_context_, + (void*)(intptr_t)(engine_->tizen_renderer->GetEcoreWindowId())); RegisterIMFCallback(); } else { FT_LOGE("Failed to create imfContext"); diff --git a/shell/platform/tizen/flutter_tizen.cc b/shell/platform/tizen/flutter_tizen.cc index c8408a94337b4..122b75b1fcead 100644 --- a/shell/platform/tizen/flutter_tizen.cc +++ b/shell/platform/tizen/flutter_tizen.cc @@ -5,6 +5,8 @@ #include "public/flutter_tizen.h" +#include + #include "flutter/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h" #include "flutter/shell/platform/common/cpp/client_wrapper/include/flutter/standard_message_codec.h" #include "flutter/shell/platform/common/cpp/incoming_message_dispatcher.h" @@ -191,12 +193,12 @@ bool FlutterMarkExternalTextureFrameAvailable( void* tbm_surface) { auto it = texture_registrar->textures.find(texture_id); if (it == texture_registrar->textures.end()) { - FT_LOGE("can't find texture texture_id = %lld", texture_id); + FT_LOGE("can't find texture texture_id = %" PRId64, texture_id); return false; } if (!texture_registrar->textures[texture_id]->OnFrameAvailable( (tbm_surface_h)tbm_surface)) { - FT_LOGE("OnFrameAvailable fail texture_id = %lld", texture_id); + FT_LOGE("OnFrameAvailable fail texture_id = %" PRId64, texture_id); return false; } return (FlutterEngineMarkExternalTextureFrameAvailable( diff --git a/shell/platform/tizen/tizen_embedder_engine.cc b/shell/platform/tizen/tizen_embedder_engine.cc index 5ce8651fa2c3c..4d4c5105905b1 100644 --- a/shell/platform/tizen/tizen_embedder_engine.cc +++ b/shell/platform/tizen/tizen_embedder_engine.cc @@ -29,6 +29,8 @@ static DeviceProfile GetDeviceProfile() { return DeviceProfile::kWearable; } else if (profile == "tv") { return DeviceProfile::kTV; + } else if (profile == "common") { + return DeviceProfile::kCommon; } FT_LOGW("Flutter-tizen is running on an unknown device profile!"); return DeviceProfile::kUnknown; @@ -265,6 +267,8 @@ void TizenEmbedderEngine::SendWindowMetrics(int32_t width, int32_t height, profile_factor = 0.7; } else if (device_profile == DeviceProfile::kTV) { profile_factor = 2.0; + } else if (device_profile == DeviceProfile::kCommon) { + profile_factor = 0.5; } double dpi = device_profile == DeviceProfile::kTV ? 72.0 : device_dpi; double scale_factor = dpi / 90.0 * profile_factor; diff --git a/shell/platform/tizen/tizen_embedder_engine.h b/shell/platform/tizen/tizen_embedder_engine.h index 316c99e8aa911..93d19fa266263 100644 --- a/shell/platform/tizen/tizen_embedder_engine.h +++ b/shell/platform/tizen/tizen_embedder_engine.h @@ -64,7 +64,7 @@ struct FlutterTextureRegistrar { using UniqueAotDataPtr = std::unique_ptr<_FlutterEngineAOTData, AOTDataDeleter>; -enum DeviceProfile { kUnknown, kMobile, kWearable, kTV }; +enum DeviceProfile { kUnknown, kMobile, kWearable, kTV, kCommon }; // Manages state associated with the underlying FlutterEngine. class TizenEmbedderEngine : public TizenRenderer::Delegate {