Skip to content

Commit

Permalink
Enable arm64 build (#63)
Browse files Browse the repository at this point in the history
* Enable arm64 build

* Update azure-pipelines.yml

* Add the common profile
  • Loading branch information
swift-kim committed Nov 14, 2021
1 parent c83765b commit 3b09be8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
32 changes: 24 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,20 +92,22 @@ 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
- publish: $(Build.StagingDirectory)
artifact: $(System.JobName)
- job: release
dependsOn: build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
pool:
name: Default
demands: agent.os -equals Linux
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion shell/platform/tizen/channels/text_input_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 4 additions & 2 deletions shell/platform/tizen/flutter_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include "public/flutter_tizen.h"

#include <inttypes.h>

#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"
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions shell/platform/tizen/tizen_embedder_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/tizen/tizen_embedder_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3b09be8

Please sign in to comment.