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