Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
95b5d5df
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,体验更适合开发者的 AI 搜索 >>
提交
95b5d5df
编写于
3月 02, 2016
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update uses of Mojo to new interfaces
上级
1266be14
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
78 addition
and
72 deletion
+78
-72
DEPS
DEPS
+4
-4
mojo/gpu/gl_context.cc
mojo/gpu/gl_context.cc
+8
-8
mojo/gpu/gl_context.h
mojo/gpu/gl_context.h
+2
-2
sky/engine/bindings/mojo_services.cc
sky/engine/bindings/mojo_services.cc
+8
-8
sky/engine/bindings/mojo_services.h
sky/engine/bindings/mojo_services.h
+1
-1
sky/engine/core/dart/mojo_services.dart
sky/engine/core/dart/mojo_services.dart
+1
-1
sky/services/engine/sky_engine.mojom
sky/services/engine/sky_engine.mojom
+1
-1
sky/shell/platform/android/sky_main.cc
sky/shell/platform/android/sky_main.cc
+1
-2
sky/shell/platform/linux/main_linux.cc
sky/shell/platform/linux/main_linux.cc
+1
-2
sky/shell/platform/mac/platform_mac.mm
sky/shell/platform/mac/platform_mac.mm
+1
-2
sky/shell/platform/mojo/application_impl.cc
sky/shell/platform/mojo/application_impl.cc
+8
-9
sky/shell/platform/mojo/application_impl.h
sky/shell/platform/mojo/application_impl.h
+6
-6
sky/shell/platform/mojo/view_impl.cc
sky/shell/platform/mojo/view_impl.cc
+17
-12
sky/shell/platform/mojo/view_impl.h
sky/shell/platform/mojo/view_impl.h
+6
-6
sky/shell/ui/animator.h
sky/shell/ui/animator.h
+2
-2
sky/shell/ui/engine.cc
sky/shell/ui/engine.cc
+11
-6
未找到文件。
DEPS
浏览文件 @
95b5d5df
...
...
@@ -235,7 +235,7 @@ hooks = [
},
# Pull the mojom parser binaries using checked-in hashes.
{
'name': 'mojom_
parser
',
'name': 'mojom_
tool
',
'pattern': '',
'action': [ 'download_from_google_storage',
'--no_resume',
...
...
@@ -243,11 +243,11 @@ hooks = [
'--platform=linux*',
'--no_auth',
'--bucket', 'mojo/mojom_parser/linux64',
'-s', 'src/mojo/public/tools/bindings/mojom_
parser/bin/linux64/mojom_parser
.sha1',
'-s', 'src/mojo/public/tools/bindings/mojom_
tool/bin/linux64/mojom
.sha1',
],
},
{
'name': 'mojom_
parser
',
'name': 'mojom_
tool
',
'pattern': '',
'action': [ 'download_from_google_storage',
'--no_resume',
...
...
@@ -255,7 +255,7 @@ hooks = [
'--platform=darwin',
'--no_auth',
'--bucket', 'mojo/mojom_parser/mac64',
'-s', 'src/mojo/public/tools/bindings/mojom_
parser/bin/mac64/mojom_parser
.sha1',
'-s', 'src/mojo/public/tools/bindings/mojom_
tool/bin/mac64/mojom
.sha1',
],
},
{
...
...
mojo/gpu/gl_context.cc
浏览文件 @
95b5d5df
...
...
@@ -12,12 +12,12 @@ namespace mojo {
GLContext
::
Observer
::~
Observer
()
{}
GLContext
::
GLContext
(
CommandBufferPtr
command_buffer
)
:
weak_factory_
(
this
)
{
context_
=
MGLCreateContext
(
MGL_API_VERSION_GLES2
,
command_buffer
.
PassInterface
()
.
PassHandle
().
release
().
value
(),
MGL_NO_CONTEXT
,
&
ContextLostThunk
,
this
,
Environment
::
GetDefaultAsyncWaiter
());
GLContext
::
GLContext
(
InterfaceHandle
<
CommandBuffer
>
command_buffer
)
:
weak_factory_
(
this
)
{
context_
=
MGLCreateContext
(
MGL_API_VERSION_GLES2
,
command_buffer
.
PassHandle
().
release
().
value
(),
MGL_NO_CONTEXT
,
&
ContextLostThunk
,
this
,
Environment
::
GetDefaultAsyncWaiter
());
DCHECK
(
context_
!=
MGL_NO_CONTEXT
);
}
...
...
@@ -32,13 +32,13 @@ base::WeakPtr<GLContext> GLContext::CreateOffscreen(
GetProxy
(
&
native_viewport
),
nullptr
);
GpuPtr
gpu_service
;
ConnectToService
(
native_viewport
.
get
(),
&
gpu_service
);
CommandBufferPtr
command_buffer
;
InterfaceHandle
<
CommandBuffer
>
command_buffer
;
gpu_service
->
CreateOffscreenGLES2Context
(
GetProxy
(
&
command_buffer
));
return
CreateFromCommandBuffer
(
command_buffer
.
Pass
());
}
base
::
WeakPtr
<
GLContext
>
GLContext
::
CreateFromCommandBuffer
(
CommandBufferPtr
command_buffer
)
{
InterfaceHandle
<
CommandBuffer
>
command_buffer
)
{
return
(
new
GLContext
(
command_buffer
.
Pass
()))
->
weak_factory_
.
GetWeakPtr
();
}
...
...
mojo/gpu/gl_context.h
浏览文件 @
95b5d5df
...
...
@@ -33,7 +33,7 @@ class GLContext {
// Creates a GL context from a command buffer.
static
base
::
WeakPtr
<
GLContext
>
CreateFromCommandBuffer
(
CommandBufferPtr
command_buffer
);
InterfaceHandle
<
CommandBuffer
>
command_buffer
);
void
MakeCurrent
();
bool
IsCurrent
();
...
...
@@ -43,7 +43,7 @@ class GLContext {
void
RemoveObserver
(
Observer
*
observer
);
private:
explicit
GLContext
(
CommandBufferPtr
command_buffer
);
explicit
GLContext
(
InterfaceHandle
<
CommandBuffer
>
command_buffer
);
~
GLContext
();
static
void
ContextLostThunk
(
void
*
self
);
...
...
sky/engine/bindings/mojo_services.cc
浏览文件 @
95b5d5df
...
...
@@ -40,9 +40,9 @@ void DartTakeServicesProvidedToEmbedder(Dart_NativeArguments args) {
args
,
GetMojoServices
()
->
TakeServicesProvidedToEmbedder
().
value
());
}
void
DartTakeViewH
ostH
andle
(
Dart_NativeArguments
args
)
{
void
DartTakeViewHandle
(
Dart_NativeArguments
args
)
{
Dart_SetIntegerReturnValue
(
args
,
GetMojoServices
()
->
TakeViewH
ostH
andle
().
value
());
args
,
GetMojoServices
()
->
TakeViewHandle
().
value
());
}
}
// namespace
...
...
@@ -53,7 +53,7 @@ void MojoServices::RegisterNatives(DartLibraryNatives* natives) {
{
"takeServicesProvidedByEmbedder"
,
DartTakeServicesProvidedByEmbedder
,
0
,
true
},
{
"takeServicesProvidedToEmbedder"
,
DartTakeServicesProvidedToEmbedder
,
0
,
true
},
{
"takeShellProxyHandle"
,
DartTakeShellProxyHandle
,
0
,
true
},
{
"takeViewH
ostHandle"
,
DartTakeViewHost
Handle
,
0
,
true
},
{
"takeViewH
andle"
,
DartTakeView
Handle
,
0
,
true
},
});
}
...
...
@@ -84,23 +84,23 @@ MojoServices::~MojoServices() {
}
mojo
::
Handle
MojoServices
::
TakeShellProxy
()
{
return
services_
?
services_
->
shell
.
Pass
Interface
().
Pass
Handle
().
release
()
:
mojo
::
Handle
();
return
services_
?
services_
->
shell
.
PassHandle
().
release
()
:
mojo
::
Handle
();
}
mojo
::
Handle
MojoServices
::
TakeServicesProvidedByEmbedder
()
{
return
services_from_embedder_
.
PassInterface
().
PassHandle
().
release
();
return
services_from_embedder_
.
PassInterface
Handle
().
PassHandle
().
release
();
}
mojo
::
Handle
MojoServices
::
TakeRootBundleHandle
()
{
return
root_bundle_
.
PassInterface
().
PassHandle
().
release
();
return
root_bundle_
.
PassInterface
Handle
().
PassHandle
().
release
();
}
mojo
::
Handle
MojoServices
::
TakeServicesProvidedToEmbedder
()
{
return
services_provided_to_embedder_
.
PassMessagePipe
().
release
();
}
mojo
::
Handle
MojoServices
::
TakeViewH
ostH
andle
()
{
return
services_
?
services_
->
view
_host
.
PassInterface
()
.
PassHandle
().
release
()
:
mojo
::
Handle
();
mojo
::
Handle
MojoServices
::
TakeViewHandle
()
{
return
services_
?
services_
->
view
.
PassHandle
().
release
()
:
mojo
::
Handle
();
}
}
// namespace blink
sky/engine/bindings/mojo_services.h
浏览文件 @
95b5d5df
...
...
@@ -33,7 +33,7 @@ class MojoServices {
mojo
::
Handle
TakeServicesProvidedByEmbedder
();
mojo
::
Handle
TakeServicesProvidedToEmbedder
();
mojo
::
Handle
TakeRootBundleHandle
();
mojo
::
Handle
TakeViewH
ostH
andle
();
mojo
::
Handle
TakeViewHandle
();
private:
explicit
MojoServices
(
sky
::
ServicesDataPtr
services
,
...
...
sky/engine/core/dart/mojo_services.dart
浏览文件 @
95b5d5df
...
...
@@ -8,4 +8,4 @@ int takeRootBundleHandle() native "takeRootBundleHandle";
int
takeServicesProvidedByEmbedder
(
)
native
"takeServicesProvidedByEmbedder"
;
int
takeServicesProvidedToEmbedder
(
)
native
"takeServicesProvidedToEmbedder"
;
int
takeShellProxyHandle
(
)
native
"takeShellProxyHandle"
;
int
takeViewH
ostHandle
(
)
native
"takeViewHost
Handle"
;
int
takeViewH
andle
(
)
native
"takeView
Handle"
;
sky/services/engine/sky_engine.mojom
浏览文件 @
95b5d5df
...
...
@@ -31,7 +31,7 @@ struct ServicesData {
mojo.Shell? shell;
mojo.ServiceProvider? services_provided_by_embedder;
mojo.ServiceProvider&? services_provided_to_embedder;
mojo.ui.View
Host? view_host
;
mojo.ui.View
? view
;
mojo.gfx.composition.SceneScheduler? scene_scheduler;
};
...
...
sky/shell/platform/android/sky_main.cc
浏览文件 @
95b5d5df
...
...
@@ -76,8 +76,7 @@ static void Init(JNIEnv* env,
g_java_message_loop
.
Get
().
reset
(
new
base
::
MessageLoopForUI
);
base
::
MessageLoopForUI
::
current
()
->
Start
();
mojo
::
embedder
::
Init
(
std
::
unique_ptr
<
mojo
::
embedder
::
PlatformSupport
>
(
new
mojo
::
embedder
::
SimplePlatformSupport
()));
mojo
::
embedder
::
Init
(
mojo
::
embedder
::
CreateSimplePlatformSupport
());
CHECK
(
gfx
::
GLSurface
::
InitializeOneOff
());
Shell
::
InitStandalone
();
...
...
sky/shell/platform/linux/main_linux.cc
浏览文件 @
95b5d5df
...
...
@@ -27,8 +27,7 @@ int main(int argc, const char* argv[]) {
base
::
MessageLoop
message_loop
;
mojo
::
embedder
::
Init
(
std
::
unique_ptr
<
mojo
::
embedder
::
PlatformSupport
>
(
new
mojo
::
embedder
::
SimplePlatformSupport
()));
mojo
::
embedder
::
Init
(
mojo
::
embedder
::
CreateSimplePlatformSupport
());
sky
::
shell
::
Shell
::
InitStandalone
();
...
...
sky/shell/platform/mac/platform_mac.mm
浏览文件 @
95b5d5df
...
...
@@ -86,8 +86,7 @@ int PlatformMacMain(int argc,
message_loop
->
Attach
();
#endif
mojo
::
embedder
::
Init
(
std
::
unique_ptr
<
mojo
::
embedder
::
PlatformSupport
>
(
new
mojo
::
embedder
::
SimplePlatformSupport
()));
mojo
::
embedder
::
Init
(
mojo
::
embedder
::
CreateSimplePlatformSupport
());
CHECK
(
gfx
::
GLSurface
::
InitializeOneOff
());
sky
::
shell
::
Shell
::
InitStandalone
();
...
...
sky/shell/platform/mojo/application_impl.cc
浏览文件 @
95b5d5df
...
...
@@ -25,11 +25,11 @@ ApplicationImpl::~ApplicationImpl() {
}
}
void
ApplicationImpl
::
Initialize
(
mojo
::
ShellPtr
shell
,
void
ApplicationImpl
::
Initialize
(
mojo
::
InterfaceHandle
<
mojo
::
Shell
>
shell
,
mojo
::
Array
<
mojo
::
String
>
args
,
const
mojo
::
String
&
url
)
{
DCHECK
(
initial_response_
);
shell_
=
shell
.
Pass
(
);
shell_
=
mojo
::
ShellPtr
::
Create
(
shell
.
Pass
()
);
url_
=
url
;
UnpackInitialResponse
(
shell_
.
get
());
}
...
...
@@ -37,7 +37,7 @@ void ApplicationImpl::Initialize(mojo::ShellPtr shell,
void
ApplicationImpl
::
AcceptConnection
(
const
mojo
::
String
&
requestor_url
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
outgoing_services
,
mojo
::
ServiceProviderPtr
incoming_services
,
mojo
::
InterfaceHandle
<
mojo
::
ServiceProvider
>
incoming_services
,
const
mojo
::
String
&
resolved_url
)
{
service_provider_bindings_
.
AddBinding
(
this
,
outgoing_services
.
Pass
());
}
...
...
@@ -56,7 +56,7 @@ void ApplicationImpl::ConnectToService(const mojo::String& service_name,
void
ApplicationImpl
::
ConnectToApplication
(
const
mojo
::
String
&
application_url
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
services
,
mojo
::
ServiceProviderPtr
exposed_services
)
{
mojo
::
InterfaceHandle
<
mojo
::
ServiceProvider
>
exposed_services
)
{
shell_
->
ConnectToApplication
(
application_url
,
services
.
Pass
(),
exposed_services
.
Pass
());
...
...
@@ -68,10 +68,9 @@ void ApplicationImpl::CreateApplicationConnector(
}
void
ApplicationImpl
::
CreateView
(
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
outgoing_services
,
mojo
::
ServiceProviderPtr
incoming_services
,
const
mojo
::
ui
::
ViewProvider
::
CreateViewCallback
&
callback
)
{
mojo
::
InterfaceRequest
<
mojo
::
ui
::
ViewOwner
>
view_owner
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
outgoing_services
,
mojo
::
InterfaceHandle
<
mojo
::
ServiceProvider
>
incoming_services
)
{
// TODO(abarth): Rather than proxying the shell, we should give Dart an
// ApplicationConnectorPtr instead of a ShellPtr.
mojo
::
ShellPtr
shell
;
...
...
@@ -82,7 +81,7 @@ void ApplicationImpl::CreateView(
services
->
services_provided_by_embedder
=
incoming_services
.
Pass
();
services
->
services_provided_to_embedder
=
outgoing_services
.
Pass
();
ViewImpl
*
view
=
new
ViewImpl
(
services
.
Pass
(),
url_
,
callback
);
ViewImpl
*
view
=
new
ViewImpl
(
view_owner
.
Pass
(),
services
.
Pass
(),
url_
);
view
->
Run
(
flx_path_
);
}
...
...
sky/shell/platform/mojo/application_impl.h
浏览文件 @
95b5d5df
...
...
@@ -29,13 +29,13 @@ class ApplicationImpl : public mojo::Application,
private:
// mojo::Application
void
Initialize
(
mojo
::
ShellPtr
shell
,
void
Initialize
(
mojo
::
InterfaceHandle
<
mojo
::
Shell
>
shell
,
mojo
::
Array
<
mojo
::
String
>
args
,
const
mojo
::
String
&
url
)
override
;
void
AcceptConnection
(
const
mojo
::
String
&
requestor_url
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
outgoing_services
,
mojo
::
ServiceProviderPtr
incoming_services
,
mojo
::
InterfaceHandle
<
mojo
::
ServiceProvider
>
incoming_services
,
const
mojo
::
String
&
resolved_url
)
override
;
void
RequestQuit
()
override
;
...
...
@@ -47,15 +47,15 @@ class ApplicationImpl : public mojo::Application,
void
ConnectToApplication
(
const
mojo
::
String
&
application_url
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
services
,
mojo
::
ServiceProviderPtr
exposed_services
)
override
;
mojo
::
InterfaceHandle
<
mojo
::
ServiceProvider
>
exposed_services
)
override
;
void
CreateApplicationConnector
(
mojo
::
InterfaceRequest
<
mojo
::
ApplicationConnector
>
request
)
override
;
// mojo::ui::ViewProvider
void
CreateView
(
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
services
,
mojo
::
ServiceProviderPtr
exposed
_services
,
const
mojo
::
ui
::
ViewProvider
::
CreateViewCallback
&
callback
)
override
;
mojo
::
InterfaceRequest
<
mojo
::
ui
::
ViewOwner
>
view_owner
,
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
incoming
_services
,
mojo
::
InterfaceHandle
<
mojo
::
ServiceProvider
>
outgoing_services
)
override
;
void
UnpackInitialResponse
(
mojo
::
Shell
*
shell
);
...
...
sky/shell/platform/mojo/view_impl.cc
浏览文件 @
95b5d5df
...
...
@@ -11,22 +11,25 @@
namespace
sky
{
namespace
shell
{
ViewImpl
::
ViewImpl
(
ServicesDataPtr
services
,
const
std
::
string
&
url
,
const
mojo
::
ui
::
ViewProvider
::
CreateViewCallback
&
callback
)
ViewImpl
::
ViewImpl
(
mojo
::
InterfaceRequest
<
mojo
::
ui
::
ViewOwner
>
view_owner
,
ServicesDataPtr
services
,
const
std
::
string
&
url
)
:
binding_
(
this
),
url_
(
url
),
listener_binding_
(
this
)
{
DCHECK
(
services
);
mojo
::
ui
::
ViewHostPtr
view_host
;
// Once we're done invoking |Shell|, we put it back inside |services| and pass
// it off.
mojo
::
ShellPtr
shell
=
mojo
::
ShellPtr
::
Create
(
services
->
shell
.
Pass
());
// Views
mojo
::
ConnectToService
(
s
ervices
->
s
hell
.
get
(),
"mojo:view_manager_service"
,
&
view_manager_
);
shell
.
get
(),
"mojo:view_manager_service"
,
&
view_manager_
);
mojo
::
ui
::
ViewPtr
view
;
binding_
.
Bind
(
mojo
::
GetProxy
(
&
view
));
view_manager_
->
RegisterView
(
view
.
Pass
(),
mojo
::
GetProxy
(
&
view_host
),
url_
,
callback
);
view_host
->
GetServiceProvider
(
mojo
::
GetProxy
(
&
view_service_provider_
));
mojo
::
ui
::
ViewListenerPtr
view_listener
;
binding_
.
Bind
(
mojo
::
GetProxy
(
&
view_listener
));
view_manager_
->
CreateView
(
mojo
::
GetProxy
(
&
view
),
view_owner
.
Pass
(),
view_listener
.
Pass
(),
url_
);
view
->
GetServiceProvider
(
mojo
::
GetProxy
(
&
view_service_provider_
));
// Input
mojo
::
ConnectToService
(
view_service_provider_
.
get
(),
&
input_connection_
);
...
...
@@ -36,16 +39,18 @@ ViewImpl::ViewImpl(ServicesDataPtr services,
// Compositing
mojo
::
gfx
::
composition
::
ScenePtr
scene
;
view
_host
->
CreateScene
(
mojo
::
GetProxy
(
&
scene
));
view
->
CreateScene
(
mojo
::
GetProxy
(
&
scene
));
scene
->
GetScheduler
(
mojo
::
GetProxy
(
&
services
->
scene_scheduler
));
services
->
view
_host
=
view_host
.
Pass
();
services
->
view
=
view
.
Pass
();
// Engine
shell_view_
.
reset
(
new
ShellView
(
Shell
::
Shared
()));
shell_view_
->
view
()
->
ConnectToEngine
(
GetProxy
(
&
engine_
));
mojo
::
ApplicationConnectorPtr
connector
;
s
ervices
->
s
hell
->
CreateApplicationConnector
(
mojo
::
GetProxy
(
&
connector
));
shell
->
CreateApplicationConnector
(
mojo
::
GetProxy
(
&
connector
));
platform_view
()
->
InitRasterizer
(
connector
.
Pass
(),
scene
.
Pass
());
services
->
shell
=
shell
.
Pass
();
engine_
->
SetServices
(
services
.
Pass
());
}
...
...
sky/shell/platform/mojo/view_impl.h
浏览文件 @
95b5d5df
...
...
@@ -20,18 +20,18 @@
namespace
sky
{
namespace
shell
{
class
ViewImpl
:
public
mojo
::
ui
::
View
,
class
ViewImpl
:
public
mojo
::
ui
::
View
Listener
,
public
mojo
::
ui
::
InputListener
{
public:
ViewImpl
(
ServicesDataPtr
services
,
const
std
::
string
&
url
,
const
mojo
::
ui
::
ViewProvider
::
CreateViewCallback
&
callback
);
ViewImpl
(
mojo
::
InterfaceRequest
<
mojo
::
ui
::
ViewOwner
>
view_owner
,
ServicesDataPtr
services
,
const
std
::
string
&
url
);
~
ViewImpl
()
override
;
void
Run
(
base
::
FilePath
flx_path
);
private:
// mojo::ui::View
// mojo::ui::View
Listener
void
OnLayout
(
mojo
::
ui
::
ViewLayoutParamsPtr
layout_params
,
mojo
::
Array
<
uint32_t
>
children_needing_layout
,
const
OnLayoutCallback
&
callback
)
override
;
...
...
@@ -45,7 +45,7 @@ class ViewImpl : public mojo::ui::View,
return
static_cast
<
PlatformViewMojo
*>
(
shell_view_
->
view
());
}
mojo
::
StrongBinding
<
mojo
::
ui
::
View
>
binding_
;
mojo
::
StrongBinding
<
mojo
::
ui
::
View
Listener
>
binding_
;
std
::
string
url_
;
mojo
::
ui
::
ViewManagerPtr
view_manager_
;
mojo
::
ServiceProviderPtr
view_service_provider_
;
...
...
sky/shell/ui/animator.h
浏览文件 @
95b5d5df
...
...
@@ -29,8 +29,8 @@ class Animator {
void
set_vsync_provider
(
vsync
::
VSyncProviderPtr
vsync_provider
);
void
set_scene_scheduler
(
mojo
::
gfx
::
composition
::
SceneSchedulerPtr
scene_scheduler
)
{
scene_scheduler_
=
scene_scheduler
.
Pass
(
);
mojo
::
InterfaceHandle
<
mojo
::
gfx
::
composition
::
SceneScheduler
>
scene_scheduler
)
{
scene_scheduler_
=
mojo
::
gfx
::
composition
::
SceneSchedulerPtr
::
Create
(
scene_scheduler
.
Pass
()
);
}
...
...
sky/shell/ui/engine.cc
浏览文件 @
95b5d5df
...
...
@@ -104,8 +104,8 @@ void Engine::SetServices(ServicesDataPtr services) {
services_
=
services
.
Pass
();
if
(
services_
->
services_provided_by_embedder
)
{
services_provided_by_embedder_
=
services_
->
services_provided_by_embedder
.
Pass
();
services_provided_by_embedder_
=
mojo
::
ServiceProviderPtr
::
Create
(
services_
->
services_provided_by_embedder
.
Pass
()
)
;
service_provider_impl_
.
set_fallback_service_provider
(
services_provided_by_embedder_
.
get
());
}
...
...
@@ -117,11 +117,16 @@ void Engine::SetServices(ServicesDataPtr services) {
#if defined(OS_ANDROID) || defined(OS_IOS)
vsync
::
VSyncProviderPtr
vsync_provider
;
if
(
services_
->
shell
)
{
mojo
::
ConnectToService
(
services_
->
shell
.
get
(),
"mojo:vsync"
,
&
vsync_provider
);
// We bind and unbind our Shell here, since this is the only place we use
// it in this class.
auto
shell
=
mojo
::
ShellPtr
::
Create
(
services_
->
shell
.
Pass
());
mojo
::
ConnectToService
(
shell
.
get
(),
"mojo:vsync"
,
&
vsync_provider
);
services_
->
shell
=
shell
.
Pass
();
}
else
{
mojo
::
ConnectToService
(
services_provided_by_embedder_
.
get
(),
&
vsync_provider
);
auto
embedder_services
=
mojo
::
ServiceProviderPtr
::
Create
(
services_
->
services_provided_by_embedder
.
Pass
());
mojo
::
ConnectToService
(
embedder_services
.
get
(),
&
vsync_provider
);
services_
->
services_provided_by_embedder
=
embedder_services
.
Pass
();
}
animator_
->
Reset
();
animator_
->
set_vsync_provider
(
vsync_provider
.
Pass
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录