Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
82c13d7e
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
82c13d7e
编写于
7月 28, 2015
作者:
M
Matt Perry
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/master' into performance
上级
f676d29b
88afbedc
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
186 addition
and
57 deletion
+186
-57
build/config/ios/ios_app.py
build/config/ios/ios_app.py
+15
-12
build/config/ios/rules.gni
build/config/ios/rules.gni
+7
-3
sky/build/sky_app.gni
sky/build/sky_app.gni
+41
-1
sky/packages/sky/example/game/BUILD.gn
sky/packages/sky/example/game/BUILD.gn
+2
-0
sky/packages/sky/example/game/ios/Info.plist
sky/packages/sky/example/game/ios/Info.plist
+52
-0
sky/packages/sky/lib/rendering/sky_binding.dart
sky/packages/sky/lib/rendering/sky_binding.dart
+2
-2
sky/packages/sky/lib/widgets/widget.dart
sky/packages/sky/lib/widgets/widget.dart
+19
-7
sky/shell/BUILD.gn
sky/shell/BUILD.gn
+28
-29
sky/shell/ios/sky_surface.mm
sky/shell/ios/sky_surface.mm
+19
-3
sky/tests/resources/display_list.dart
sky/tests/resources/display_list.dart
+1
-0
未找到文件。
build/config/ios/ios_app.py
浏览文件 @
82c13d7e
...
...
@@ -15,9 +15,24 @@ PLUTIL = [
'plutil'
]
def
MakeDirectories
(
path
):
try
:
os
.
makedirs
(
path
)
except
OSError
as
exc
:
if
exc
.
errno
==
errno
.
EEXIST
and
os
.
path
.
isdir
(
path
):
return
0
else
:
return
-
1
return
0
def
ProcessInfoPlist
(
args
):
output_plist_file
=
os
.
path
.
abspath
(
os
.
path
.
join
(
args
.
output
,
'Info.plist'
))
if
MakeDirectories
(
os
.
path
.
dirname
(
output_plist_file
))
==
-
1
:
return
-
1
return
subprocess
.
check_call
(
PLUTIL
+
[
'-convert'
,
'binary1'
,
...
...
@@ -42,18 +57,6 @@ def PerformCodeSigning(args):
])
def
MakeDirectories
(
path
):
try
:
os
.
makedirs
(
path
)
except
OSError
as
exc
:
if
exc
.
errno
==
errno
.
EEXIST
and
os
.
path
.
isdir
(
path
):
return
0
else
:
return
-
1
return
0
def
GenerateProjectStructure
(
args
):
application_path
=
os
.
path
.
join
(
args
.
dir
,
args
.
name
+
".app"
)
return
MakeDirectories
(
application_path
)
...
...
build/config/ios/rules.gni
浏览文件 @
82c13d7e
...
...
@@ -56,6 +56,10 @@ template("resource_copy_ios") {
set_sources_assignment_filter([])
sources = _resources
outputs = [ "$root_build_dir/$_app_name.app/$_bundle_directory/{{source_file_part}}" ]
if (defined(invoker.deps)) {
deps = invoker.deps
}
}
}
...
...
@@ -115,14 +119,14 @@ template("ios_app") {
script = ios_app_script
sources = [ invoker.info_plist ]
outputs = [ "$root_build_dir/Info.plist" ]
outputs = [ "$root_build_dir/
plist/$app_name/
Info.plist" ]
args = [
"plist",
"-i",
rebase_path(invoker.info_plist, root_build_dir),
"-o",
rebase_path(
root_build_dir
),
rebase_path(
"$root_build_dir/plist/$app_name"
),
]
}
...
...
@@ -131,7 +135,7 @@ template("ios_app") {
copy_gen_target_name = target_name + "_copy"
copy(copy_gen_target_name) {
sources = [
"$root_build_dir/Info.plist",
"$root_build_dir/
plist/$app_name/
Info.plist",
"$root_build_dir/$app_name",
]
...
...
sky/build/sky_app.gni
浏览文件 @
82c13d7e
...
...
@@ -7,7 +7,7 @@ import("//sky/build/skyx.gni")
template("sky_app") {
skyx_target_name = target_name
if (is_android) {
if (is_android
|| is_ios
) {
skyx_target_name = "app"
}
...
...
@@ -89,5 +89,45 @@ template("sky_app") {
deps += invoker.deps
}
}
} else if (is_ios && defined(invoker.info_plist)) {
import("//build/config/ios/rules.gni")
import("//build/config/ios/ios_sdk.gni")
ios_app(target_name) {
app_name = target_name + "_app"
code_signing_identity = ios_code_signing_identity
info_plist = invoker.info_plist
if (defined(invoker.entitlements_path)) {
entitlements_path = invoker.entitlements_path
} else {
entitlements_path = "//sky/shell/ios/Entitlements.xcent"
}
resources_gen_target_name = target_name + "_res"
resource_copy_ios(resources_gen_target_name) {
resources = [
"//third_party/icu/android/icudtl.dat",
"$target_gen_dir/app.skyx",
]
bundle_directory = "."
deps = [ ":app" ]
}
deps = [
"//sky/shell:ios_scaffolding",
":$resources_gen_target_name",
":$skyx_target_name",
]
if (defined(invoker.deps)) {
deps += invoker.deps
}
}
} else {
group(target_name) {
}
}
}
sky/packages/sky/example/game/BUILD.gn
浏览文件 @
82c13d7e
...
...
@@ -14,5 +14,7 @@ sky_app("game") {
deps = [
"//sky/packages/sky/example/game/apk:resources",
]
} else if (is_ios) {
info_plist = "ios/Info.plist"
}
}
sky/packages/sky/example/game/ios/Info.plist
0 → 100644
浏览文件 @
82c13d7e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleDevelopmentRegion
</key>
<string>
en
</string>
<!--
This executable name must match the name of the app provided to the
ios_app GN template
-->
<key>
CFBundleExecutable
</key>
<string>
game_app
</string>
<key>
CFBundleIdentifier
</key>
<string>
org.domokit.sky.game
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
game_app
</string>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0
</string>
<key>
CFBundleVersion
</key>
<string>
1
</string>
<key>
LSRequiresIPhoneOS
</key>
<true/>
<key>
UIRequiredDeviceCapabilities
</key>
<array>
<string>
armv7
</string>
</array>
<key>
DTPlatformName
</key>
<string>
iphonesimulator
</string>
<key>
DTSDKName
</key>
<string>
iphonesimulator8.3
</string>
<key>
LSRequiresIPhoneOS
</key>
<true/>
<key>
MinimumOSVersion
</key>
<string>
8.3
</string>
<key>
UIDeviceFamily
</key>
<array>
<integer>
1
</integer>
<integer>
2
</integer>
</array>
<key>
CFBundleSupportedPlatforms
</key>
<array>
<string>
iPhoneSimulator
</string>
</array>
</dict>
</plist>
sky/packages/sky/lib/rendering/sky_binding.dart
浏览文件 @
82c13d7e
...
...
@@ -47,7 +47,7 @@ class SkyBinding {
_renderView
=
renderViewOverride
;
}
assert
(
_renderView
!=
null
);
scheduler
.
addPersistentFrameCallback
(
_
beginFrame
);
scheduler
.
addPersistentFrameCallback
(
beginFrame
);
assert
(
_instance
==
this
);
}
...
...
@@ -69,7 +69,7 @@ class SkyBinding {
void
set
root
(
RenderBox
value
)
{
_renderView
.
child
=
value
;
}
void
_
beginFrame
(
double
timeStamp
)
{
void
beginFrame
(
double
timeStamp
)
{
RenderObject
.
flushLayout
();
RenderObject
.
flushPaint
();
_renderView
.
paintFrame
();
...
...
sky/packages/sky/lib/widgets/widget.dart
浏览文件 @
82c13d7e
...
...
@@ -7,6 +7,7 @@ import 'dart:collection';
import
'dart:sky'
as
sky
;
import
'package:sky/base/hit_test.dart'
;
import
'package:sky/base/scheduler.dart'
as
scheduler
;
import
'package:sky/mojo/activity.dart'
as
activity
;
import
'package:sky/rendering/box.dart'
;
import
'package:sky/rendering/object.dart'
;
...
...
@@ -651,6 +652,11 @@ abstract class Component extends Widget {
_scheduleComponentForRender
(
this
);
}
static
void
flushBuild
()
{
if
(!
_dirtyComponents
.
isEmpty
)
_buildDirtyComponents
();
}
Widget
build
();
}
...
...
@@ -759,13 +765,15 @@ void _absorbDirtyComponents(List<Component> list) {
}
void
_buildDirtyComponents
(
)
{
assert
(!
_dirtyComponents
.
isEmpty
);
Stopwatch
sw
;
if
(
_shouldLogRenderDuration
)
sw
=
new
Stopwatch
()..
start
();
_inRenderDirtyComponents
=
true
;
try
{
sky
.
tracing
.
begin
(
'
Widgets._buildDirtyComponents
'
);
sky
.
tracing
.
begin
(
'
Component.flushBuild
'
);
List
<
Component
>
sortedDirtyComponents
=
new
List
<
Component
>();
_absorbDirtyComponents
(
sortedDirtyComponents
);
int
index
=
0
;
...
...
@@ -784,7 +792,7 @@ void _buildDirtyComponents() {
}
finally
{
_buildScheduled
=
false
;
_inRenderDirtyComponents
=
false
;
sky
.
tracing
.
end
(
'
Widgets._buildDirtyComponents
'
);
sky
.
tracing
.
end
(
'
Component.flushBuild
'
);
}
Widget
.
_notifyMountStatusChanged
();
...
...
@@ -795,21 +803,20 @@ void _buildDirtyComponents() {
if
(
_debugFrameTimes
.
length
>=
1000
)
{
_debugFrameTimes
.
sort
();
const
int
i
=
99
;
print
(
'
_buildDirtyComponents
:
${i+1}
th fastest frame out of the last
${_debugFrameTimes.length}
:
${_debugFrameTimes[i]}
microseconds'
);
print
(
'
Component.flushBuild
:
${i+1}
th fastest frame out of the last
${_debugFrameTimes.length}
:
${_debugFrameTimes[i]}
microseconds'
);
_debugFrameTimes
.
clear
();
}
}
}
void
_scheduleComponentForRender
(
Component
c
)
{
_dirtyComponents
.
add
(
c
);
void
_scheduleComponentForRender
(
Component
c
omponent
)
{
_dirtyComponents
.
add
(
c
omponent
);
if
(!
_buildScheduled
)
{
_buildScheduled
=
true
;
new
Future
.
microtask
(
_buildDirtyComponents
);
scheduler
.
ensureVisualUpdate
(
);
}
}
// RenderObjectWrappers correspond to a desired state of a RenderObject.
// They are fully immutable, with one exception: A Widget which is a
// Component which lives within an MultiChildRenderObjectWrapper's
...
...
@@ -1178,6 +1185,11 @@ class WidgetSkyBinding extends SkyBinding {
}
}
void
beginFrame
(
double
timeStamp
)
{
Component
.
flushBuild
();
super
.
beginFrame
(
timeStamp
);
}
}
abstract
class
App
extends
StatefulComponent
{
...
...
sky/shell/BUILD.gn
浏览文件 @
82c13d7e
...
...
@@ -169,19 +169,7 @@ if (is_android) {
import("//build/config/ios/rules.gni")
import("//build/config/ios/ios_sdk.gni")
ios_app("shell") {
app_name = "SkyShell"
info_plist = "ios/Info.plist"
scaffolding_target = "ios_scaffolding"
entitlements_path = "ios/Entitlements.xcent"
code_signing_identity = ios_code_signing_identity
resource_copy_ios("sky_resources") {
resources = [ "//third_party/icu/android/icudtl.dat" ]
bundle_directory = "."
}
source_set(scaffolding_target) {
source_set("ios_scaffolding") {
sources = [
"ios/main_ios.mm",
"ios/sky_app_delegate.h",
...
...
@@ -208,8 +196,19 @@ if (is_android) {
]
}
ios_app("shell") {
app_name = "SkyShell"
info_plist = "ios/Info.plist"
entitlements_path = "ios/Entitlements.xcent"
code_signing_identity = ios_code_signing_identity
resource_copy_ios("sky_resources") {
resources = [ "//third_party/icu/android/icudtl.dat" ]
bundle_directory = "."
}
deps = [
":
$scaffolding_target
",
":
ios_scaffolding
",
":sky_resources",
]
}
...
...
sky/shell/ios/sky_surface.mm
浏览文件 @
82c13d7e
...
...
@@ -131,16 +131,32 @@ static sky::InputEventPtr BasicInputEventFromRecognizer(
if
(
server
&&
target
)
{
return
[
NSString
stringWithFormat
:
@"http://%@/%@"
,
server
,
target
];
}
return
[
NSBundle
mainBundle
].
infoDictionary
[
@"org.domokit.sky.load_url"
];
}
-
(
NSString
*
)
skyInitialBundleURL
{
return
[[
NSBundle
mainBundle
]
pathForResource
:
@"app"
ofType
:
@"skyx"
];
}
-
(
void
)
connectToEngineAndLoad
{
auto
interface_request
=
mojo
::
GetProxy
(
&
_sky_engine
);
self
.
platformView
->
ConnectToEngine
(
interface_request
.
Pass
());
mojo
::
String
string
(
self
.
skyInitialLoadURL
.
UTF8String
);
NSString
*
endpoint
=
self
.
skyInitialBundleURL
;
if
(
endpoint
.
length
>
0
)
{
// Load from bundle
mojo
::
String
string
(
endpoint
.
UTF8String
);
_sky_engine
->
RunFromBundle
(
string
);
return
;
}
endpoint
=
self
.
skyInitialLoadURL
;
if
(
endpoint
.
length
>
0
)
{
// Load from URL
mojo
::
String
string
(
endpoint
.
UTF8String
);
_sky_engine
->
RunFromNetwork
(
string
);
return
;
}
}
-
(
void
)
notifySurfaceDestruction
{
...
...
sky/tests/resources/display_list.dart
浏览文件 @
82c13d7e
...
...
@@ -149,6 +149,7 @@ class TestRenderView extends RenderView {
// TEST API:
void
syncCheckFrame
()
{
Component
.
flushBuild
();
RenderObject
.
flushLayout
();
paintFrame
();
print
(
lastPaint
);
// TODO(ianh): figure out how to make this fit the unit testing framework better
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录