浏览代码

change build pipeline to use new flutter lib

/siyaoH-1.17-PlatformMessage
xingwei.zhu 4 年前
当前提交
82a4fc0e
共有 12 个文件被更改,包括 136 次插入19 次删除
  1. 2
      com.unity.uiwidgets/Runtime/services/keyboard.cs
  2. 127
      engine/Build.bee.cs
  3. 2
      engine/src/flow/layers/opacity_layer.cc
  4. 2
      engine/src/lib/ui/compositing/scene_builder.cc
  5. 2
      engine/src/lib/ui/painting/gradient.h
  6. 2
      engine/src/lib/ui/text/paragraph.cc
  7. 2
      engine/src/lib/ui/window/window.cc
  8. 2
      engine/src/shell/common/canvas_spy.cc
  9. 2
      engine/src/shell/common/canvas_spy.h
  10. 5
      engine/src/shell/gpu/gpu_surface_gl.cc
  11. 2
      engine/src/shell/platform/embedder/embedder.cc
  12. 5
      engine/src/shell/platform/unity/darwin/macos/uiwidgets_panel.mm

2
com.unity.uiwidgets/Runtime/services/keyboard.cs


}
public override void setEditingState(TextEditingValue value) {
UIWidgetsTextInputSetTextInputEditingState(value.toJson().ToString());
UIWidgetsTextInputSetTextInputEditingState(value.toJSON().ToString());
}
public override void setIMEPos(Offset imeGlobalPos) {

127
engine/Build.bee.cs


{
static void Main()
{
skiaRoot = Environment.GetEnvironmentVariable("SKIA_ROOT");
if (string.IsNullOrEmpty(skiaRoot))
{
skiaRoot = Environment.GetEnvironmentVariable("USERPROFILE") + "/skia_repo/skia";
}
skiaRoot = flutterRoot + "/third_party/skia";
var libUIWidgets = SetupLibUIWidgets();

np.LinkerSettings().Add(c => IsWindows(c), l => l.WithCustomFlags_workaround(new[] { "/DEBUG:FULL" }));
SetupFml(np);
SetupTxtAlone(np);
//SetupFml(np);
SetupSkia(np);
SetupTxt(np);
//SetupSkia(np);
//SetupTxt(np);
var codegens = new[] { CodeGen.Debug };

{
new StaticLibrary(fmlLibPath + "/obj/flutter/fml/libfml_lib.a"),
new SystemFramework("Foundation"),
};
});
}
static void SetupTxtAlone(NativeProgram np)
{
//np.IncludeDirectories.Add(skiaRoot);
//np.IncludeDirectories.Add(flutterRoot);
//np.IncludeDirectories.Add(flutterRoot + "/flutter/third_party/txt/src");
//np.IncludeDirectories.Add(skiaRoot + "/third_party/externals/harfbuzz/src");
//np.IncludeDirectories.Add(skiaRoot + "/third_party/externals/icu/source/common");
np.Defines.Add(c => IsMac(c), new []
{
"USE_OPENSSL=1",
"__STDC_CONSTANT_MACROS",
"__STDC_FORMAT_MACROS",
"_FORTIFY_SOURCE=2",
"_LIBCPP_DISABLE_AVAILABILITY=1",
"_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
"_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
"_DEBUG",
"FLUTTER_RUNTIME_MODE_DEBUG=1",
"FLUTTER_RUNTIME_MODE_PROFILE=2",
"FLUTTER_RUNTIME_MODE_RELEASE=3",
"FLUTTER_RUNTIME_MODE_JIT_RELEASE=4",
"FLUTTER_RUNTIME_MODE=1",
"FLUTTER_JIT_RUNTIME=1",
"SK_ENABLE_SPIRV_VALIDATION",
"SK_ASSUME_GL=1",
"SK_ENABLE_API_AVAILABLE",
"SK_GAMMA_APPLY_TO_A8",
"GR_OP_ALLOCATE_USE_NEW",
"SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
"GR_TEST_UTILS=1",
"SKIA_IMPLEMENTATION=1",
"SK_GL",
"SK_ENABLE_DUMP_GPU",
"SK_SUPPORT_PDF",
"SK_CODEC_DECODES_JPEG",
"SK_ENCODE_JPEG",
"SK_ENABLE_ANDROID_UTILS",
"SK_USE_LIBGIFCODEC",
"SK_HAS_HEIF_LIBRARY",
"SK_CODEC_DECODES_PNG",
"SK_ENCODE_PNG",
"SK_CODEC_DECODES_RAW",
"SK_ENABLE_SKSL_INTERPRETER",
"SKVM_JIT_WHEN_POSSIBLE",
"SK_CODEC_DECODES_WEBP",
"SK_ENCODE_WEBP",
"SK_XML",
"RAPIDJSON_HAS_STDSTRING",
"RAPIDJSON_HAS_CXX11_RANGE_FOR",
"RAPIDJSON_HAS_CXX11_RVALUE_REFS",
"RAPIDJSON_HAS_CXX11_TYPETRAITS",
"RAPIDJSON_HAS_CXX11_NOEXCEPT",
"USE_OPENSSL=1",
"__STDC_CONSTANT_MACROS",
"__STDC_FORMAT_MACROS",
"_FORTIFY_SOURCE=2",
"_LIBCPP_DISABLE_AVAILABILITY=1",
"_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
"_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
"_DEBUG"
});
np.Defines.Add(new[] { "SK_USING_THIRD_PARTY_ICU", "U_USING_ICU_NAMESPACE=0",
"U_ENABLE_DYLOAD=0", "USE_CHROMIUM_ICU=1", "U_STATIC_IMPLEMENTATION",
"ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC"
});
np.CompilerSettings().Add(c => IsMac(c), c => c.WithCustomFlags(new[] {
"-MD",
"-MF",
"-I.",
"-Ithird_party",
"-Isrc",
"-I"+ flutterRoot,
"-I"+ flutterRoot+"/third_party/rapidjson/include",
"-I"+ skiaRoot,
"-I"+ flutterRoot+"/flutter/third_party/txt/src",
"-I" + flutterRoot + "/third_party/harfbuzz/src",
"-I" + skiaRoot + "/third_party/externals/icu/source/common",
// "-Igen",
"-I"+ flutterRoot+"/third_party/icu/source/common",
"-I"+ flutterRoot+"/third_party/icu/source/i18n",
"-fvisibility-inlines-hidden",
}));
np.Libraries.Add(IsMac, c => {
return new PrecompiledLibrary[]
{
// icudtl
//new StaticLibrary("icudtl.o"),
//new StaticLibrary(flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtbegin_so.o"),
//new StaticLibrary(flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtend_so.o"),
new StaticLibrary(flutterRoot+"/out/host_debug_unopt/obj/flutter/third_party/txt/libtxt_lib.a"),
new SystemFramework("Foundation"),
new SystemFramework("ApplicationServices"),
new SystemFramework("OpenGL"),
new SystemFramework("AppKit"),
new SystemFramework("CoreVideo"),
};
});
}

