Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
8e1fc821
E
engine
项目概览
weixin_43355755
/
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,发现更多精彩内容 >>
提交
8e1fc821
编写于
12月 11, 2015
作者:
F
Florian Loitsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add 'FlushRealTimeEvents' to window.
上级
42deccf6
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
34 addition
and
0 deletion
+34
-0
sky/engine/core/dart/window.dart
sky/engine/core/dart/window.dart
+3
-0
sky/engine/core/window/window.cc
sky/engine/core/window/window.cc
+6
-0
sky/engine/core/window/window.h
sky/engine/core/window/window.h
+1
-0
sky/engine/public/sky/sky_headless.cc
sky/engine/public/sky/sky_headless.cc
+3
-0
sky/engine/public/sky/sky_headless.h
sky/engine/public/sky/sky_headless.h
+1
-0
sky/engine/public/sky/sky_view.cc
sky/engine/public/sky/sky_view.cc
+4
-0
sky/engine/public/sky/sky_view.h
sky/engine/public/sky/sky_view.h
+1
-0
sky/engine/public/sky/sky_view_client.h
sky/engine/public/sky/sky_view_client.h
+1
-0
sky/shell/ui/animator.cc
sky/shell/ui/animator.cc
+8
-0
sky/shell/ui/animator.h
sky/shell/ui/animator.h
+1
-0
sky/shell/ui/engine.cc
sky/shell/ui/engine.cc
+4
-0
sky/shell/ui/engine.h
sky/shell/ui/engine.h
+1
-0
未找到文件。
sky/engine/core/dart/window.dart
浏览文件 @
8e1fc821
...
@@ -121,6 +121,9 @@ class Window {
...
@@ -121,6 +121,9 @@ class Window {
/// [Scene]. For optimal performance, this should only be called in response
/// [Scene]. For optimal performance, this should only be called in response
/// to the [onBeginFrame] callback being invoked.
/// to the [onBeginFrame] callback being invoked.
void
render
(
Scene
scene
)
native
"Window_render"
;
void
render
(
Scene
scene
)
native
"Window_render"
;
/// Flushes pending real-time events, executing their callbacks.
void
flushRealTimeEvents
()
native
"Scheduler_FlushRealTimeEvents"
;
}
}
/// The [Window] singleton.
/// The [Window] singleton.
...
...
sky/engine/core/window/window.cc
浏览文件 @
8e1fc821
...
@@ -29,6 +29,11 @@ void Render(Dart_NativeArguments args) {
...
@@ -29,6 +29,11 @@ void Render(Dart_NativeArguments args) {
DOMDartState
::
Current
()
->
window
()
->
client
()
->
Render
(
scene
);
DOMDartState
::
Current
()
->
window
()
->
client
()
->
Render
(
scene
);
}
}
void
FlushRealTimeEvents
(
Dart_NativeArguments
args
)
{
DOMDartState
::
Current
()
->
window
()
->
client
()
->
FlushRealTimeEvents
();
}
}
// namespace
}
// namespace
WindowClient
::~
WindowClient
()
{
WindowClient
::~
WindowClient
()
{
...
@@ -140,6 +145,7 @@ void Window::RegisterNatives(DartLibraryNatives* natives) {
...
@@ -140,6 +145,7 @@ void Window::RegisterNatives(DartLibraryNatives* natives) {
natives
->
Register
({
natives
->
Register
({
{
"Window_scheduleFrame"
,
ScheduleFrame
,
1
,
true
},
{
"Window_scheduleFrame"
,
ScheduleFrame
,
1
,
true
},
{
"Window_render"
,
Render
,
2
,
true
},
{
"Window_render"
,
Render
,
2
,
true
},
{
"Scheduler_FlushRealTimeEvents"
,
FlushRealTimeEvents
,
1
,
true
},
});
});
}
}
...
...
sky/engine/core/window/window.h
浏览文件 @
8e1fc821
...
@@ -18,6 +18,7 @@ class DartLibraryNatives;
...
@@ -18,6 +18,7 @@ class DartLibraryNatives;
class
WindowClient
{
class
WindowClient
{
public:
public:
virtual
void
ScheduleFrame
()
=
0
;
virtual
void
ScheduleFrame
()
=
0
;
virtual
void
FlushRealTimeEvents
()
=
0
;
virtual
void
Render
(
Scene
*
scene
)
=
0
;
virtual
void
Render
(
Scene
*
scene
)
=
0
;
protected:
protected:
...
...
sky/engine/public/sky/sky_headless.cc
浏览文件 @
8e1fc821
...
@@ -37,6 +37,9 @@ void SkyHeadless::RunFromSnapshotBuffer(const uint8_t* buffer, size_t size) {
...
@@ -37,6 +37,9 @@ void SkyHeadless::RunFromSnapshotBuffer(const uint8_t* buffer, size_t size) {
void
SkyHeadless
::
ScheduleFrame
()
{
void
SkyHeadless
::
ScheduleFrame
()
{
}
}
void
SkyHeadless
::
FlushRealTimeEvents
()
{
}
void
SkyHeadless
::
Render
(
Scene
*
scene
)
{
void
SkyHeadless
::
Render
(
Scene
*
scene
)
{
}
}
...
...
sky/engine/public/sky/sky_headless.h
浏览文件 @
8e1fc821
...
@@ -37,6 +37,7 @@ class SkyHeadless : public WindowClient {
...
@@ -37,6 +37,7 @@ class SkyHeadless : public WindowClient {
private:
private:
void
ScheduleFrame
()
override
;
void
ScheduleFrame
()
override
;
void
FlushRealTimeEvents
()
override
;
void
Render
(
Scene
*
scene
)
override
;
void
Render
(
Scene
*
scene
)
override
;
std
::
unique_ptr
<
DartController
>
dart_controller_
;
std
::
unique_ptr
<
DartController
>
dart_controller_
;
...
...
sky/engine/public/sky/sky_view.cc
浏览文件 @
8e1fc821
...
@@ -100,6 +100,10 @@ void SkyView::ScheduleFrame() {
...
@@ -100,6 +100,10 @@ void SkyView::ScheduleFrame() {
client_
->
ScheduleFrame
();
client_
->
ScheduleFrame
();
}
}
void
SkyView
::
FlushRealTimeEvents
()
{
client_
->
FlushRealTimeEvents
();
}
void
SkyView
::
Render
(
Scene
*
scene
)
{
void
SkyView
::
Render
(
Scene
*
scene
)
{
layer_tree_
=
scene
->
takeLayerTree
();
layer_tree_
=
scene
->
takeLayerTree
();
}
}
...
...
sky/engine/public/sky/sky_view.h
浏览文件 @
8e1fc821
...
@@ -62,6 +62,7 @@ class SkyView : public WindowClient {
...
@@ -62,6 +62,7 @@ class SkyView : public WindowClient {
Window
*
GetWindow
();
Window
*
GetWindow
();
void
ScheduleFrame
()
override
;
void
ScheduleFrame
()
override
;
void
FlushRealTimeEvents
()
override
;
void
Render
(
Scene
*
scene
)
override
;
void
Render
(
Scene
*
scene
)
override
;
SkyViewClient
*
client_
;
SkyViewClient
*
client_
;
...
...
sky/engine/public/sky/sky_view_client.h
浏览文件 @
8e1fc821
...
@@ -16,6 +16,7 @@ namespace blink {
...
@@ -16,6 +16,7 @@ namespace blink {
class
SkyViewClient
{
class
SkyViewClient
{
public:
public:
virtual
void
ScheduleFrame
()
=
0
;
virtual
void
ScheduleFrame
()
=
0
;
virtual
void
FlushRealTimeEvents
()
=
0
;
virtual
void
Render
(
std
::
unique_ptr
<
sky
::
compositor
::
LayerTree
>
layer_tree
)
=
0
;
virtual
void
Render
(
std
::
unique_ptr
<
sky
::
compositor
::
LayerTree
>
layer_tree
)
=
0
;
virtual
void
DidCreateIsolate
(
Dart_Isolate
isolate
)
=
0
;
virtual
void
DidCreateIsolate
(
Dart_Isolate
isolate
)
=
0
;
...
...
sky/shell/ui/animator.cc
浏览文件 @
8e1fc821
...
@@ -50,6 +50,14 @@ void Animator::RequestFrame() {
...
@@ -50,6 +50,14 @@ void Animator::RequestFrame() {
}
}
}
}
void
Animator
::
FlushRealTimeEvents
()
{
if
(
outstanding_requests_
>
0
)
rasterizer_
.
WaitForIncomingResponseWithTimeout
(
0
);
if
(
engine_requested_frame_
&&
vsync_provider_
)
vsync_provider_
.
WaitForIncomingResponseWithTimeout
(
0
);
}
void
Animator
::
Stop
()
{
void
Animator
::
Stop
()
{
paused_
=
true
;
paused_
=
true
;
}
}
...
...
sky/shell/ui/animator.h
浏览文件 @
8e1fc821
...
@@ -19,6 +19,7 @@ class Animator {
...
@@ -19,6 +19,7 @@ class Animator {
~
Animator
();
~
Animator
();
void
RequestFrame
();
void
RequestFrame
();
void
FlushRealTimeEvents
();
void
Start
();
void
Start
();
void
Stop
();
void
Stop
();
...
...
sky/shell/ui/engine.cc
浏览文件 @
8e1fc821
...
@@ -280,6 +280,10 @@ void Engine::ScheduleFrame() {
...
@@ -280,6 +280,10 @@ void Engine::ScheduleFrame() {
animator_
->
RequestFrame
();
animator_
->
RequestFrame
();
}
}
void
Engine
::
FlushRealTimeEvents
()
{
animator_
->
FlushRealTimeEvents
();
}
void
Engine
::
Render
(
std
::
unique_ptr
<
compositor
::
LayerTree
>
layer_tree
)
{
void
Engine
::
Render
(
std
::
unique_ptr
<
compositor
::
LayerTree
>
layer_tree
)
{
}
}
...
...
sky/shell/ui/engine.h
浏览文件 @
8e1fc821
...
@@ -75,6 +75,7 @@ class Engine : public UIDelegate,
...
@@ -75,6 +75,7 @@ class Engine : public UIDelegate,
// SkyViewClient methods:
// SkyViewClient methods:
void
ScheduleFrame
()
override
;
void
ScheduleFrame
()
override
;
void
FlushRealTimeEvents
()
override
;
void
Render
(
std
::
unique_ptr
<
compositor
::
LayerTree
>
layer_tree
)
override
;
void
Render
(
std
::
unique_ptr
<
compositor
::
LayerTree
>
layer_tree
)
override
;
void
DidCreateIsolate
(
Dart_Isolate
isolate
)
override
;
void
DidCreateIsolate
(
Dart_Isolate
isolate
)
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录