Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
0bad812c
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0bad812c
编写于
7月 23, 2018
作者:
J
Jason Simmons
提交者:
GitHub
7月 23, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Migrate to a standalone Tonic repository separated from Topaz (#5817)
上级
f949f7d4
变更
83
隐藏空白更改
内联
并排
Showing
83 changed file
with
695 addition
and
492 deletion
+695
-492
DEPS
DEPS
+2
-2
lib/io/BUILD.gn
lib/io/BUILD.gn
+1
-1
lib/io/dart_io.cc
lib/io/dart_io.cc
+1
-1
lib/ui/BUILD.gn
lib/ui/BUILD.gn
+3
-1
lib/ui/compositing/scene.cc
lib/ui/compositing/scene.cc
+7
-8
lib/ui/compositing/scene.h
lib/ui/compositing/scene.h
+2
-3
lib/ui/compositing/scene_builder.cc
lib/ui/compositing/scene_builder.cc
+10
-7
lib/ui/compositing/scene_builder.h
lib/ui/compositing/scene_builder.h
+13
-6
lib/ui/compositing/scene_host.cc
lib/ui/compositing/scene_host.cc
+3
-4
lib/ui/compositing/scene_host.h
lib/ui/compositing/scene_host.h
+2
-3
lib/ui/dart_runtime_hooks.cc
lib/ui/dart_runtime_hooks.cc
+8
-8
lib/ui/dart_runtime_hooks.h
lib/ui/dart_runtime_hooks.h
+1
-1
lib/ui/dart_ui.cc
lib/ui/dart_ui.cc
+2
-2
lib/ui/dart_wrapper.h
lib/ui/dart_wrapper.h
+28
-0
lib/ui/isolate_name_server/isolate_name_server_natives.cc
lib/ui/isolate_name_server/isolate_name_server_natives.cc
+2
-2
lib/ui/painting/canvas.cc
lib/ui/painting/canvas.cc
+6
-5
lib/ui/painting/canvas.h
lib/ui/painting/canvas.h
+5
-6
lib/ui/painting/codec.cc
lib/ui/painting/codec.cc
+8
-8
lib/ui/painting/codec.h
lib/ui/painting/codec.h
+2
-3
lib/ui/painting/frame_info.cc
lib/ui/painting/frame_info.cc
+2
-2
lib/ui/painting/frame_info.h
lib/ui/painting/frame_info.h
+2
-3
lib/ui/painting/gradient.cc
lib/ui/painting/gradient.cc
+4
-4
lib/ui/painting/gradient.h
lib/ui/painting/gradient.h
+4
-4
lib/ui/painting/image.cc
lib/ui/painting/image.cc
+4
-4
lib/ui/painting/image.h
lib/ui/painting/image.h
+2
-3
lib/ui/painting/image_encoding.cc
lib/ui/painting/image_encoding.cc
+4
-4
lib/ui/painting/image_encoding.h
lib/ui/painting/image_encoding.h
+1
-1
lib/ui/painting/image_filter.cc
lib/ui/painting/image_filter.cc
+4
-4
lib/ui/painting/image_filter.h
lib/ui/painting/image_filter.h
+3
-4
lib/ui/painting/image_shader.cc
lib/ui/painting/image_shader.cc
+4
-4
lib/ui/painting/image_shader.h
lib/ui/painting/image_shader.h
+2
-2
lib/ui/painting/matrix.h
lib/ui/painting/matrix.h
+1
-1
lib/ui/painting/paint.cc
lib/ui/painting/paint.cc
+7
-3
lib/ui/painting/paint.h
lib/ui/painting/paint.h
+1
-1
lib/ui/painting/path.cc
lib/ui/painting/path.cc
+20
-11
lib/ui/painting/path.h
lib/ui/painting/path.h
+4
-5
lib/ui/painting/path_measure.cc
lib/ui/painting/path_measure.cc
+4
-4
lib/ui/painting/path_measure.h
lib/ui/painting/path_measure.h
+8
-6
lib/ui/painting/picture.cc
lib/ui/painting/picture.cc
+4
-4
lib/ui/painting/picture.h
lib/ui/painting/picture.h
+2
-3
lib/ui/painting/picture_recorder.cc
lib/ui/painting/picture_recorder.cc
+4
-4
lib/ui/painting/picture_recorder.h
lib/ui/painting/picture_recorder.h
+2
-3
lib/ui/painting/rrect.cc
lib/ui/painting/rrect.cc
+2
-2
lib/ui/painting/rrect.h
lib/ui/painting/rrect.h
+1
-1
lib/ui/painting/shader.h
lib/ui/painting/shader.h
+2
-3
lib/ui/painting/vertices.cc
lib/ui/painting/vertices.cc
+2
-2
lib/ui/painting/vertices.h
lib/ui/painting/vertices.h
+4
-5
lib/ui/plugins/callback_cache.cc
lib/ui/plugins/callback_cache.cc
+1
-1
lib/ui/semantics/custom_accessibility_action.h
lib/ui/semantics/custom_accessibility_action.h
+4
-4
lib/ui/semantics/semantics_update.cc
lib/ui/semantics/semantics_update.cc
+6
-5
lib/ui/semantics/semantics_update.h
lib/ui/semantics/semantics_update.h
+6
-6
lib/ui/semantics/semantics_update_builder.cc
lib/ui/semantics/semantics_update_builder.cc
+38
-34
lib/ui/semantics/semantics_update_builder.h
lib/ui/semantics/semantics_update_builder.h
+4
-5
lib/ui/text/paragraph.cc
lib/ui/text/paragraph.cc
+4
-4
lib/ui/text/paragraph.h
lib/ui/text/paragraph.h
+2
-3
lib/ui/text/paragraph_builder.cc
lib/ui/text/paragraph_builder.cc
+4
-4
lib/ui/text/paragraph_builder.h
lib/ui/text/paragraph_builder.h
+3
-4
lib/ui/text/paragraph_impl_txt.cc
lib/ui/text/paragraph_impl_txt.cc
+1
-1
lib/ui/text/text_box.cc
lib/ui/text/text_box.cc
+3
-3
lib/ui/text/text_box.h
lib/ui/text/text_box.h
+1
-1
lib/ui/ui_dart_state.cc
lib/ui/ui_dart_state.cc
+2
-2
lib/ui/ui_dart_state.h
lib/ui/ui_dart_state.h
+3
-3
lib/ui/window/platform_message_response_dart.cc
lib/ui/window/platform_message_response_dart.cc
+9
-9
lib/ui/window/platform_message_response_dart.h
lib/ui/window/platform_message_response_dart.h
+1
-1
lib/ui/window/window.cc
lib/ui/window/window.cc
+15
-15
lib/ui/window/window.h
lib/ui/window/window.h
+1
-1
runtime/BUILD.gn
runtime/BUILD.gn
+2
-2
runtime/dart_isolate.cc
runtime/dart_isolate.cc
+84
-85
runtime/dart_isolate.h
runtime/dart_isolate.h
+18
-18
runtime/dart_isolate_unittests.cc
runtime/dart_isolate_unittests.cc
+6
-3
runtime/dart_service_isolate.cc
runtime/dart_service_isolate.cc
+3
-3
runtime/dart_vm.cc
runtime/dart_vm.cc
+8
-8
runtime/runtime_controller.cc
runtime/runtime_controller.cc
+26
-17
runtime/runtime_controller.h
runtime/runtime_controller.h
+2
-2
shell/common/BUILD.gn
shell/common/BUILD.gn
+2
-2
shell/common/engine.cc
shell/common/engine.cc
+9
-3
shell/common/isolate_configuration.cc
shell/common/isolate_configuration.cc
+3
-8
shell/common/isolate_configuration.h
shell/common/isolate_configuration.h
+1
-1
shell/platform/embedder/BUILD.gn
shell/platform/embedder/BUILD.gn
+1
-1
shell/testing/BUILD.gn
shell/testing/BUILD.gn
+1
-1
tools/licenses/pubspec.lock
tools/licenses/pubspec.lock
+0
-61
travis/licenses_golden/licenses_flutter
travis/licenses_golden/licenses_flutter
+2
-1
travis/licenses_golden/licenses_third_party
travis/licenses_golden/licenses_third_party
+209
-2
未找到文件。
DEPS
浏览文件 @
0bad812c
...
...
@@ -125,8 +125,8 @@ deps = {
'src/garnet':
Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67',
'src/t
opaz
':
Var('fuchsia_git') + '/to
paz' + '@' + '5fa651cf9cc5f338379e34964ff5dd70052f6237
',
'src/t
hird_party/tonic
':
Var('fuchsia_git') + '/to
nic' + '@' + 'e586d2975fedec0aa6c3ec87de287789172a0948
',
'src/third_party/benchmark':
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22',
...
...
lib/io/BUILD.gn
浏览文件 @
0bad812c
...
...
@@ -12,7 +12,7 @@ source_set("io") {
"//third_party/dart/runtime:dart_api",
"//third_party/dart/runtime/bin:embedded_dart_io",
"//garnet/public/lib/fxl",
"//t
opaz/lib/tonic/converter
",
"//t
hird_party/tonic
",
]
configs += [
...
...
lib/io/dart_io.cc
浏览文件 @
0bad812c
...
...
@@ -4,10 +4,10 @@
#include "flutter/lib/io/dart_io.h"
#include "lib/tonic/converter/dart_converter.h"
#include "third_party/dart/runtime/bin/crypto.h"
#include "third_party/dart/runtime/bin/io_natives.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/tonic/converter/dart_converter.h"
using
tonic
::
ToDart
;
...
...
lib/ui/BUILD.gn
浏览文件 @
0bad812c
...
...
@@ -14,6 +14,7 @@ source_set("ui") {
"dart_runtime_hooks.h",
"dart_ui.cc",
"dart_ui.h",
"dart_wrapper.h",
"isolate_name_server/isolate_name_server.cc",
"isolate_name_server/isolate_name_server.h",
"isolate_name_server/isolate_name_server_natives.cc",
...
...
@@ -102,12 +103,13 @@ source_set("ui") {
"$flutter_root/fml",
"$flutter_root/glue",
"$flutter_root/runtime:test_font",
"//garnet/public/lib/fxl",
"//third_party/dart/runtime/bin:embedded_dart_io",
"//third_party/rapidjson",
"//third_party/skia",
"//third_party/skia:effects",
"//third_party/skia:gpu",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
if (is_fuchsia) {
deps += [ "//topaz/public/dart-pkg/zircon" ]
...
...
lib/ui/compositing/scene.cc
浏览文件 @
0bad812c
...
...
@@ -7,15 +7,14 @@
#include "flutter/glue/trace_event.h"
#include "flutter/lib/ui/painting/image.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "lib/tonic/dart_persistent_value.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/logging/dart_invoke.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
#include "third_party/tonic/dart_persistent_value.h"
#include "third_party/tonic/logging/dart_invoke.h"
namespace
blink
{
...
...
@@ -152,7 +151,7 @@ Dart_Handle Scene::toImage(uint32_t width,
image_callback
=
std
::
move
(
image_callback
),
//
unref_queue
=
std
::
move
(
unref_queue
)
//
]()
mutable
{
auto
dart_state
=
image_callback
->
dart_state
().
get
();
auto
dart_state
=
image_callback
->
dart_state
().
lock
();
if
(
!
dart_state
)
{
// The root isolate could have died in the meantime.
return
;
...
...
lib/ui/compositing/scene.h
浏览文件 @
0bad812c
...
...
@@ -9,7 +9,7 @@
#include <memory>
#include "flutter/flow/layers/layer_tree.h"
#include "
lib/tonic/dart_wrappable
.h"
#include "
flutter/lib/ui/dart_wrapper
.h"
#include "third_party/skia/include/core/SkPicture.h"
namespace
tonic
{
...
...
@@ -18,8 +18,7 @@ class DartLibraryNatives;
namespace
blink
{
class
Scene
:
public
fxl
::
RefCountedThreadSafe
<
Scene
>
,
public
tonic
::
DartWrappable
{
class
Scene
:
public
RefCountedDartWrappable
<
Scene
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
Scene
);
...
...
lib/ui/compositing/scene_builder.cc
浏览文件 @
0bad812c
...
...
@@ -9,11 +9,11 @@
#include "flutter/lib/ui/ui_dart_state.h"
#include "flutter/lib/ui/window/window.h"
#include "lib/fxl/build_config.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
namespace
blink
{
...
...
@@ -64,15 +64,18 @@ void SceneBuilder::pushClipRect(double left,
double
top
,
double
bottom
,
int
clipMode
)
{
layer_builder_
->
PushClipRect
(
SkRect
::
MakeLTRB
(
left
,
top
,
right
,
bottom
),
static_cast
<
flow
::
ClipMode
>
(
clipMode
));
layer_builder_
->
PushClipRect
(
SkRect
::
MakeLTRB
(
left
,
top
,
right
,
bottom
),
static_cast
<
flow
::
ClipMode
>
(
clipMode
));
}
void
SceneBuilder
::
pushClipRRect
(
const
RRect
&
rrect
,
int
clipMode
)
{
layer_builder_
->
PushClipRoundedRect
(
rrect
.
sk_rrect
,
static_cast
<
flow
::
ClipMode
>
(
clipMode
));
layer_builder_
->
PushClipRoundedRect
(
rrect
.
sk_rrect
,
static_cast
<
flow
::
ClipMode
>
(
clipMode
));
}
void
SceneBuilder
::
pushClipPath
(
const
CanvasPath
*
path
,
int
clipMode
)
{
layer_builder_
->
PushClipPath
(
path
->
path
(),
static_cast
<
flow
::
ClipMode
>
(
clipMode
));
layer_builder_
->
PushClipPath
(
path
->
path
(),
static_cast
<
flow
::
ClipMode
>
(
clipMode
));
}
void
SceneBuilder
::
pushOpacity
(
int
alpha
)
{
...
...
lib/ui/compositing/scene_builder.h
浏览文件 @
0bad812c
...
...
@@ -12,18 +12,17 @@
#include "flutter/flow/layers/layer_builder.h"
#include "flutter/lib/ui/compositing/scene.h"
#include "flutter/lib/ui/compositing/scene_host.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/image_filter.h"
#include "flutter/lib/ui/painting/path.h"
#include "flutter/lib/ui/painting/picture.h"
#include "flutter/lib/ui/painting/rrect.h"
#include "flutter/lib/ui/painting/shader.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "third_party/tonic/typed_data/float64_list.h"
namespace
blink
{
class
SceneBuilder
:
public
fxl
::
RefCountedThreadSafe
<
SceneBuilder
>
,
public
tonic
::
DartWrappable
{
class
SceneBuilder
:
public
RefCountedDartWrappable
<
SceneBuilder
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
SceneBuilder
);
...
...
@@ -35,7 +34,11 @@ class SceneBuilder : public fxl::RefCountedThreadSafe<SceneBuilder>,
~
SceneBuilder
()
override
;
void
pushTransform
(
const
tonic
::
Float64List
&
matrix4
);
void
pushClipRect
(
double
left
,
double
right
,
double
top
,
double
bottom
,
int
clipMode
);
void
pushClipRect
(
double
left
,
double
right
,
double
top
,
double
bottom
,
int
clipMode
);
void
pushClipRRect
(
const
RRect
&
rrect
,
int
clipMode
);
void
pushClipPath
(
const
CanvasPath
*
path
,
int
clipMode
);
void
pushOpacity
(
int
alpha
);
...
...
@@ -47,7 +50,11 @@ class SceneBuilder : public fxl::RefCountedThreadSafe<SceneBuilder>,
double
maskRectTop
,
double
maskRectBottom
,
int
blendMode
);
void
pushPhysicalShape
(
const
CanvasPath
*
path
,
double
elevation
,
int
color
,
int
shadowColor
,
int
clipMode
);
void
pushPhysicalShape
(
const
CanvasPath
*
path
,
double
elevation
,
int
color
,
int
shadowColor
,
int
clipMode
);
void
pop
();
...
...
lib/ui/compositing/scene_host.cc
浏览文件 @
0bad812c
...
...
@@ -5,10 +5,9 @@
#include "flutter/lib/ui/compositing/scene_host.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "lib/tonic/dart_wrappable.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
#ifdef OS_FUCHSIA
#include "dart-pkg/zircon/sdk_ext/handle.h"
...
...
lib/ui/compositing/scene_host.h
浏览文件 @
0bad812c
...
...
@@ -7,7 +7,7 @@
#include <stdint.h>
#include "
lib/tonic/dart_wrappable
.h"
#include "
flutter/lib/ui/dart_wrapper
.h"
#if defined(OS_FUCHSIA)
#include "flutter/flow/export_node.h"
...
...
@@ -19,8 +19,7 @@ class DartLibraryNatives;
namespace
blink
{
class
SceneHost
:
public
fxl
::
RefCountedThreadSafe
<
SceneHost
>
,
public
tonic
::
DartWrappable
{
class
SceneHost
:
public
RefCountedDartWrappable
<
SceneHost
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
SceneHost
);
...
...
lib/ui/dart_runtime_hooks.cc
浏览文件 @
0bad812c
...
...
@@ -16,17 +16,17 @@
#include "flutter/lib/ui/ui_dart_state.h"
#include "lib/fxl/build_config.h"
#include "lib/fxl/logging.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_library_natives.h"
#include "lib/tonic/dart_microtask_queue.h"
#include "lib/tonic/dart_state.h"
#include "lib/tonic/logging/dart_error.h"
#include "lib/tonic/logging/dart_invoke.h"
#include "lib/tonic/scopes/dart_api_scope.h"
#include "lib/tonic/scopes/dart_isolate_scope.h"
#include "third_party/dart/runtime/bin/embedded_dart_io.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/dart/runtime/include/dart_tools_api.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_library_natives.h"
#include "third_party/tonic/dart_microtask_queue.h"
#include "third_party/tonic/dart_state.h"
#include "third_party/tonic/logging/dart_error.h"
#include "third_party/tonic/logging/dart_invoke.h"
#include "third_party/tonic/scopes/dart_api_scope.h"
#include "third_party/tonic/scopes/dart_isolate_scope.h"
#if defined(OS_ANDROID)
#include <android/log.h>
...
...
lib/ui/dart_runtime_hooks.h
浏览文件 @
0bad812c
...
...
@@ -6,8 +6,8 @@
#define FLUTTER_LIB_UI_DART_RUNTIME_HOOKS_H_
#include "lib/fxl/macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/dart_ui.cc
浏览文件 @
0bad812c
...
...
@@ -26,8 +26,8 @@
#include "flutter/lib/ui/text/paragraph_builder.h"
#include "flutter/lib/ui/window/window.h"
#include "lib/fxl/build_config.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/logging/dart_error.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/logging/dart_error.h"
using
tonic
::
ToDart
;
...
...
lib/ui/dart_wrapper.h
0 → 100644
浏览文件 @
0bad812c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_LIB_UI_DART_WRAPPER_H_
#define FLUTTER_LIB_UI_DART_WRAPPER_H_
#include "lib/fxl/memory/ref_counted.h"
#include "third_party/tonic/dart_wrappable.h"
namespace
blink
{
template
<
typename
T
>
class
RefCountedDartWrappable
:
public
fxl
::
RefCountedThreadSafe
<
T
>
,
public
tonic
::
DartWrappable
{
public:
virtual
void
RetainDartWrappableReference
()
const
override
{
fxl
::
RefCountedThreadSafe
<
T
>::
AddRef
();
}
virtual
void
ReleaseDartWrappableReference
()
const
override
{
fxl
::
RefCountedThreadSafe
<
T
>::
Release
();
}
};
}
// namespace blink
#endif // FLUTTER_LIB_UI_DART_WRAPPER_H_
lib/ui/isolate_name_server/isolate_name_server_natives.cc
浏览文件 @
0bad812c
...
...
@@ -7,8 +7,8 @@
#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h"
#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/canvas.cc
浏览文件 @
0bad812c
...
...
@@ -12,13 +12,13 @@
#include "flutter/lib/ui/painting/matrix.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "flutter/lib/ui/window/window.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkRSXform.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
using
tonic
::
ToDart
;
...
...
@@ -164,7 +164,8 @@ void Canvas::clipRect(double left,
bool
doAntiAlias
)
{
if
(
!
canvas_
)
return
;
canvas_
->
clipRect
(
SkRect
::
MakeLTRB
(
left
,
top
,
right
,
bottom
),
clipOp
,
doAntiAlias
);
canvas_
->
clipRect
(
SkRect
::
MakeLTRB
(
left
,
top
,
right
,
bottom
),
clipOp
,
doAntiAlias
);
}
void
Canvas
::
clipRRect
(
const
RRect
&
rrect
,
bool
doAntiAlias
)
{
...
...
lib/ui/painting/canvas.h
浏览文件 @
0bad812c
...
...
@@ -5,18 +5,18 @@
#ifndef FLUTTER_LIB_UI_PAINTING_CANVAS_H_
#define FLUTTER_LIB_UI_PAINTING_CANVAS_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/paint.h"
#include "flutter/lib/ui/painting/path.h"
#include "flutter/lib/ui/painting/picture.h"
#include "flutter/lib/ui/painting/picture_recorder.h"
#include "flutter/lib/ui/painting/rrect.h"
#include "flutter/lib/ui/painting/vertices.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float32_list.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "lib/tonic/typed_data/int32_list.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/utils/SkShadowUtils.h"
#include "third_party/tonic/typed_data/float32_list.h"
#include "third_party/tonic/typed_data/float64_list.h"
#include "third_party/tonic/typed_data/int32_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -25,8 +25,7 @@ class DartLibraryNatives;
namespace
blink
{
class
CanvasImage
;
class
Canvas
:
public
fxl
::
RefCountedThreadSafe
<
Canvas
>
,
public
tonic
::
DartWrappable
{
class
Canvas
:
public
RefCountedDartWrappable
<
Canvas
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
Canvas
);
...
...
lib/ui/painting/codec.cc
浏览文件 @
0bad812c
...
...
@@ -9,13 +9,13 @@
#include "flutter/lib/ui/painting/frame_info.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/logging.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "lib/tonic/dart_state.h"
#include "lib/tonic/logging/dart_invoke.h"
#include "lib/tonic/typed_data/uint8_list.h"
#include "third_party/skia/include/codec/SkCodec.h"
#include "third_party/skia/include/core/SkPixelRef.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
#include "third_party/tonic/dart_state.h"
#include "third_party/tonic/logging/dart_invoke.h"
#include "third_party/tonic/typed_data/uint8_list.h"
#ifdef ERROR
#undef ERROR
...
...
@@ -46,7 +46,7 @@ struct ImageInfo {
static
void
InvokeCodecCallback
(
fxl
::
RefPtr
<
Codec
>
codec
,
std
::
unique_ptr
<
DartPersistentValue
>
callback
,
size_t
trace_id
)
{
tonic
::
DartState
*
dart_state
=
callback
->
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
callback
->
dart_state
().
lock
();
if
(
!
dart_state
)
{
TRACE_FLOW_END
(
"flutter"
,
kInitCodecTraceTag
,
trace_id
);
return
;
...
...
@@ -328,7 +328,7 @@ bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) {
void
InvokeNextFrameCallback
(
fxl
::
RefPtr
<
FrameInfo
>
frameInfo
,
std
::
unique_ptr
<
DartPersistentValue
>
callback
,
size_t
trace_id
)
{
tonic
::
DartState
*
dart_state
=
callback
->
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
callback
->
dart_state
().
lock
();
if
(
!
dart_state
)
{
TRACE_FLOW_END
(
"flutter"
,
kCodecNextFrameTraceTag
,
trace_id
);
return
;
...
...
@@ -473,7 +473,7 @@ Dart_Handle SingleFrameCodec::getNextFrame(Dart_Handle callback_handle) {
auto
callback
=
std
::
make_unique
<
DartPersistentValue
>
(
tonic
::
DartState
::
Current
(),
callback_handle
);
tonic
::
DartState
*
dart_state
=
callback
->
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
callback
->
dart_state
().
lock
();
if
(
!
dart_state
)
{
return
ToDart
(
"Invalid dart state"
);
}
...
...
lib/ui/painting/codec.h
浏览文件 @
0bad812c
...
...
@@ -5,8 +5,8 @@
#ifndef FLUTTER_LIB_UI_PAINTING_CODEC_H_
#define FLUTTER_LIB_UI_PAINTING_CODEC_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/frame_info.h"
#include "lib/tonic/dart_wrappable.h"
#include "third_party/skia/include/codec/SkCodec.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImage.h"
...
...
@@ -22,8 +22,7 @@ namespace blink {
// A handle to an SkCodec object.
//
// Doesn't mirror SkCodec's API but provides a simple sequential access API.
class
Codec
:
public
fxl
::
RefCountedThreadSafe
<
Codec
>
,
public
tonic
::
DartWrappable
{
class
Codec
:
public
RefCountedDartWrappable
<
Codec
>
{
DEFINE_WRAPPERTYPEINFO
();
public:
...
...
lib/ui/painting/frame_info.cc
浏览文件 @
0bad812c
...
...
@@ -5,8 +5,8 @@
#include "flutter/lib/ui/painting/frame_info.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/frame_info.h
浏览文件 @
0bad812c
...
...
@@ -5,8 +5,8 @@
#ifndef FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_
#define FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/image.h"
#include "lib/tonic/dart_wrappable.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -15,8 +15,7 @@ class DartLibraryNatives;
namespace
blink
{
// A single animation frame.
class
FrameInfo
final
:
public
fxl
::
RefCountedThreadSafe
<
FrameInfo
>
,
public
tonic
::
DartWrappable
{
class
FrameInfo
final
:
public
RefCountedDartWrappable
<
FrameInfo
>
{
DEFINE_WRAPPERTYPEINFO
();
public:
...
...
lib/ui/painting/gradient.cc
浏览文件 @
0bad812c
...
...
@@ -6,10 +6,10 @@
#include "flutter/lib/ui/painting/gradient.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/gradient.h
浏览文件 @
0bad812c
...
...
@@ -5,13 +5,13 @@
#ifndef FLUTTER_LIB_UI_PAINTING_GRADIENT_H_
#define FLUTTER_LIB_UI_PAINTING_GRADIENT_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/matrix.h"
#include "flutter/lib/ui/painting/shader.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float32_list.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "lib/tonic/typed_data/int32_list.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
#include "third_party/tonic/typed_data/float32_list.h"
#include "third_party/tonic/typed_data/float64_list.h"
#include "third_party/tonic/typed_data/int32_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
lib/ui/painting/image.cc
浏览文件 @
0bad812c
...
...
@@ -5,10 +5,10 @@
#include "flutter/lib/ui/painting/image.h"
#include "flutter/lib/ui/painting/image_encoding.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/image.h
浏览文件 @
0bad812c
...
...
@@ -6,8 +6,8 @@
#define FLUTTER_LIB_UI_PAINTING_IMAGE_H_
#include "flutter/flow/skia_gpu_object.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "lib/tonic/dart_wrappable.h"
#include "third_party/skia/include/core/SkImage.h"
namespace
tonic
{
...
...
@@ -16,8 +16,7 @@ class DartLibraryNatives;
namespace
blink
{
class
CanvasImage
final
:
public
fxl
::
RefCountedThreadSafe
<
CanvasImage
>
,
public
tonic
::
DartWrappable
{
class
CanvasImage
final
:
public
RefCountedDartWrappable
<
CanvasImage
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
CanvasImage
);
...
...
lib/ui/painting/image_encoding.cc
浏览文件 @
0bad812c
...
...
@@ -13,13 +13,13 @@
#include "flutter/lib/ui/ui_dart_state.h"
#include "lib/fxl/build_config.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/tonic/dart_persistent_value.h"
#include "lib/tonic/logging/dart_invoke.h"
#include "lib/tonic/typed_data/uint8_list.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkEncodedImageFormat.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/tonic/dart_persistent_value.h"
#include "third_party/tonic/logging/dart_invoke.h"
#include "third_party/tonic/typed_data/uint8_list.h"
using
tonic
::
DartInvoke
;
using
tonic
::
DartPersistentValue
;
...
...
@@ -41,7 +41,7 @@ enum ImageByteFormat {
void
InvokeDataCallback
(
std
::
unique_ptr
<
DartPersistentValue
>
callback
,
sk_sp
<
SkData
>
buffer
)
{
tonic
::
DartState
*
dart_state
=
callback
->
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
callback
->
dart_state
().
lock
();
if
(
!
dart_state
)
{
return
;
}
...
...
lib/ui/painting/image_encoding.h
浏览文件 @
0bad812c
...
...
@@ -5,7 +5,7 @@
#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_
#define FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/image_filter.cc
浏览文件 @
0bad812c
...
...
@@ -5,13 +5,13 @@
#include "flutter/lib/ui/painting/image_filter.h"
#include "flutter/lib/ui/painting/matrix.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "third_party/skia/include/effects/SkBlurImageFilter.h"
#include "third_party/skia/include/effects/SkImageSource.h"
#include "third_party/skia/include/effects/SkPictureImageFilter.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/image_filter.h
浏览文件 @
0bad812c
...
...
@@ -5,16 +5,15 @@
#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_FILTER_H_
#define FLUTTER_LIB_UI_PAINTING_IMAGE_FILTER_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/image.h"
#include "flutter/lib/ui/painting/picture.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/tonic/typed_data/float64_list.h"
namespace
blink
{
class
ImageFilter
:
public
fxl
::
RefCountedThreadSafe
<
ImageFilter
>
,
public
tonic
::
DartWrappable
{
class
ImageFilter
:
public
RefCountedDartWrappable
<
ImageFilter
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
ImageFilter
);
...
...
lib/ui/painting/image_shader.cc
浏览文件 @
0bad812c
...
...
@@ -5,10 +5,10 @@
#include "flutter/lib/ui/painting/image_shader.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
using
tonic
::
ToDart
;
...
...
lib/ui/painting/image_shader.h
浏览文件 @
0bad812c
...
...
@@ -5,14 +5,14 @@
#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
#define FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/gradient.h"
#include "flutter/lib/ui/painting/image.h"
#include "flutter/lib/ui/painting/matrix.h"
#include "flutter/lib/ui/painting/shader.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkShader.h"
#include "third_party/tonic/typed_data/float64_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
lib/ui/painting/matrix.h
浏览文件 @
0bad812c
...
...
@@ -5,8 +5,8 @@
#ifndef FLUTTER_LIB_UI_PAINTING_MATRIX_H_
#define FLUTTER_LIB_UI_PAINTING_MATRIX_H_
#include "lib/tonic/typed_data/float64_list.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/tonic/typed_data/float64_list.h"
namespace
blink
{
...
...
lib/ui/painting/paint.cc
浏览文件 @
0bad812c
...
...
@@ -6,11 +6,11 @@
#include "flutter/lib/ui/painting/shader.h"
#include "lib/fxl/logging.h"
#include "lib/tonic/typed_data/dart_byte_data.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkMaskFilter.h"
#include "third_party/skia/include/core/SkShader.h"
#include "third_party/skia/include/core/SkString.h"
#include "third_party/tonic/typed_data/dart_byte_data.h"
namespace
blink
{
...
...
@@ -140,7 +140,9 @@ Paint::Paint(Dart_Handle paint_objects, Dart_Handle paint_data) {
namespace
tonic
{
blink
::
Paint
DartConverter
<
blink
::
Paint
>::
FromArguments
(
Dart_NativeArguments
args
,
int
index
,
Dart_Handle
&
exception
)
{
Dart_NativeArguments
args
,
int
index
,
Dart_Handle
&
exception
)
{
Dart_Handle
paint_objects
=
Dart_GetNativeArgument
(
args
,
index
);
FXL_DCHECK
(
!
LogIfError
(
paint_objects
));
...
...
@@ -151,7 +153,9 @@ blink::Paint DartConverter<blink::Paint>::FromArguments(
}
blink
::
PaintData
DartConverter
<
blink
::
PaintData
>::
FromArguments
(
Dart_NativeArguments
args
,
int
index
,
Dart_Handle
&
exception
)
{
Dart_NativeArguments
args
,
int
index
,
Dart_Handle
&
exception
)
{
return
blink
::
PaintData
();
}
...
...
lib/ui/painting/paint.h
浏览文件 @
0bad812c
...
...
@@ -5,8 +5,8 @@
#ifndef FLUTTER_LIB_UI_PAINTING_PAINT_H_
#define FLUTTER_LIB_UI_PAINTING_PAINT_H_
#include "lib/tonic/converter/dart_converter.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/tonic/converter/dart_converter.h"
namespace
blink
{
...
...
lib/ui/painting/path.cc
浏览文件 @
0bad812c
...
...
@@ -8,10 +8,10 @@
#include <math.h>
#include "flutter/lib/ui/painting/matrix.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
using
tonic
::
ToDart
;
...
...
@@ -213,9 +213,14 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) {
path_
.
addPath
(
path
->
path
(),
dx
,
dy
,
SkPath
::
kAppend_AddPathMode
);
}
void
CanvasPath
::
addPathWithMatrix
(
CanvasPath
*
path
,
double
dx
,
double
dy
,
tonic
::
Float64List
&
matrix4
)
{
if
(
!
path
)
Dart_ThrowException
(
ToDart
(
"Path.addPathWithMatrix called with non-genuine Path."
));
void
CanvasPath
::
addPathWithMatrix
(
CanvasPath
*
path
,
double
dx
,
double
dy
,
tonic
::
Float64List
&
matrix4
)
{
if
(
!
path
)
{
Dart_ThrowException
(
ToDart
(
"Path.addPathWithMatrix called with non-genuine Path."
));
}
SkMatrix
matrix
=
ToSkMatrix
(
matrix4
);
matrix
.
setTranslateX
(
matrix
.
getTranslateX
()
+
dx
);
...
...
@@ -231,9 +236,14 @@ void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) {
path_
.
addPath
(
path
->
path
(),
dx
,
dy
,
SkPath
::
kExtend_AddPathMode
);
}
void
CanvasPath
::
extendWithPathAndMatrix
(
CanvasPath
*
path
,
double
dx
,
double
dy
,
tonic
::
Float64List
&
matrix4
)
{
if
(
!
path
)
Dart_ThrowException
(
ToDart
(
"Path.addPathWithMatrix called with non-genuine Path."
));
void
CanvasPath
::
extendWithPathAndMatrix
(
CanvasPath
*
path
,
double
dx
,
double
dy
,
tonic
::
Float64List
&
matrix4
)
{
if
(
!
path
)
{
Dart_ThrowException
(
ToDart
(
"Path.addPathWithMatrix called with non-genuine Path."
));
}
SkMatrix
matrix
=
ToSkMatrix
(
matrix4
);
matrix
.
setTranslateX
(
matrix
.
getTranslateX
()
+
dx
);
...
...
@@ -277,7 +287,6 @@ tonic::Float32List CanvasPath::getBounds() {
return
rect
;
}
bool
CanvasPath
::
op
(
CanvasPath
*
path1
,
CanvasPath
*
path2
,
int
operation
)
{
return
Op
(
path1
->
path
(),
path2
->
path
(),
(
SkPathOp
)
operation
,
&
path_
);
}
...
...
lib/ui/painting/path.h
浏览文件 @
0bad812c
...
...
@@ -5,12 +5,12 @@
#ifndef FLUTTER_LIB_UI_PAINTING_PATH_H_
#define FLUTTER_LIB_UI_PAINTING_PATH_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/rrect.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float32_list.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/pathops/SkPathOps.h"
#include "third_party/tonic/typed_data/float32_list.h"
#include "third_party/tonic/typed_data/float64_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -18,8 +18,7 @@ class DartLibraryNatives;
namespace
blink
{
class
CanvasPath
:
public
fxl
::
RefCountedThreadSafe
<
CanvasPath
>
,
public
tonic
::
DartWrappable
{
class
CanvasPath
:
public
RefCountedDartWrappable
<
CanvasPath
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
CanvasPath
);
...
...
lib/ui/painting/path_measure.cc
浏览文件 @
0bad812c
...
...
@@ -8,10 +8,10 @@
#include <math.h>
#include "flutter/lib/ui/painting/matrix.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
using
tonic
::
ToDart
;
...
...
lib/ui/painting/path_measure.h
浏览文件 @
0bad812c
...
...
@@ -5,11 +5,11 @@
#ifndef FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_
#define FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/path.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkPathMeasure.h"
#include "third_party/tonic/typed_data/float64_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -20,19 +20,21 @@ class DartLibraryNatives;
namespace
blink
{
class
CanvasPathMeasure
:
public
fxl
::
RefCountedThreadSafe
<
CanvasPathMeasure
>
,
public
tonic
::
DartWrappable
{
class
CanvasPathMeasure
:
public
RefCountedDartWrappable
<
CanvasPathMeasure
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
CanvasPathMeasure
);
public:
~
CanvasPathMeasure
()
override
;
static
fxl
::
RefPtr
<
CanvasPathMeasure
>
Create
(
const
CanvasPath
*
path
,
bool
forceClosed
);
static
fxl
::
RefPtr
<
CanvasPathMeasure
>
Create
(
const
CanvasPath
*
path
,
bool
forceClosed
);
void
setPath
(
const
CanvasPath
*
path
,
bool
isClosed
);
float
getLength
();
tonic
::
Float32List
getPosTan
(
float
distance
);
fxl
::
RefPtr
<
CanvasPath
>
getSegment
(
float
startD
,
float
stopD
,
bool
startWithMoveTo
);
fxl
::
RefPtr
<
CanvasPath
>
getSegment
(
float
startD
,
float
stopD
,
bool
startWithMoveTo
);
bool
isClosed
();
bool
nextContour
();
...
...
lib/ui/painting/picture.cc
浏览文件 @
0bad812c
...
...
@@ -6,11 +6,11 @@
#include "flutter/lib/ui/painting/canvas.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/picture.h
浏览文件 @
0bad812c
...
...
@@ -6,8 +6,8 @@
#define FLUTTER_LIB_UI_PAINTING_PICTURE_H_
#include "flutter/flow/skia_gpu_object.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/image.h"
#include "lib/tonic/dart_wrappable.h"
#include "third_party/skia/include/core/SkPicture.h"
namespace
tonic
{
...
...
@@ -17,8 +17,7 @@ class DartLibraryNatives;
namespace
blink
{
class
Canvas
;
class
Picture
:
public
fxl
::
RefCountedThreadSafe
<
Picture
>
,
public
tonic
::
DartWrappable
{
class
Picture
:
public
RefCountedDartWrappable
<
Picture
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
Picture
);
...
...
lib/ui/painting/picture_recorder.cc
浏览文件 @
0bad812c
...
...
@@ -6,10 +6,10 @@
#include "flutter/lib/ui/painting/canvas.h"
#include "flutter/lib/ui/painting/picture.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/picture_recorder.h
浏览文件 @
0bad812c
...
...
@@ -5,7 +5,7 @@
#ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_RECORDER_H_
#define FLUTTER_LIB_UI_PAINTING_PICTURE_RECORDER_H_
#include "
lib/tonic/dart_wrappable
.h"
#include "
flutter/lib/ui/dart_wrapper
.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
namespace
tonic
{
...
...
@@ -16,8 +16,7 @@ namespace blink {
class
Canvas
;
class
Picture
;
class
PictureRecorder
:
public
fxl
::
RefCountedThreadSafe
<
PictureRecorder
>
,
public
tonic
::
DartWrappable
{
class
PictureRecorder
:
public
RefCountedDartWrappable
<
PictureRecorder
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
PictureRecorder
);
...
...
lib/ui/painting/rrect.cc
浏览文件 @
0bad812c
...
...
@@ -5,8 +5,8 @@
#include "flutter/lib/ui/painting/rrect.h"
#include "lib/fxl/logging.h"
#include "
lib
/tonic/logging/dart_error.h"
#include "
lib
/tonic/typed_data/float32_list.h"
#include "
third_party
/tonic/logging/dart_error.h"
#include "
third_party
/tonic/typed_data/float32_list.h"
using
namespace
blink
;
...
...
lib/ui/painting/rrect.h
浏览文件 @
0bad812c
...
...
@@ -5,9 +5,9 @@
#ifndef FLUTTER_LIB_UI_PAINTING_RRECT_H_
#define FLUTTER_LIB_UI_PAINTING_RRECT_H_
#include "lib/tonic/converter/dart_converter.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/tonic/converter/dart_converter.h"
namespace
blink
{
...
...
lib/ui/painting/shader.h
浏览文件 @
0bad812c
...
...
@@ -6,14 +6,13 @@
#define FLUTTER_LIB_UI_PAINTING_SHADER_H_
#include "flutter/flow/skia_gpu_object.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "lib/tonic/dart_wrappable.h"
#include "third_party/skia/include/core/SkShader.h"
namespace
blink
{
class
Shader
:
public
fxl
::
RefCountedThreadSafe
<
Shader
>
,
public
tonic
::
DartWrappable
{
class
Shader
:
public
RefCountedDartWrappable
<
Shader
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
Shader
);
...
...
lib/ui/painting/vertices.cc
浏览文件 @
0bad812c
...
...
@@ -4,8 +4,8 @@
#include "flutter/lib/ui/painting/vertices.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
lib/ui/painting/vertices.h
浏览文件 @
0bad812c
...
...
@@ -5,10 +5,10 @@
#ifndef FLUTTER_LIB_UI_PAINTING_VERTICES_H_
#define FLUTTER_LIB_UI_PAINTING_VERTICES_H_
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float32_list.h"
#include "lib/tonic/typed_data/int32_list.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "third_party/skia/include/core/SkVertices.h"
#include "third_party/tonic/typed_data/float32_list.h"
#include "third_party/tonic/typed_data/int32_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -16,8 +16,7 @@ class DartLibraryNatives;
namespace
blink
{
class
Vertices
:
public
fxl
::
RefCountedThreadSafe
<
Vertices
>
,
public
tonic
::
DartWrappable
{
class
Vertices
:
public
RefCountedDartWrappable
<
Vertices
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
Vertices
);
...
...
lib/ui/plugins/callback_cache.cc
浏览文件 @
0bad812c
...
...
@@ -4,7 +4,7 @@
#include "flutter/lib/ui/plugins/callback_cache.h"
#include "lib/fxl/logging.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/converter/dart_converter.h"
using
tonic
::
ToDart
;
...
...
lib/ui/semantics/custom_accessibility_action.h
浏览文件 @
0bad812c
...
...
@@ -5,10 +5,10 @@
#ifndef FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_
#define FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_
#include "
lib
/tonic/dart_library_natives.h"
#include "
lib
/tonic/dart_wrappable.h"
#include "
lib
/tonic/typed_data/float64_list.h"
#include "
lib
/tonic/typed_data/int32_list.h"
#include "
third_party
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/dart_wrappable.h"
#include "
third_party
/tonic/typed_data/float64_list.h"
#include "
third_party
/tonic/typed_data/int32_list.h"
namespace
blink
{
...
...
lib/ui/semantics/semantics_update.cc
浏览文件 @
0bad812c
...
...
@@ -7,10 +7,10 @@
#include <memory>
#include "flutter/lib/ui/painting/matrix.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
@@ -23,7 +23,8 @@ DART_BIND_ALL(SemanticsUpdate, FOR_EACH_BINDING)
fxl
::
RefPtr
<
SemanticsUpdate
>
SemanticsUpdate
::
create
(
SemanticsNodeUpdates
nodes
,
CustomAccessibilityActionUpdates
actions
)
{
return
fxl
::
MakeRefCounted
<
SemanticsUpdate
>
(
std
::
move
(
nodes
),
std
::
move
(
actions
));
return
fxl
::
MakeRefCounted
<
SemanticsUpdate
>
(
std
::
move
(
nodes
),
std
::
move
(
actions
));
}
SemanticsUpdate
::
SemanticsUpdate
(
SemanticsNodeUpdates
nodes
,
...
...
lib/ui/semantics/semantics_update.h
浏览文件 @
0bad812c
...
...
@@ -5,9 +5,9 @@
#ifndef FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_
#define FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_
#include "flutter/lib/ui/
semantics/semantics_node
.h"
#include "flutter/lib/ui/
dart_wrapper
.h"
#include "flutter/lib/ui/semantics/custom_accessibility_action.h"
#include "
lib/tonic/dart_wrappabl
e.h"
#include "
flutter/lib/ui/semantics/semantics_nod
e.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -15,15 +15,15 @@ class DartLibraryNatives;
namespace
blink
{
class
SemanticsUpdate
:
public
fxl
::
RefCountedThreadSafe
<
SemanticsUpdate
>
,
public
tonic
::
DartWrappable
{
class
SemanticsUpdate
:
public
RefCountedDartWrappable
<
SemanticsUpdate
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
SemanticsUpdate
);
public:
~
SemanticsUpdate
()
override
;
static
fxl
::
RefPtr
<
SemanticsUpdate
>
create
(
SemanticsNodeUpdates
nodes
,
CustomAccessibilityActionUpdates
actions
);
static
fxl
::
RefPtr
<
SemanticsUpdate
>
create
(
SemanticsNodeUpdates
nodes
,
CustomAccessibilityActionUpdates
actions
);
SemanticsNodeUpdates
takeNodes
();
...
...
lib/ui/semantics/semantics_update_builder.cc
浏览文件 @
0bad812c
...
...
@@ -4,10 +4,10 @@
#include "flutter/lib/ui/semantics/semantics_update_builder.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
namespace
blink
{
...
...
@@ -17,8 +17,8 @@ static void SemanticsUpdateBuilder_constructor(Dart_NativeArguments args) {
IMPLEMENT_WRAPPERTYPEINFO
(
ui
,
SemanticsUpdateBuilder
);
#define FOR_EACH_BINDING(V) \
V(SemanticsUpdateBuilder, updateNode) \
#define FOR_EACH_BINDING(V)
\
V(SemanticsUpdateBuilder, updateNode)
\
V(SemanticsUpdateBuilder, updateCustomAction) \
V(SemanticsUpdateBuilder, build)
...
...
@@ -35,28 +35,29 @@ SemanticsUpdateBuilder::SemanticsUpdateBuilder() = default;
SemanticsUpdateBuilder
::~
SemanticsUpdateBuilder
()
=
default
;
void
SemanticsUpdateBuilder
::
updateNode
(
int
id
,
int
flags
,
int
actions
,
int
textSelectionBase
,
int
textSelectionExtent
,
double
scrollPosition
,
double
scrollExtentMax
,
double
scrollExtentMin
,
double
left
,
double
top
,
double
right
,
double
bottom
,
std
::
string
label
,
std
::
string
hint
,
std
::
string
value
,
std
::
string
increasedValue
,
std
::
string
decreasedValue
,
int
textDirection
,
const
tonic
::
Float64List
&
transform
,
const
tonic
::
Int32List
&
childrenInTraversalOrder
,
const
tonic
::
Int32List
&
childrenInHitTestOrder
,
const
tonic
::
Int32List
&
localContextActions
)
{
void
SemanticsUpdateBuilder
::
updateNode
(
int
id
,
int
flags
,
int
actions
,
int
textSelectionBase
,
int
textSelectionExtent
,
double
scrollPosition
,
double
scrollExtentMax
,
double
scrollExtentMin
,
double
left
,
double
top
,
double
right
,
double
bottom
,
std
::
string
label
,
std
::
string
hint
,
std
::
string
value
,
std
::
string
increasedValue
,
std
::
string
decreasedValue
,
int
textDirection
,
const
tonic
::
Float64List
&
transform
,
const
tonic
::
Int32List
&
childrenInTraversalOrder
,
const
tonic
::
Int32List
&
childrenInHitTestOrder
,
const
tonic
::
Int32List
&
localContextActions
)
{
SemanticsNode
node
;
node
.
id
=
id
;
node
.
flags
=
flags
;
...
...
@@ -74,17 +75,20 @@ void SemanticsUpdateBuilder::updateNode(int id,
node
.
decreasedValue
=
decreasedValue
;
node
.
textDirection
=
textDirection
;
node
.
transform
.
setColMajord
(
transform
.
data
());
node
.
childrenInTraversalOrder
=
std
::
vector
<
int32_t
>
(
childrenInTraversalOrder
.
data
(),
childrenInTraversalOrder
.
data
()
+
childrenInTraversalOrder
.
num_elements
());
node
.
childrenInTraversalOrder
=
std
::
vector
<
int32_t
>
(
childrenInTraversalOrder
.
data
(),
childrenInTraversalOrder
.
data
()
+
childrenInTraversalOrder
.
num_elements
());
node
.
childrenInHitTestOrder
=
std
::
vector
<
int32_t
>
(
childrenInHitTestOrder
.
data
(),
childrenInHitTestOrder
.
data
()
+
childrenInHitTestOrder
.
num_elements
());
childrenInHitTestOrder
.
data
(),
childrenInHitTestOrder
.
data
()
+
childrenInHitTestOrder
.
num_elements
());
node
.
customAccessibilityActions
=
std
::
vector
<
int32_t
>
(
localContextActions
.
data
(),
localContextActions
.
data
()
+
localContextActions
.
num_elements
());
localContextActions
.
data
(),
localContextActions
.
data
()
+
localContextActions
.
num_elements
());
nodes_
[
id
]
=
node
;
}
void
SemanticsUpdateBuilder
::
updateCustomAction
(
int
id
,
std
::
string
label
)
{
void
SemanticsUpdateBuilder
::
updateCustomAction
(
int
id
,
std
::
string
label
)
{
CustomAccessibilityAction
action
;
action
.
id
=
id
;
action
.
label
=
label
;
...
...
lib/ui/semantics/semantics_update_builder.h
浏览文件 @
0bad812c
...
...
@@ -5,16 +5,15 @@
#ifndef FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_BUILDER_H_
#define FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_BUILDER_H_
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/semantics/semantics_update.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/float64_list.h"
#include "lib/tonic/typed_data/int32_list.h"
#include "third_party/tonic/typed_data/float64_list.h"
#include "third_party/tonic/typed_data/int32_list.h"
namespace
blink
{
class
SemanticsUpdateBuilder
:
public
fxl
::
RefCountedThreadSafe
<
SemanticsUpdateBuilder
>
,
public
tonic
::
DartWrappable
{
:
public
RefCountedDartWrappable
<
SemanticsUpdateBuilder
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
SemanticsUpdateBuilder
);
...
...
lib/ui/text/paragraph.cc
浏览文件 @
0bad812c
...
...
@@ -8,10 +8,10 @@
#include "flutter/common/task_runners.h"
#include "lib/fxl/logging.h"
#include "lib/fxl/tasks/task_runner.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_binding_macros.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_binding_macros.h"
#include "
third_party
/tonic/dart_library_natives.h"
using
tonic
::
ToDart
;
...
...
lib/ui/text/paragraph.h
浏览文件 @
0bad812c
...
...
@@ -6,12 +6,12 @@
#define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_
#include "flutter/fml/message_loop.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/canvas.h"
#include "flutter/lib/ui/text/paragraph_impl.h"
#include "flutter/lib/ui/text/paragraph_impl_txt.h"
#include "flutter/lib/ui/text/text_box.h"
#include "flutter/third_party/txt/src/txt/paragraph.h"
#include "lib/tonic/dart_wrappable.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -19,8 +19,7 @@ class DartLibraryNatives;
namespace
blink
{
class
Paragraph
:
public
fxl
::
RefCountedThreadSafe
<
Paragraph
>
,
public
tonic
::
DartWrappable
{
class
Paragraph
:
public
RefCountedDartWrappable
<
Paragraph
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
Paragraph
);
...
...
lib/ui/text/paragraph_builder.cc
浏览文件 @
0bad812c
...
...
@@ -15,11 +15,11 @@
#include "flutter/third_party/txt/src/txt/text_decoration.h"
#include "flutter/third_party/txt/src/txt/text_style.h"
#include "lib/fxl/tasks/task_runner.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_args.h"
#include "lib/tonic/dart_binding_macros.h"
#include "lib/tonic/dart_library_natives.h"
#include "third_party/icu/source/common/unicode/ustring.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_args.h"
#include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h"
namespace
blink
{
namespace
{
...
...
lib/ui/text/paragraph_builder.h
浏览文件 @
0bad812c
...
...
@@ -6,11 +6,11 @@
#define FLUTTER_LIB_UI_TEXT_PARAGRAPH_BUILDER_H_
#include <memory>
#include "flutter/lib/ui/dart_wrapper.h"
#include "flutter/lib/ui/painting/paint.h"
#include "flutter/lib/ui/text/paragraph.h"
#include "flutter/third_party/txt/src/txt/paragraph_builder.h"
#include "lib/tonic/dart_wrappable.h"
#include "lib/tonic/typed_data/int32_list.h"
#include "third_party/tonic/typed_data/int32_list.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
@@ -20,8 +20,7 @@ namespace blink {
class
Paragraph
;
class
ParagraphBuilder
:
public
fxl
::
RefCountedThreadSafe
<
ParagraphBuilder
>
,
public
tonic
::
DartWrappable
{
class
ParagraphBuilder
:
public
RefCountedDartWrappable
<
ParagraphBuilder
>
{
DEFINE_WRAPPERTYPEINFO
();
FRIEND_MAKE_REF_COUNTED
(
ParagraphBuilder
);
...
...
lib/ui/text/paragraph_impl_txt.cc
浏览文件 @
0bad812c
...
...
@@ -9,8 +9,8 @@
#include "flutter/lib/ui/text/paragraph_impl.h"
#include "lib/fxl/logging.h"
#include "lib/fxl/tasks/task_runner.h"
#include "lib/tonic/converter/dart_converter.h"
#include "third_party/skia/include/core/SkPoint.h"
#include "third_party/tonic/converter/dart_converter.h"
using
tonic
::
ToDart
;
...
...
lib/ui/text/text_box.cc
浏览文件 @
0bad812c
...
...
@@ -5,9 +5,9 @@
#include "flutter/lib/ui/text/text_box.h"
#include "lib/fxl/logging.h"
#include "
lib
/tonic/dart_class_library.h"
#include "
lib
/tonic/dart_state.h"
#include "
lib
/tonic/logging/dart_error.h"
#include "
third_party
/tonic/dart_class_library.h"
#include "
third_party
/tonic/dart_state.h"
#include "
third_party
/tonic/logging/dart_error.h"
using
namespace
blink
;
...
...
lib/ui/text/text_box.h
浏览文件 @
0bad812c
...
...
@@ -5,9 +5,9 @@
#ifndef FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_
#define FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_
#include "lib/tonic/converter/dart_converter.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/tonic/converter/dart_converter.h"
namespace
blink
{
...
...
lib/ui/ui_dart_state.cc
浏览文件 @
0bad812c
...
...
@@ -6,8 +6,8 @@
#include "flutter/fml/message_loop.h"
#include "flutter/lib/ui/window/window.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_message_handler.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_message_handler.h"
using
tonic
::
ToDart
;
...
...
lib/ui/ui_dart_state.h
浏览文件 @
0bad812c
...
...
@@ -15,11 +15,11 @@
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h"
#include "lib/fxl/build_config.h"
#include "lib/tonic/dart_microtask_queue.h"
#include "lib/tonic/dart_persistent_value.h"
#include "lib/tonic/dart_state.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/tonic/dart_microtask_queue.h"
#include "third_party/tonic/dart_persistent_value.h"
#include "third_party/tonic/dart_state.h"
namespace
blink
{
class
FontSelector
;
...
...
lib/ui/window/platform_message_response_dart.cc
浏览文件 @
0bad812c
...
...
@@ -9,8 +9,8 @@
#include "flutter/common/task_runners.h"
#include "flutter/lib/ui/window/window.h"
#include "lib/fxl/functional/make_copyable.h"
#include "
lib
/tonic/dart_state.h"
#include "
lib
/tonic/logging/dart_invoke.h"
#include "
third_party
/tonic/dart_state.h"
#include "
third_party
/tonic/logging/dart_invoke.h"
namespace
blink
{
...
...
@@ -55,10 +55,8 @@ PlatformMessageResponseDart::PlatformMessageResponseDart(
PlatformMessageResponseDart
::~
PlatformMessageResponseDart
()
{
if
(
!
callback_
.
is_empty
())
{
ui_task_runner_
->
PostTask
(
fxl
::
MakeCopyable
([
callback
=
std
::
move
(
callback_
)]()
mutable
{
callback
.
Clear
();
}));
ui_task_runner_
->
PostTask
(
fxl
::
MakeCopyable
(
[
callback
=
std
::
move
(
callback_
)]()
mutable
{
callback
.
Clear
();
}));
}
}
...
...
@@ -68,8 +66,9 @@ void PlatformMessageResponseDart::Complete(std::unique_ptr<fml::Mapping> data) {
FXL_DCHECK
(
!
is_complete_
);
is_complete_
=
true
;
ui_task_runner_
->
PostTask
(
fxl
::
MakeCopyable
(
[
callback
=
std
::
move
(
callback_
),
data
=
std
::
move
(
data
)
]()
mutable
{
tonic
::
DartState
*
dart_state
=
callback
.
dart_state
().
get
();
[
callback
=
std
::
move
(
callback_
),
data
=
std
::
move
(
data
)]()
mutable
{
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
callback
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -86,7 +85,8 @@ void PlatformMessageResponseDart::CompleteEmpty() {
is_complete_
=
true
;
ui_task_runner_
->
PostTask
(
fxl
::
MakeCopyable
([
callback
=
std
::
move
(
callback_
)]()
mutable
{
tonic
::
DartState
*
dart_state
=
callback
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
callback
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
lib/ui/window/platform_message_response_dart.h
浏览文件 @
0bad812c
...
...
@@ -7,7 +7,7 @@
#include "flutter/fml/message_loop.h"
#include "flutter/lib/ui/window/platform_message_response.h"
#include "
lib
/tonic/dart_persistent_value.h"
#include "
third_party
/tonic/dart_persistent_value.h"
namespace
blink
{
...
...
lib/ui/window/window.cc
浏览文件 @
0bad812c
...
...
@@ -7,12 +7,12 @@
#include "flutter/lib/ui/compositing/scene.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "flutter/lib/ui/window/platform_message_response_dart.h"
#include "
lib
/tonic/converter/dart_converter.h"
#include "
lib
/tonic/dart_args.h"
#include "
lib
/tonic/dart_library_natives.h"
#include "
lib
/tonic/dart_microtask_queue.h"
#include "
lib
/tonic/logging/dart_invoke.h"
#include "
lib
/tonic/typed_data/dart_byte_data.h"
#include "
third_party
/tonic/converter/dart_converter.h"
#include "
third_party
/tonic/dart_args.h"
#include "
third_party
/tonic/dart_library_natives.h"
#include "
third_party
/tonic/dart_microtask_queue.h"
#include "
third_party
/tonic/logging/dart_invoke.h"
#include "
third_party
/tonic/typed_data/dart_byte_data.h"
using
tonic
::
DartInvokeField
;
using
tonic
::
DartState
;
...
...
@@ -142,7 +142,7 @@ void Window::DidCreateIsolate() {
void
Window
::
UpdateWindowMetrics
(
const
ViewportMetrics
&
metrics
)
{
viewport_metrics_
=
metrics
;
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -164,7 +164,7 @@ void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) {
void
Window
::
UpdateLocale
(
const
std
::
string
&
language_code
,
const
std
::
string
&
country_code
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -177,7 +177,7 @@ void Window::UpdateLocale(const std::string& language_code,
}
void
Window
::
UpdateUserSettingsData
(
const
std
::
string
&
data
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -189,7 +189,7 @@ void Window::UpdateUserSettingsData(const std::string& data) {
}
void
Window
::
UpdateSemanticsEnabled
(
bool
enabled
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -199,7 +199,7 @@ void Window::UpdateSemanticsEnabled(bool enabled) {
}
void
Window
::
UpdateAssistiveTechnologyEnabled
(
bool
enabled
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -209,7 +209,7 @@ void Window::UpdateAssistiveTechnologyEnabled(bool enabled) {
}
void
Window
::
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -230,7 +230,7 @@ void Window::DispatchPlatformMessage(fxl::RefPtr<PlatformMessage> message) {
}
void
Window
::
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -245,7 +245,7 @@ void Window::DispatchPointerDataPacket(const PointerDataPacket& packet) {
void
Window
::
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
@@ -261,7 +261,7 @@ void Window::DispatchSemanticsAction(int32_t id,
}
void
Window
::
BeginFrame
(
fxl
::
TimePoint
frameTime
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
std
::
shared_ptr
<
tonic
::
DartState
>
dart_state
=
library_
.
dart_state
().
lock
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
...
...
lib/ui/window/window.h
浏览文件 @
0bad812c
...
...
@@ -12,8 +12,8 @@
#include "flutter/lib/ui/window/pointer_data_packet.h"
#include "flutter/lib/ui/window/viewport_metrics.h"
#include "lib/fxl/time/time_point.h"
#include "lib/tonic/dart_persistent_value.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/tonic/dart_persistent_value.h"
namespace
tonic
{
class
DartLibraryNatives
;
...
...
runtime/BUILD.gn
浏览文件 @
0bad812c
...
...
@@ -99,7 +99,7 @@ source_set("runtime") {
"//third_party/dart/runtime/bin:embedded_dart_io",
"//third_party/rapidjson",
"//third_party/skia",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
public_configs = [ "$flutter_root:config" ]
...
...
@@ -134,7 +134,7 @@ executable("runtime_unittests") {
"//garnet/public/lib/fxl",
"//third_party/dart/runtime:libdart_jit",
"//third_party/skia",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
if (is_linux) {
...
...
runtime/dart_isolate.cc
浏览文件 @
0bad812c
...
...
@@ -14,17 +14,17 @@
#include "flutter/runtime/dart_service_isolate.h"
#include "flutter/runtime/dart_vm.h"
#include "lib/fxl/files/path.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_class_library.h"
#include "lib/tonic/dart_class_provider.h"
#include "lib/tonic/dart_message_handler.h"
#include "lib/tonic/dart_state.h"
#include "lib/tonic/dart_sticky_error.h"
#include "lib/tonic/file_loader/file_loader.h"
#include "lib/tonic/scopes/dart_api_scope.h"
#include "lib/tonic/scopes/dart_isolate_scope.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/dart/runtime/include/dart_tools_api.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_class_library.h"
#include "third_party/tonic/dart_class_provider.h"
#include "third_party/tonic/dart_message_handler.h"
#include "third_party/tonic/dart_state.h"
#include "third_party/tonic/dart_sticky_error.h"
#include "third_party/tonic/file_loader/file_loader.h"
#include "third_party/tonic/scopes/dart_api_scope.h"
#include "third_party/tonic/scopes/dart_isolate_scope.h"
#ifdef ERROR
#undef ERROR
...
...
@@ -32,7 +32,7 @@
namespace
blink
{
fml
::
WeakP
tr
<
DartIsolate
>
DartIsolate
::
CreateRootIsolate
(
std
::
weak_p
tr
<
DartIsolate
>
DartIsolate
::
CreateRootIsolate
(
DartVM
*
vm
,
fxl
::
RefPtr
<
DartSnapshot
>
isolate_snapshot
,
fxl
::
RefPtr
<
DartSnapshot
>
shared_snapshot
,
...
...
@@ -45,25 +45,26 @@ fml::WeakPtr<DartIsolate> DartIsolate::CreateRootIsolate(
Dart_IsolateFlags
*
flags
)
{
TRACE_EVENT0
(
"flutter"
,
"DartIsolate::CreateRootIsolate"
);
Dart_Isolate
vm_isolate
=
nullptr
;
fml
::
WeakP
tr
<
DartIsolate
>
embedder_isolate
;
std
::
weak_p
tr
<
DartIsolate
>
embedder_isolate
;
char
*
error
=
nullptr
;
// Since this is the root isolate, we fake a parent embedder data object. We
// cannot use unique_ptr here because the destructor is private (since the
// isolate lifecycle is entirely managed by the VM).
auto
root_embedder_data
=
std
::
make_unique
<
DartIsolate
>
(
vm
,
// VM
std
::
move
(
isolate_snapshot
),
// isolate snapshot
std
::
move
(
shared_snapshot
),
// shared snapshot
task_runners
,
// task runners
std
::
move
(
resource_context
),
// resource context
std
::
move
(
unref_queue
),
// skia unref queue
advisory_script_uri
,
// advisory URI
advisory_script_entrypoint
,
// advisory entrypoint
nullptr
// child isolate preparer will be set when this isolate is
// prepared to run
);
auto
root_embedder_data
=
std
::
make_unique
<
std
::
shared_ptr
<
DartIsolate
>>
(
std
::
make_shared
<
DartIsolate
>
(
vm
,
// VM
std
::
move
(
isolate_snapshot
),
// isolate snapshot
std
::
move
(
shared_snapshot
),
// shared snapshot
task_runners
,
// task runners
std
::
move
(
resource_context
),
// resource context
std
::
move
(
unref_queue
),
// skia unref queue
advisory_script_uri
,
// advisory URI
advisory_script_entrypoint
,
// advisory entrypoint
nullptr
// child isolate preparer will be set when this isolate is
// prepared to run
));
std
::
tie
(
vm_isolate
,
embedder_isolate
)
=
CreateDartVMAndEmbedderObjectPair
(
advisory_script_uri
.
c_str
(),
// advisory script URI
...
...
@@ -84,9 +85,11 @@ fml::WeakPtr<DartIsolate> DartIsolate::CreateRootIsolate(
return
{};
}
if
(
embedder_isolate
)
{
std
::
shared_ptr
<
DartIsolate
>
shared_embedder_isolate
=
embedder_isolate
.
lock
();
if
(
shared_embedder_isolate
)
{
// Only root isolates can interact with windows.
embedder_isolate
->
SetWindow
(
std
::
move
(
window
));
shared_
embedder_isolate
->
SetWindow
(
std
::
move
(
window
));
}
root_embedder_data
.
release
();
...
...
@@ -115,8 +118,7 @@ DartIsolate::DartIsolate(DartVM* vm,
vm_
(
vm
),
isolate_snapshot_
(
std
::
move
(
isolate_snapshot
)),
shared_snapshot_
(
std
::
move
(
shared_snapshot
)),
child_isolate_preparer_
(
std
::
move
(
child_isolate_preparer
)),
weak_factory_
(
std
::
make_unique
<
fml
::
WeakPtrFactory
<
DartIsolate
>>
(
this
))
{
child_isolate_preparer_
(
std
::
move
(
child_isolate_preparer
))
{
FXL_DCHECK
(
isolate_snapshot_
)
<<
"Must contain a valid isolate snapshot."
;
if
(
vm_
==
nullptr
)
{
...
...
@@ -150,7 +152,9 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) {
return
false
;
}
if
(
Dart_IsolateData
(
dart_isolate
)
!=
this
)
{
auto
isolate_data
=
static_cast
<
std
::
shared_ptr
<
DartIsolate
>*>
(
Dart_IsolateData
(
dart_isolate
));
if
(
isolate_data
->
get
()
!=
this
)
{
return
false
;
}
...
...
@@ -168,8 +172,12 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) {
if
(
is_root_isolate
)
{
if
(
auto
task_runner
=
GetTaskRunners
().
GetUITaskRunner
())
{
// Isolates may not have any particular thread affinity. Only initialize
// the message handler if a task runner is explicitly specified.
message_handler
().
Initialize
(
task_runner
);
// the task dispatcher if a task runner is explicitly specified.
tonic
::
DartMessageHandler
::
TaskDispatcher
dispatcher
=
[
task_runner
](
std
::
function
<
void
()
>
task
)
{
task_runner
->
PostTask
(
task
);
};
message_handler
().
Initialize
(
dispatcher
);
}
}
...
...
@@ -576,7 +584,7 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(
flags
->
load_vmservice_library
=
true
;
fml
::
WeakP
tr
<
DartIsolate
>
weak_service_isolate
=
std
::
weak_p
tr
<
DartIsolate
>
weak_service_isolate
=
DartIsolate
::
CreateRootIsolate
(
vm
.
get
(),
// vm
vm
->
GetIsolateSnapshot
(),
// isolate snapshot
...
...
@@ -593,7 +601,8 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(
flags
// flags
);
if
(
!
weak_service_isolate
)
{
std
::
shared_ptr
<
DartIsolate
>
service_isolate
=
weak_service_isolate
.
lock
();
if
(
!
service_isolate
)
{
*
error
=
strdup
(
"Could not create the service isolate."
);
FXL_DLOG
(
ERROR
)
<<
*
error
;
return
nullptr
;
...
...
@@ -602,13 +611,6 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(
// The engine never holds a strong reference to the VM service isolate. Since
// we are about to lose our last weak reference to it, start the VM service
// while we have this reference.
DartIsolate
*
service_isolate
=
weak_service_isolate
.
get
();
// The service isolate is created and destroyed on arbitrary Dart pool threads
// and can not support a weak pointer factory that must be bound to a specific
// thread.
service_isolate
->
ResetWeakPtrFactory
();
const
bool
isolate_snapshot_is_dart_2
=
Dart_IsDart2Snapshot
(
vm
->
GetIsolateSnapshot
()
->
GetData
()
->
GetSnapshotPointer
());
const
bool
is_preview_dart2
=
...
...
@@ -642,7 +644,7 @@ Dart_Isolate DartIsolate::DartIsolateCreateCallback(
const
char
*
package_root
,
const
char
*
package_config
,
Dart_IsolateFlags
*
flags
,
DartIsolate
*
parent_embedder_isolate
,
std
::
shared_ptr
<
DartIsolate
>
*
parent_embedder_isolate
,
char
**
error
)
{
if
(
parent_embedder_isolate
==
nullptr
&&
strcmp
(
advisory_script_uri
,
DART_VM_SERVICE_ISOLATE_NAME
)
==
0
)
{
...
...
@@ -673,28 +675,30 @@ Dart_Isolate DartIsolate::DartIsolateCreateCallback(
.
first
;
}
std
::
pair
<
Dart_Isolate
,
fml
::
WeakP
tr
<
DartIsolate
>>
std
::
pair
<
Dart_Isolate
,
std
::
weak_p
tr
<
DartIsolate
>>
DartIsolate
::
CreateDartVMAndEmbedderObjectPair
(
const
char
*
advisory_script_uri
,
const
char
*
advisory_script_entrypoint
,
const
char
*
package_root
,
const
char
*
package_config
,
Dart_IsolateFlags
*
flags
,
DartIsolate
*
p_parent_embedder_isolate
,
std
::
shared_ptr
<
DartIsolate
>
*
p_parent_embedder_isolate
,
bool
is_root_isolate
,
char
**
error
)
{
TRACE_EVENT0
(
"flutter"
,
"DartIsolate::CreateDartVMAndEmbedderObjectPair"
);
std
::
unique_ptr
<
DartIsolate
>
embedder_isolate
{
p_parent_embedder_isolate
};
std
::
unique_ptr
<
std
::
shared_ptr
<
DartIsolate
>>
embedder_isolate
(
p_parent_embedder_isolate
);
if
(
embedder_isolate
==
nullptr
||
embedder_isolate
->
GetDartVM
()
==
nullptr
)
{
if
(
embedder_isolate
==
nullptr
||
(
*
embedder_isolate
)
->
GetDartVM
()
==
nullptr
)
{
*
error
=
strdup
(
"Parent isolate did not have embedder specific callback data."
);
FXL_DLOG
(
ERROR
)
<<
*
error
;
return
{
nullptr
,
{}};
}
DartVM
*
const
vm
=
embedder_isolate
->
GetDartVM
();
DartVM
*
const
vm
=
(
*
embedder_isolate
)
->
GetDartVM
();
if
(
!
is_root_isolate
)
{
auto
raw_embedder_isolate
=
embedder_isolate
.
release
();
...
...
@@ -702,17 +706,17 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(
blink
::
TaskRunners
null_task_runners
(
advisory_script_uri
,
nullptr
,
nullptr
,
nullptr
,
nullptr
);
embedder_isolate
=
std
::
make_unique
<
DartIsolate
>
(
vm
,
// vm
raw_embedder_isolate
->
GetIsolateSnapshot
(),
// isolate_snapshot
raw_embedder_isolate
->
GetSharedSnapshot
(),
// shared
_snapshot
null_task_runners
,
// task_runners
fml
::
WeakPtr
<
GrContext
>
{},
// resource_context
nullptr
,
// unref_queue
advisory_script_uri
,
// advisory_script_uri
advisory_script_entrypoint
,
// advisory_script_entrypoint
raw_embedder_isolate
->
child_isolate_preparer_
// child isolate preparer
);
embedder_isolate
=
std
::
make_unique
<
std
::
shared_ptr
<
DartIsolate
>
>
(
std
::
make_shared
<
DartIsolate
>
(
vm
,
// vm
(
*
raw_embedder_isolate
)
->
GetIsolateSnapshot
(),
// isolate
_snapshot
(
*
raw_embedder_isolate
)
->
GetSharedSnapshot
(),
// shared_snapshot
null_task_runners
,
// task_runners
fml
::
WeakPtr
<
GrContext
>
{},
// resource_context
nullptr
,
// unref_queue
advisory_script_uri
,
// advisory_script_uri
advisory_script_entrypoint
,
// advisory_script_entrypoint
(
*
raw_embedder_isolate
)
->
child_isolate_preparer_
)
);
}
// Create the Dart VM isolate and give it the embedder object as the baton.
...
...
@@ -728,52 +732,51 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(
error
//
)
:
Dart_CreateIsolate
(
advisory_script_uri
,
//
advisory_script_entrypoint
,
//
embedder_isolate
->
GetIsolateSnapshot
()
advisory_script_uri
,
advisory_script_entrypoint
,
(
*
embedder_isolate
)
->
GetIsolateSnapshot
()
->
GetData
()
->
GetSnapshotPointer
(),
//
embedder_isolate
->
GetIsolateSnapshot
()
->
GetInstructionsIfPresent
(),
//
embedder_isolate
->
GetSharedSnapshot
()
->
GetDataIfPresent
(),
//
embedder_isolate
->
GetSharedSnapshot
()
->
GetInstructionsIfPresent
(),
//
flags
,
//
embedder_isolate
.
get
(),
//
error
//
);
->
GetSnapshotPointer
(),
(
*
embedder_isolate
)
->
GetIsolateSnapshot
()
->
GetInstructionsIfPresent
(),
(
*
embedder_isolate
)
->
GetSharedSnapshot
()
->
GetDataIfPresent
(),
(
*
embedder_isolate
)
->
GetSharedSnapshot
()
->
GetInstructionsIfPresent
(),
flags
,
embedder_isolate
.
get
(),
error
);
if
(
isolate
==
nullptr
)
{
FXL_DLOG
(
ERROR
)
<<
*
error
;
return
{
nullptr
,
{}};
}
if
(
!
embedder_isolate
->
Initialize
(
isolate
,
is_root_isolate
))
{
if
(
!
(
*
embedder_isolate
)
->
Initialize
(
isolate
,
is_root_isolate
))
{
*
error
=
strdup
(
"Embedder could not initialize the Dart isolate."
);
FXL_DLOG
(
ERROR
)
<<
*
error
;
return
{
nullptr
,
{}};
}
if
(
!
embedder_isolate
->
LoadLibraries
(
is_root_isolate
))
{
if
(
!
(
*
embedder_isolate
)
->
LoadLibraries
(
is_root_isolate
))
{
*
error
=
strdup
(
"Embedder could not load libraries in the new Dart isolate."
);
FXL_DLOG
(
ERROR
)
<<
*
error
;
return
{
nullptr
,
{}};
}
auto
weak_embedder_isolate
=
embedder_isolate
->
GetWeakIsolatePtr
();
auto
weak_embedder_isolate
=
(
*
embedder_isolate
)
->
GetWeakIsolatePtr
();
// Root isolates will be setup by the engine and the service isolate (which is
// also a root isolate) by the utility routines in the VM. However, secondary
// isolates will be run by the VM if they are marked as runnable.
if
(
!
is_root_isolate
)
{
FXL_DCHECK
(
embedder_isolate
->
child_isolate_preparer_
);
if
(
!
embedder_isolate
->
child_isolate_preparer_
(
embedder_isolate
.
get
()))
{
FXL_DCHECK
((
*
embedder_isolate
)
->
child_isolate_preparer_
);
if
(
!
(
*
embedder_isolate
)
->
child_isolate_preparer_
((
*
embedder_isolate
).
get
()))
{
*
error
=
strdup
(
"Could not prepare the child isolate to run."
);
FXL_DLOG
(
ERROR
)
<<
*
error
;
return
{
nullptr
,
{}};
}
embedder_isolate
->
ResetWeakPtrFactory
();
}
// The ownership of the embedder object is controlled by the Dart VM. So the
...
...
@@ -783,7 +786,8 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(
}
// |Dart_IsolateShutdownCallback|
void
DartIsolate
::
DartIsolateShutdownCallback
(
DartIsolate
*
embedder_isolate
)
{
void
DartIsolate
::
DartIsolateShutdownCallback
(
std
::
shared_ptr
<
DartIsolate
>*
embedder_isolate
)
{
if
(
!
tonic
::
DartStickyError
::
IsSet
())
{
return
;
}
...
...
@@ -796,7 +800,8 @@ void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) {
}
// |Dart_IsolateCleanupCallback|
void
DartIsolate
::
DartIsolateCleanupCallback
(
DartIsolate
*
embedder_isolate
)
{
void
DartIsolate
::
DartIsolateCleanupCallback
(
std
::
shared_ptr
<
DartIsolate
>*
embedder_isolate
)
{
delete
embedder_isolate
;
}
...
...
@@ -808,14 +813,8 @@ fxl::RefPtr<DartSnapshot> DartIsolate::GetSharedSnapshot() const {
return
shared_snapshot_
;
}
fml
::
WeakPtr
<
DartIsolate
>
DartIsolate
::
GetWeakIsolatePtr
()
const
{
return
weak_factory_
?
weak_factory_
->
GetWeakPtr
()
:
fml
::
WeakPtr
<
DartIsolate
>
();
}
void
DartIsolate
::
ResetWeakPtrFactory
()
{
FXL_CHECK
(
weak_factory_
);
weak_factory_
.
reset
();
std
::
weak_ptr
<
DartIsolate
>
DartIsolate
::
GetWeakIsolatePtr
()
{
return
std
::
static_pointer_cast
<
DartIsolate
>
(
shared_from_this
());
}
void
DartIsolate
::
AddIsolateShutdownCallback
(
fxl
::
Closure
closure
)
{
...
...
runtime/dart_isolate.h
浏览文件 @
0bad812c
...
...
@@ -15,8 +15,8 @@
#include "flutter/runtime/dart_snapshot.h"
#include "lib/fxl/compiler_specific.h"
#include "lib/fxl/macros.h"
#include "lib/tonic/dart_state.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/tonic/dart_state.h"
namespace
blink
{
class
DartVM
;
...
...
@@ -38,7 +38,7 @@ class DartIsolate : public UIDartState {
// The root isolate of a Flutter application is special because it gets Window
// bindings. From the VM's perspective, this isolate is not special in any
// way.
static
fml
::
WeakP
tr
<
DartIsolate
>
CreateRootIsolate
(
static
std
::
weak_p
tr
<
DartIsolate
>
CreateRootIsolate
(
DartVM
*
vm
,
fxl
::
RefPtr
<
DartSnapshot
>
isolate_snapshot
,
fxl
::
RefPtr
<
DartSnapshot
>
shared_snapshot
,
...
...
@@ -93,7 +93,7 @@ class DartIsolate : public UIDartState {
fxl
::
RefPtr
<
DartSnapshot
>
GetIsolateSnapshot
()
const
;
fxl
::
RefPtr
<
DartSnapshot
>
GetSharedSnapshot
()
const
;
fml
::
WeakPtr
<
DartIsolate
>
GetWeakIsolatePtr
()
const
;
std
::
weak_ptr
<
DartIsolate
>
GetWeakIsolatePtr
()
;
private:
bool
LoadScriptSnapshot
(
std
::
shared_ptr
<
const
fml
::
Mapping
>
mapping
,
...
...
@@ -125,7 +125,6 @@ class DartIsolate : public UIDartState {
std
::
vector
<
std
::
shared_ptr
<
const
fml
::
Mapping
>>
kernel_buffers_
;
std
::
vector
<
std
::
unique_ptr
<
AutoFireClosure
>>
shutdown_callbacks_
;
ChildIsolatePreparer
child_isolate_preparer_
;
std
::
unique_ptr
<
fml
::
WeakPtrFactory
<
DartIsolate
>>
weak_factory_
;
FXL_WARN_UNUSED_RESULT
bool
Initialize
(
Dart_Isolate
isolate
,
bool
is_root_isolate
);
...
...
@@ -138,8 +137,6 @@ class DartIsolate : public UIDartState {
FXL_WARN_UNUSED_RESULT
bool
MarkIsolateRunnable
();
void
ResetWeakPtrFactory
();
// |Dart_IsolateCreateCallback|
static
Dart_Isolate
DartIsolateCreateCallback
(
const
char
*
advisory_script_uri
,
...
...
@@ -147,7 +144,7 @@ class DartIsolate : public UIDartState {
const
char
*
package_root
,
const
char
*
package_config
,
Dart_IsolateFlags
*
flags
,
DartIsolate
*
embedder_isolate
,
std
::
shared_ptr
<
DartIsolate
>
*
embedder_isolate
,
char
**
error
);
static
Dart_Isolate
DartCreateAndStartServiceIsolate
(
...
...
@@ -159,21 +156,24 @@ class DartIsolate : public UIDartState {
char
**
error
);
static
std
::
pair
<
Dart_Isolate
/* vm */
,
fml
::
WeakPtr
<
DartIsolate
>
/* embedder */
>
CreateDartVMAndEmbedderObjectPair
(
const
char
*
advisory_script_uri
,
const
char
*
advisory_script_entrypoint
,
const
char
*
package_root
,
const
char
*
package_config
,
Dart_IsolateFlags
*
flags
,
DartIsolate
*
parent_embedder_isolate
,
bool
is_root_isolate
,
char
**
error
);
std
::
weak_ptr
<
DartIsolate
>
/* embedder */
>
CreateDartVMAndEmbedderObjectPair
(
const
char
*
advisory_script_uri
,
const
char
*
advisory_script_entrypoint
,
const
char
*
package_root
,
const
char
*
package_config
,
Dart_IsolateFlags
*
flags
,
std
::
shared_ptr
<
DartIsolate
>*
parent_embedder_isolate
,
bool
is_root_isolate
,
char
**
error
);
// |Dart_IsolateShutdownCallback|
static
void
DartIsolateShutdownCallback
(
DartIsolate
*
embedder_isolate
);
static
void
DartIsolateShutdownCallback
(
std
::
shared_ptr
<
DartIsolate
>*
embedder_isolate
);
// |Dart_IsolateCleanupCallback|
static
void
DartIsolateCleanupCallback
(
DartIsolate
*
embedder_isolate
);
static
void
DartIsolateCleanupCallback
(
std
::
shared_ptr
<
DartIsolate
>*
embedder_isolate
);
FXL_DISALLOW_COPY_AND_ASSIGN
(
DartIsolate
);
};
...
...
runtime/dart_isolate_unittests.cc
浏览文件 @
0bad812c
...
...
@@ -29,7 +29,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) {
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
()
//
);
auto
root
_isolate
=
DartIsolate
::
CreateRootIsolate
(
auto
weak
_isolate
=
DartIsolate
::
CreateRootIsolate
(
vm
.
get
(),
// vm
vm
->
GetIsolateSnapshot
(),
// isolate snapshot
vm
->
GetSharedSnapshot
(),
// shared snapshot
...
...
@@ -40,6 +40,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) {
"main.dart"
,
// advisory uri
"main"
// advisory entrypoint
);
auto
root_isolate
=
weak_isolate
.
lock
();
ASSERT_TRUE
(
root_isolate
);
ASSERT_EQ
(
root_isolate
->
GetPhase
(),
DartIsolate
::
Phase
::
LibrariesSetup
);
ASSERT_TRUE
(
root_isolate
->
Shutdown
());
...
...
@@ -57,7 +58,7 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) {
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
()
//
);
auto
root
_isolate
=
DartIsolate
::
CreateRootIsolate
(
auto
weak
_isolate
=
DartIsolate
::
CreateRootIsolate
(
vm
.
get
(),
// vm
vm
->
GetIsolateSnapshot
(),
// isolate snapshot
vm
->
GetSharedSnapshot
(),
// shared snapshot
...
...
@@ -68,6 +69,7 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) {
"main.dart"
,
// advisory uri
"main"
// advisory entrypoint
);
auto
root_isolate
=
weak_isolate
.
lock
();
ASSERT_TRUE
(
root_isolate
);
ASSERT_EQ
(
root_isolate
->
GetPhase
(),
DartIsolate
::
Phase
::
LibrariesSetup
);
ASSERT_TRUE
(
root_isolate
->
PrepareForRunningFromSource
(
...
...
@@ -88,7 +90,7 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) {
GetCurrentTaskRunner
(),
//
GetCurrentTaskRunner
()
//
);
auto
root
_isolate
=
DartIsolate
::
CreateRootIsolate
(
auto
weak
_isolate
=
DartIsolate
::
CreateRootIsolate
(
vm
.
get
(),
// vm
vm
->
GetIsolateSnapshot
(),
// isolate snapshot
vm
->
GetSharedSnapshot
(),
// shared snapshot
...
...
@@ -99,6 +101,7 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) {
"main.dart"
,
// advisory uri
"main"
// advisory entrypoint
);
auto
root_isolate
=
weak_isolate
.
lock
();
ASSERT_TRUE
(
root_isolate
);
ASSERT_EQ
(
root_isolate
->
GetPhase
(),
DartIsolate
::
Phase
::
LibrariesSetup
);
ASSERT_TRUE
(
root_isolate
->
PrepareForRunningFromSource
(
...
...
runtime/dart_service_isolate.cc
浏览文件 @
0bad812c
...
...
@@ -8,10 +8,10 @@
#include "flutter/runtime/embedder_resources.h"
#include "lib/fxl/logging.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_library_natives.h"
#include "lib/tonic/logging/dart_error.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_library_natives.h"
#include "third_party/tonic/logging/dart_error.h"
#define RETURN_ERROR_HANDLE(handle) \
if (Dart_IsError(handle)) { \
...
...
runtime/dart_vm.cc
浏览文件 @
0bad812c
...
...
@@ -22,15 +22,15 @@
#include "lib/fxl/files/file.h"
#include "lib/fxl/logging.h"
#include "lib/fxl/time/time_delta.h"
#include "lib/tonic/converter/dart_converter.h"
#include "lib/tonic/dart_class_library.h"
#include "lib/tonic/dart_class_provider.h"
#include "lib/tonic/dart_sticky_error.h"
#include "lib/tonic/file_loader/file_loader.h"
#include "lib/tonic/logging/dart_error.h"
#include "lib/tonic/scopes/dart_api_scope.h"
#include "lib/tonic/typed_data/uint8_list.h"
#include "third_party/dart/runtime/bin/embedded_dart_io.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_class_library.h"
#include "third_party/tonic/dart_class_provider.h"
#include "third_party/tonic/dart_sticky_error.h"
#include "third_party/tonic/file_loader/file_loader.h"
#include "third_party/tonic/logging/dart_error.h"
#include "third_party/tonic/scopes/dart_api_scope.h"
#include "third_party/tonic/typed_data/uint8_list.h"
#ifdef ERROR
#undef ERROR
...
...
runtime/runtime_controller.cc
浏览文件 @
0bad812c
...
...
@@ -10,7 +10,7 @@
#include "flutter/lib/ui/ui_dart_state.h"
#include "flutter/lib/ui/window/window.h"
#include "flutter/runtime/runtime_delegate.h"
#include "
lib
/tonic/dart_message_handler.h"
#include "
third_party
/tonic/dart_message_handler.h"
#ifdef ERROR
#undef ERROR
...
...
@@ -70,11 +70,12 @@ RuntimeController::RuntimeController(
unref_queue_
,
p_advisory_script_uri
,
p_advisory_script_entrypoint
))
{
root_isolate_
->
SetReturnCodeCallback
([
this
](
uint32_t
code
)
{
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
root_isolate
->
SetReturnCodeCallback
([
this
](
uint32_t
code
)
{
root_isolate_return_code_
=
{
true
,
code
};
});
if
(
auto
window
=
GetWindowIfAvailable
())
{
tonic
::
DartState
::
Scope
scope
(
root_isolate
_
.
get
()
);
tonic
::
DartState
::
Scope
scope
(
root_isolate
);
window
->
DidCreateIsolate
();
if
(
!
FlushRuntimeStateToIsolate
())
{
FXL_DLOG
(
ERROR
)
<<
"Could not setup intial isolate state."
;
...
...
@@ -87,9 +88,10 @@ RuntimeController::RuntimeController(
RuntimeController
::~
RuntimeController
()
{
FXL_DCHECK
(
Dart_CurrentIsolate
()
==
nullptr
);
if
(
root_isolate_
)
{
root_isolate_
->
SetReturnCodeCallback
(
nullptr
);
auto
result
=
root_isolate_
->
Shutdown
();
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
if
(
root_isolate
)
{
root_isolate
->
SetReturnCodeCallback
(
nullptr
);
auto
result
=
root_isolate
->
Shutdown
();
if
(
!
result
)
{
FXL_DLOG
(
ERROR
)
<<
"Could not shutdown the root isolate."
;
}
...
...
@@ -98,8 +100,9 @@ RuntimeController::~RuntimeController() {
}
bool
RuntimeController
::
IsRootIsolateRunning
()
const
{
if
(
root_isolate_
)
{
return
root_isolate_
->
GetPhase
()
==
DartIsolate
::
Phase
::
Running
;
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
if
(
root_isolate
)
{
return
root_isolate
->
GetPhase
()
==
DartIsolate
::
Phase
::
Running
;
}
return
false
;
}
...
...
@@ -192,11 +195,12 @@ bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) {
}
bool
RuntimeController
::
NotifyIdle
(
int64_t
deadline
)
{
if
(
!
root_isolate_
)
{
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
if
(
!
root_isolate
)
{
return
false
;
}
tonic
::
DartState
::
Scope
scope
(
root_isolate
_
.
get
()
);
tonic
::
DartState
::
Scope
scope
(
root_isolate
);
Dart_NotifyIdle
(
deadline
);
return
true
;
}
...
...
@@ -236,7 +240,8 @@ bool RuntimeController::DispatchSemanticsAction(int32_t id,
}
Window
*
RuntimeController
::
GetWindowIfAvailable
()
{
return
root_isolate_
?
root_isolate_
->
window
()
:
nullptr
;
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
return
root_isolate
?
root_isolate
->
window
()
:
nullptr
;
}
std
::
string
RuntimeController
::
DefaultRouteName
()
{
...
...
@@ -267,26 +272,30 @@ FontCollection& RuntimeController::GetFontCollection() {
}
Dart_Port
RuntimeController
::
GetMainPort
()
{
return
root_isolate_
?
root_isolate_
->
main_port
()
:
ILLEGAL_PORT
;
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
return
root_isolate
?
root_isolate
->
main_port
()
:
ILLEGAL_PORT
;
}
std
::
string
RuntimeController
::
GetIsolateName
()
{
return
root_isolate_
?
root_isolate_
->
debug_name
()
:
""
;
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
return
root_isolate
?
root_isolate
->
debug_name
()
:
""
;
}
bool
RuntimeController
::
HasLivePorts
()
{
if
(
!
root_isolate_
)
{
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
if
(
!
root_isolate
)
{
return
false
;
}
tonic
::
DartState
::
Scope
scope
(
root_isolate
_
.
get
()
);
tonic
::
DartState
::
Scope
scope
(
root_isolate
);
return
Dart_HasLivePorts
();
}
tonic
::
DartErrorHandleType
RuntimeController
::
GetLastError
()
{
return
root_isolate_
?
root_isolate_
->
GetLastError
()
:
tonic
::
kNoError
;
std
::
shared_ptr
<
DartIsolate
>
root_isolate
=
root_isolate_
.
lock
();
return
root_isolate
?
root_isolate
->
GetLastError
()
:
tonic
::
kNoError
;
}
fml
::
WeakP
tr
<
DartIsolate
>
RuntimeController
::
GetRootIsolate
()
{
std
::
weak_p
tr
<
DartIsolate
>
RuntimeController
::
GetRootIsolate
()
{
return
root_isolate_
;
}
...
...
runtime/runtime_controller.h
浏览文件 @
0bad812c
...
...
@@ -71,7 +71,7 @@ class RuntimeController final : public WindowClient {
tonic
::
DartErrorHandleType
GetLastError
();
fml
::
WeakP
tr
<
DartIsolate
>
GetRootIsolate
();
std
::
weak_p
tr
<
DartIsolate
>
GetRootIsolate
();
std
::
pair
<
bool
,
uint32_t
>
GetRootIsolateReturnCode
();
...
...
@@ -95,7 +95,7 @@ class RuntimeController final : public WindowClient {
std
::
string
advisory_script_uri_
;
std
::
string
advisory_script_entrypoint_
;
WindowData
window_data_
;
fml
::
WeakP
tr
<
DartIsolate
>
root_isolate_
;
std
::
weak_p
tr
<
DartIsolate
>
root_isolate_
;
std
::
pair
<
bool
,
uint32_t
>
root_isolate_return_code_
=
{
false
,
0
};
RuntimeController
(
RuntimeDelegate
&
client
,
...
...
shell/common/BUILD.gn
浏览文件 @
0bad812c
...
...
@@ -109,7 +109,7 @@ source_set("common") {
public_deps = [
"$flutter_root/third_party/txt",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
public_configs = [ "$flutter_root:config" ]
...
...
@@ -129,7 +129,7 @@ executable("shell_unittests") {
"//garnet/public/lib/fxl",
"//third_party/dart/runtime:libdart_jit",
"//third_party/skia",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
if (is_linux) {
ldflags = [ "-rdynamic" ]
...
...
shell/common/engine.cc
浏览文件 @
0bad812c
...
...
@@ -117,7 +117,8 @@ bool Engine::Run(RunConfiguration configuration) {
return
false
;
}
auto
isolate
=
runtime_controller_
->
GetRootIsolate
();
std
::
shared_ptr
<
blink
::
DartIsolate
>
isolate
=
runtime_controller_
->
GetRootIsolate
().
lock
();
bool
isolate_running
=
isolate
&&
isolate
->
GetPhase
()
==
blink
::
DartIsolate
::
Phase
::
Running
;
...
...
@@ -145,9 +146,14 @@ bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) {
auto
isolate_configuration
=
configuration
.
TakeIsolateConfiguration
();
auto
isolate
=
runtime_controller_
->
GetRootIsolate
();
std
::
shared_ptr
<
blink
::
DartIsolate
>
isolate
=
runtime_controller_
->
GetRootIsolate
().
lock
();
if
(
!
isolate_configuration
->
PrepareIsolate
(
isolate
))
{
if
(
!
isolate
)
{
return
false
;
}
if
(
!
isolate_configuration
->
PrepareIsolate
(
*
isolate
))
{
FXL_LOG
(
ERROR
)
<<
"Could not prepare to run the isolate."
;
return
false
;
}
...
...
shell/common/isolate_configuration.cc
浏览文件 @
0bad812c
...
...
@@ -16,19 +16,14 @@ IsolateConfiguration::IsolateConfiguration() = default;
IsolateConfiguration
::~
IsolateConfiguration
()
=
default
;
bool
IsolateConfiguration
::
PrepareIsolate
(
fml
::
WeakPtr
<
blink
::
DartIsolate
>
isolate
)
{
if
(
!
isolate
)
{
return
false
;
}
if
(
isolate
->
GetPhase
()
!=
blink
::
DartIsolate
::
Phase
::
LibrariesSetup
)
{
bool
IsolateConfiguration
::
PrepareIsolate
(
blink
::
DartIsolate
&
isolate
)
{
if
(
isolate
.
GetPhase
()
!=
blink
::
DartIsolate
::
Phase
::
LibrariesSetup
)
{
FXL_DLOG
(
ERROR
)
<<
"Isolate was in incorrect phase to be prepared for running."
;
return
false
;
}
return
DoPrepareIsolate
(
*
isolate
);
return
DoPrepareIsolate
(
isolate
);
}
class
AppSnapshotIsolateConfiguration
final
:
public
IsolateConfiguration
{
...
...
shell/common/isolate_configuration.h
浏览文件 @
0bad812c
...
...
@@ -40,7 +40,7 @@ class IsolateConfiguration {
virtual
~
IsolateConfiguration
();
bool
PrepareIsolate
(
fml
::
WeakPtr
<
blink
::
DartIsolate
>
isolate
);
bool
PrepareIsolate
(
blink
::
DartIsolate
&
isolate
);
protected:
virtual
bool
DoPrepareIsolate
(
blink
::
DartIsolate
&
isolate
)
=
0
;
...
...
shell/platform/embedder/BUILD.gn
浏览文件 @
0bad812c
...
...
@@ -34,7 +34,7 @@ source_set("embedder") {
"//third_party/dart/runtime/bin:embedded_dart_io",
"//third_party/skia",
"//third_party/skia:gpu",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
public_configs = [ "$flutter_root:config" ]
...
...
shell/testing/BUILD.gn
浏览文件 @
0bad812c
...
...
@@ -23,7 +23,7 @@ executable("testing") {
"//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/bin:embedded_dart_io",
"//third_party/skia",
"//t
opaz/lib
/tonic",
"//t
hird_party
/tonic",
]
if (is_fuchsia) {
...
...
tools/licenses/pubspec.lock
已删除
100644 → 0
浏览文件 @
f949f7d4
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
archive:
dependency: "direct main"
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.33"
args:
dependency: "direct main"
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.7"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.10"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
crypto:
dependency: "direct main"
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
path:
dependency: "direct main"
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.5"
sdks:
dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.67.0.flutter-84ca27a09e"
travis/licenses_golden/licenses_flutter
浏览文件 @
0bad812c
...
...
@@ -752,6 +752,7 @@ FILE: ../../../flutter/lib/ui/compositing/scene.cc
FILE: ../../../flutter/lib/ui/compositing/scene.h
FILE: ../../../flutter/lib/ui/compositing/scene_builder.cc
FILE: ../../../flutter/lib/ui/compositing/scene_builder.h
FILE: ../../../flutter/lib/ui/dart_wrapper.h
FILE: ../../../flutter/lib/ui/geometry.dart
FILE: ../../../flutter/lib/ui/hash_codes.dart
FILE: ../../../flutter/lib/ui/hooks.dart
...
...
@@ -871,7 +872,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
LIBRARY: engine
ORIGIN: ../../../t
opaz
/LICENSE
ORIGIN: ../../../t
hird_party/tonic
/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/fml/build_config.h
FILE: ../../../flutter/fml/closure.h
...
...
travis/licenses_golden/licenses_third_party
浏览文件 @
0bad812c
Signature:
8c6862be68434710cbc30d73df250d2d
Signature:
63e223afa271c52f6f62e3cbfb842bc7
UNUSED LICENSES:
...
...
@@ -21116,6 +21116,213 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: tonic
ORIGIN: ../../../garnet/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/tonic/dart_list.cc
FILE: ../../../third_party/tonic/dart_list.h
FILE: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc
FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc
FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h
FILE: ../../../third_party/tonic/filesystem/filesystem/symlink_win.cc
FILE: ../../../third_party/tonic/platform/platform_utils.h
FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc
FILE: ../../../third_party/tonic/platform/platform_utils_win.cc
----------------------------------------------------------------------------------------------------
Copyright 2017 The Fuchsia Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: tonic
ORIGIN: ../../../third_party/tonic/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/tonic/common/build_config.h
FILE: ../../../third_party/tonic/converter/dart_converter.cc
FILE: ../../../third_party/tonic/converter/dart_converter.h
FILE: ../../../third_party/tonic/dart_message_handler.cc
FILE: ../../../third_party/tonic/dart_message_handler.h
FILE: ../../../third_party/tonic/dart_microtask_queue.cc
FILE: ../../../third_party/tonic/dart_microtask_queue.h
FILE: ../../../third_party/tonic/dart_sticky_error.cc
FILE: ../../../third_party/tonic/dart_sticky_error.h
FILE: ../../../third_party/tonic/file_loader/file_loader.cc
FILE: ../../../third_party/tonic/file_loader/file_loader.h
FILE: ../../../third_party/tonic/filesystem/filesystem/build_config.h
FILE: ../../../third_party/tonic/filesystem/filesystem/directory.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/directory.h
FILE: ../../../third_party/tonic/filesystem/filesystem/eintr_wrapper.h
FILE: ../../../third_party/tonic/filesystem/filesystem/file.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/file.h
FILE: ../../../third_party/tonic/filesystem/filesystem/file_descriptor.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/file_descriptor.h
FILE: ../../../third_party/tonic/filesystem/filesystem/path.h
FILE: ../../../third_party/tonic/filesystem/filesystem/path_posix.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/scoped_temp_dir.cc
FILE: ../../../third_party/tonic/filesystem/filesystem/scoped_temp_dir.h
FILE: ../../../third_party/tonic/filesystem/filesystem/symlink.h
FILE: ../../../third_party/tonic/filesystem/filesystem/symlink_posix.cc
FILE: ../../../third_party/tonic/logging/dart_error.cc
FILE: ../../../third_party/tonic/logging/dart_error.h
FILE: ../../../third_party/tonic/logging/dart_invoke.cc
FILE: ../../../third_party/tonic/logging/dart_invoke.h
FILE: ../../../third_party/tonic/parsers/packages_map.cc
FILE: ../../../third_party/tonic/parsers/packages_map.h
FILE: ../../../third_party/tonic/scopes/dart_api_scope.h
FILE: ../../../third_party/tonic/scopes/dart_isolate_scope.cc
FILE: ../../../third_party/tonic/scopes/dart_isolate_scope.h
FILE: ../../../third_party/tonic/typed_data/dart_byte_data.h
FILE: ../../../third_party/tonic/typed_data/int32_list.h
FILE: ../../../third_party/tonic/typed_data/uint8_list.h
----------------------------------------------------------------------------------------------------
Copyright 2016 The Fuchsia Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: tonic
ORIGIN: ../../../third_party/tonic/common/macros.h + ../../../third_party/tonic/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/tonic/common/macros.h
----------------------------------------------------------------------------------------------------
Copyright 2018 The Fuchsia Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: tonic
ORIGIN: ../../../third_party/tonic/typed_data/dart_byte_data.cc + ../../../third_party/tonic/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/tonic/dart_args.h
FILE: ../../../third_party/tonic/dart_binding_macros.h
FILE: ../../../third_party/tonic/dart_class_library.cc
FILE: ../../../third_party/tonic/dart_class_library.h
FILE: ../../../third_party/tonic/dart_class_provider.cc
FILE: ../../../third_party/tonic/dart_class_provider.h
FILE: ../../../third_party/tonic/dart_library_natives.cc
FILE: ../../../third_party/tonic/dart_library_natives.h
FILE: ../../../third_party/tonic/dart_persistent_value.cc
FILE: ../../../third_party/tonic/dart_persistent_value.h
FILE: ../../../third_party/tonic/dart_state.cc
FILE: ../../../third_party/tonic/dart_state.h
FILE: ../../../third_party/tonic/dart_wrappable.cc
FILE: ../../../third_party/tonic/dart_wrappable.h
FILE: ../../../third_party/tonic/dart_wrapper_info.h
FILE: ../../../third_party/tonic/typed_data/dart_byte_data.cc
FILE: ../../../third_party/tonic/typed_data/float32_list.cc
FILE: ../../../third_party/tonic/typed_data/float32_list.h
FILE: ../../../third_party/tonic/typed_data/float64_list.cc
FILE: ../../../third_party/tonic/typed_data/float64_list.h
FILE: ../../../third_party/tonic/typed_data/int32_list.cc
FILE: ../../../third_party/tonic/typed_data/uint8_list.cc
----------------------------------------------------------------------------------------------------
Copyright 2015 The Fuchsia Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================
====================================================================================================
LIBRARY: vulkanmemoryallocator
ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt
...
...
@@ -21878,4 +22085,4 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
====================================================================================================
Total license count: 32
1
Total license count: 32
5
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录