浏览代码

fix reference

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
7dfbad88
共有 11 个文件被更改,包括 43 次插入34 次删除
  1. 2
      com.unity.uiwidgets/Runtime/ui2/painting.cs
  2. 41
      com.unity.uiwidgets/Runtime/ui2/text.cs
  3. 2
      engine/Build.bee.cs
  4. 6
      engine/README.md
  5. 2
      engine/src/lib/ui/text/font_collection.cc
  6. 1
      engine/src/lib/ui/text/icu_util.cc
  7. 4
      engine/src/lib/ui/text/paragraph.h
  8. 6
      engine/src/lib/ui/text/paragraph_builder.h
  9. 6
      engine/src/render_api_d3d11.cc
  10. 5
      engine/src/shell/common/shell.cc
  11. 2
      engine/src/shell/platform/unity/uiwidgets_panel.cc

2
com.unity.uiwidgets/Runtime/ui2/painting.cs


// If you add more fields, remember to update _kDataByteCount.
const int _kDataByteCount = 56;
public object[] _objects;
object[] _objects;
internal IntPtr[] _objectPtrs;
const int _kShaderIndex = 0;
const int _kColorFilterIndex = 1;

41
com.unity.uiwidgets/Runtime/ui2/text.cs


using Unity.UIWidgets.ui;
using UnityEngine;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.external.simplejson;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.ui2 {

}
}
static byte[] _fontChangeMessage =
Encoding.ASCII.GetBytes(JsonUtility.ToJson(new Dictionary<string, dynamic>() {{"type", "fontsChange"}}));
static byte[] _fontChangeMessageData;
static byte[] _fontChangeMessage {
get {
if (_fontChangeMessageData != null) {
return _fontChangeMessageData;
}
JSONObject message = new JSONObject();
message["type"] = "fontsChange";
_fontChangeMessageData = Encoding.ASCII.GetBytes(message.ToString());
return _fontChangeMessageData;
}
}
Window window = new Window();
window.onPlatformMessage?.Invoke("uiwidgets/system", _fontChangeMessage,
Window.instance.onPlatformMessage?.Invoke("uiwidgets/system", _fontChangeMessage,
(_) => { });
}