2
engine/src/flow/layers/opacity_layer.cc


context->is_opaque = parent_is_opaque && (alpha_ == SK_AlphaOPAQUE);
context->mutators_stack.PushTransform(
SkMatrix::Translate(offset_.fX, offset_.fY));
SkMatrix::MakeTrans(offset_.fX, offset_.fY));
context->mutators_stack.PushOpacity(alpha_);
Layer::AutoPrerollSaveLayerState save =
Layer::AutoPrerollSaveLayerState::Create(context);

2
engine/src/lib/ui/compositing/scene_builder.cc


}
fml::RefPtr<EngineLayer> SceneBuilder::pushOffset(float dx, float dy) {
SkMatrix sk_matrix = SkMatrix::Translate(dx, dy);
SkMatrix sk_matrix = SkMatrix::MakeTrans(dx, dy);
auto layer = std::make_shared<TransformLayer>(sk_matrix);
PushLayer(layer);
return EngineLayer::MakeRetained(layer);

2
engine/src/lib/ui/painting/gradient.h


#pragma
#pragma once
#include "include/effects/SkGradientShader.h"
#include "lib/ui/painting/matrix.h"

2
engine/src/lib/ui/text/paragraph.cc


// text direction index.
int size = boxes.size() * 5;
Float32List result = {(float*)malloc(sizeof(float) * size),
boxes.size() * size};
(int)boxes.size() * size};
unsigned long position = 0;
for (unsigned long i = 0; i < boxes.size(); i++) {
const txt::Paragraph::TextBox& box = boxes[i];

2
engine/src/lib/ui/window/window.cc


Window_updateWindowMetricsCallback Window_updateWindowMetrics_;
typedef void (*Window_beginFrameCallback)(long microseconds);
typedef void (*Window_beginFrameCallback)(int64_t microseconds);
Window_beginFrameCallback Window_beginFrame_;
typedef void (*Window_drawFrameCallback)();

2
engine/src/shell/common/canvas_spy.cc


void DidDrawCanvas::didConcat(const SkMatrix& matrix) {}
void DidDrawCanvas::didConcat44(const SkM44&) {}
void DidDrawCanvas::didConcat44(const SkScalar[]) {}
void DidDrawCanvas::didScale(SkScalar, SkScalar) {}

2
engine/src/shell/common/canvas_spy.h


// |SkCanvasVirtualEnforcer<SkNoDrawCanvas>|
void didConcat(const SkMatrix&) override;
void didConcat44(const SkM44&) override;
void didConcat44(const SkScalar[]) override;
void didScale(SkScalar, SkScalar) override;
void didTranslate(SkScalar, SkScalar) override;

5
engine/src/shell/gpu/gpu_surface_gl.cc


{
TRACE_EVENT0("uiwidgets", "SkCanvas::Flush");
onscreen_surface_->getCanvas()->flush();
onscreen_surface_->getContext()->submit(true);
auto flushInfo = GrFlushInfo();
flushInfo.fFlags = GrFlushFlags::kSyncCpu_GrFlushFlag;
onscreen_surface_->flush(SkSurface::BackendSurfaceAccess::kNoAccess, flushInfo);
//onscreen_surface_->GetContext()->submit(true);
}
if (!delegate_->GLContextPresent()) {

2
engine/src/shell/platform/embedder/embedder.cc


case PointerData::Change::kHover:
case PointerData::Change::kUp:
return 0;
default:
return 0;
}
return 0;
}

5
engine/src/shell/platform/unity/darwin/macos/uiwidgets_panel.mm


args.assets_path = streaming_assets_path;
args.font_asset = settings;
//TODO: not support icu yet
//args.icu_mapper = GetICUStaticMapping;
std::string icu_path = std::string(streaming_assets_path) + "/icudtl.dat";
args.icu_data_path = icu_path.c_str();
args.command_line_argc = 0;
args.command_line_argv = nullptr;
args.platform_message_callback =

正在加载...
取消
保存