IntPtr callbackHandle,
string fontFamily);
public struct BaseList {
public struct Float32List {
public static float[] toFloatArrayAndFree(this BaseList data) {
public static float[] toFloatArrayAndFree(this Float32List data) {
float[] result = new float[data.length];
Marshal.Copy(data.data, result, 0, data.length);
ui_.Lists_Free(data.data);

List<Shadow> shadows = null,
List<FontFeature> fontFeatures = null
) {
D.assert(color == null || foreground == null
// "Cannot provide both a color and a foreground\n"+
// "The color argument is just a shorthand for \"foreground: Paint()..color = color\"."
D.assert(color == null || foreground == null, () =>
"Cannot provide both a color and a foreground\n"+
"The color argument is just a shorthand for \"foreground: Paint()..color = color\"."
);
_encoded = ui_._encodeTextStyle(
color,

static extern void Paragraph_layout(IntPtr ptr, float width);
[DllImport(NativeBindings.dllName)]
static extern ui_.BaseList Paragraph_getRectsForRange(IntPtr ptr, int start, int end,
static extern ui_.Float32List Paragraph_getRectsForRange(IntPtr ptr, int start, int end,
static extern ui_.BaseList Paragraph_getRectsForPlaceholders(IntPtr ptr);
static extern ui_.Float32List Paragraph_getRectsForPlaceholders(IntPtr ptr);
[DllImport(NativeBindings.dllName)]
static extern unsafe void Paragraph_getPositionForOffset(IntPtr ptr, float dx, float dy, int* encodedPtr);

static extern void Paragraph_paint(IntPtr ptr, IntPtr canvas, float x, float y);
[DllImport(NativeBindings.dllName)]
static extern ui_.BaseList Paragraph_computeLineMetrics(IntPtr ptr);
static extern ui_.Float32List Paragraph_computeLineMetrics(IntPtr ptr);
[DllImport(NativeBindings.dllName)]
static extern void Paragraph_dispose(IntPtr ptr);

}
// See paragraph.cc for the layout of this return value.
ui_.BaseList _getBoxesForRange(int start, int end, int boxHeightStyle, int boxWidthStyle) =>
ui_.Float32List _getBoxesForRange(int start, int end, int boxHeightStyle, int boxWidthStyle) =>
Paragraph_getRectsForRange(_ptr, start, end, boxHeightStyle, boxWidthStyle);

}
ui_.BaseList _getBoxesForPlaceholders() => Paragraph_getRectsForPlaceholders(_ptr);
ui_.Float32List _getBoxesForPlaceholders() => Paragraph_getRectsForPlaceholders(_ptr);
public unsafe TextPosition getPositionForOffset(Offset offset) {
int[] encoded = new int[2];

return metrics;
}
ui_.BaseList _computeLineMetrics() => Paragraph_computeLineMetrics(_ptr);
ui_.Float32List _computeLineMetrics() => Paragraph_computeLineMetrics(_ptr);
}
public class ParagraphBuilder : NativeWrapper {

2
engine/Build.bee.cs


};
np.Libraries.Add(new BagOfObjectFilesLibrary(
new NPath[]{
skiaRoot+"out/Debug/icudtl.o"
skiaRoot+"third_party/externals/icu/flutter/icudtl.o"
}));
np.CompilerSettings().Add(c => c.WithCppLanguageVersion(CppLanguageVersion.Cpp17));

6
engine/README.md


```
Ignore this error: "lld-link: error: could not open 'EGL': no such file or directory"
convert icudtl.dat to object file
convert icudtl.dat to object file in skia
cd out/Debug
ld -r -b binary -o .\icudtl.o .\icudtl.dat
cd SkiaRoot/third_party/externals/icu/flutter/icudtl.dat
ld -r -b binary -o icudtl.o icudtl.dat
```
### Build flutter fml

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


return;
}
// Structure described in https://flutter.io/custom-fonts/
if (!document.IsArray()) {
return;
}

1
engine/src/lib/ui/text/icu_util.cc


UErrorCode err_code = U_ZERO_ERROR;
udata_setCommonData(GetMapping(), &err_code);
return (err_code == U_ZERO_ERROR);
// return true;
}
const uint8_t* GetMapping() const {

4
engine/src/lib/ui/text/paragraph.h


#pragma once
#include "flutter/fml/memory/ref_counted.h"
#include "flutter/third_party/txt/src/txt/paragraph.h"
#include "txt/paragraph.h"
#include "src/lib/ui/painting/canvas.h"
#include "lib/ui/painting/canvas.h"
#include "lib/ui/ui_mono_state.h"
namespace uiwidgets {

6
engine/src/lib/ui/text/paragraph_builder.h


#pragma once
#include "flutter/fml/memory/ref_counted.h"
#include "flutter/third_party/txt/src/txt/paragraph.h"
#include "flutter/third_party/txt/src/txt/paragraph_builder.h"
#include "txt/paragraph.h"
#include "txt/paragraph_builder.h"
#include "src/lib/ui/painting/canvas.h"
#include "lib/ui/painting/canvas.h"
namespace uiwidgets {

6
engine/src/render_api_d3d11.cc


#include "Unity/IUnityGraphicsD3D11.h"
#include "flutter/fml/message_loop.h"
#include "flutter/third_party/txt/src/txt/paragraph.h"
#include "flutter/third_party/txt/src/txt/paragraph_builder.h"
#include "flutter/third_party/txt/src/txt/font_collection.h"
#include "txt/paragraph.h"
#include "txt/paragraph_builder.h"
#include "txt/font_collection.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "include/core/SkCanvas.h"

5
engine/src/shell/common/shell.cc


#define RAPIDJSON_HAS_STDSTRING 1
#include "shell.h"
#include <filesystem>
#include <future>
#include <memory>
#include <sstream>

if (settings.icu_initialization_required) {
if (settings.icu_data_path.length() > 0) {
uiwidgets::icu::InitializeICU(settings.icu_data_path);
} else {
} else if (settings.icu_mapper) {
} else {
FML_DLOG(WARNING) << "Skipping ICU initialization in the shell.";
}
}
});

2
engine/src/shell/platform/unity/uiwidgets_panel.cc


#include "lib/ui/window/viewport_metrics.h"
#include "runtime/mono_api.h"
#include "shell/platform/embedder/embedder_engine.h"
#include "src/shell/common/switches.h"
#include "shell/common/switches.h"
#include "uiwidgets_system.h"
namespace uiwidgets {

正在加载...
取消
保存