Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
58e6c23e
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,发现更多精彩内容 >>
提交
58e6c23e
编写于
2月 06, 2018
作者:
B
Brian Salomon
提交者:
Jason Simmons
2月 06, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modernize GrContext creation (#4640)
上级
76d4928b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
34 deletion
+19
-34
content_handler/vulkan_surface_producer.cc
content_handler/vulkan_surface_producer.cc
+1
-3
lib/ui/painting/resource_context.cc
lib/ui/painting/resource_context.cc
+2
-2
lib/ui/painting/resource_context.h
lib/ui/painting/resource_context.h
+1
-1
shell/common/platform_view.cc
shell/common/platform_view.cc
+13
-19
shell/gpu/gpu_surface_gl.cc
shell/gpu/gpu_surface_gl.cc
+1
-6
vulkan/vulkan_window.cc
vulkan/vulkan_window.cc
+1
-3
未找到文件。
content_handler/vulkan_surface_producer.cc
浏览文件 @
58e6c23e
...
...
@@ -103,9 +103,7 @@ bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) {
logical_device_
->
ReleaseDeviceOwnership
();
application_
->
ReleaseInstanceOwnership
();
context_
.
reset
(
GrContext
::
Create
(
kVulkan_GrBackend
,
reinterpret_cast
<
GrBackendContext
>
(
backend_context_
.
get
())));
context_
=
GrContext
::
MakeVulkan
(
backend_context
);
context_
->
setResourceCacheLimits
(
vulkan
::
kGrCacheMaxCount
,
vulkan
::
kGrCacheMaxByteSize
);
...
...
lib/ui/painting/resource_context.cc
浏览文件 @
58e6c23e
...
...
@@ -24,9 +24,9 @@ ResourceContext::~ResourceContext() {
g_mutex
.
Unlock
();
}
void
ResourceContext
::
Set
(
GrContext
*
context
)
{
void
ResourceContext
::
Set
(
sk_sp
<
GrContext
>
context
)
{
FXL_DCHECK
(
!
g_context
);
g_context
=
context
;
g_context
=
context
.
release
()
;
}
GrContext
*
ResourceContext
::
Get
()
{
...
...
lib/ui/painting/resource_context.h
浏览文件 @
58e6c23e
...
...
@@ -15,7 +15,7 @@ class ResourceContext {
/**
* Globally set the GrContext singleton instance.
*/
static
void
Set
(
GrContext
*
context
);
static
void
Set
(
sk_sp
<
GrContext
>
context
);
/**
* Acquire a GrContext wrapping ResourceContext that's also an exclusive mutex
...
...
shell/common/platform_view.cc
浏览文件 @
58e6c23e
...
...
@@ -47,7 +47,7 @@ void PlatformView::CreateEngine() {
void
PlatformView
::
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
)
{
blink
::
Threads
::
UI
()
->
PostTask
(
[
engine
=
engine_
->
GetWeakPtr
(),
message
=
std
::
move
(
message
)
]
{
[
engine
=
engine_
->
GetWeakPtr
(),
message
=
std
::
move
(
message
)
]
{
if
(
engine
)
{
engine
->
DispatchPlatformMessage
(
message
);
}
...
...
@@ -58,7 +58,7 @@ void PlatformView::DispatchSemanticsAction(int32_t id,
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
blink
::
Threads
::
UI
()
->
PostTask
(
[
engine
=
engine_
->
GetWeakPtr
(),
id
,
action
,
args
=
std
::
move
(
args
)
]
{
[
engine
=
engine_
->
GetWeakPtr
(),
id
,
action
,
args
=
std
::
move
(
args
)
]
{
if
(
engine
)
{
engine
->
DispatchSemanticsAction
(
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
),
std
::
move
(
args
));
...
...
@@ -67,7 +67,7 @@ void PlatformView::DispatchSemanticsAction(int32_t id,
}
void
PlatformView
::
SetSemanticsEnabled
(
bool
enabled
)
{
blink
::
Threads
::
UI
()
->
PostTask
([
engine
=
engine_
->
GetWeakPtr
(),
enabled
]
{
blink
::
Threads
::
UI
()
->
PostTask
([
engine
=
engine_
->
GetWeakPtr
(),
enabled
]
{
if
(
engine
)
engine
->
SetSemanticsEnabled
(
enabled
);
});
...
...
@@ -81,18 +81,14 @@ void PlatformView::NotifyCreated(std::unique_ptr<Surface> surface,
fxl
::
Closure
caller_continuation
)
{
fxl
::
AutoResetWaitableEvent
latch
;
auto
ui_continuation
=
fxl
::
MakeCopyable
([
this
,
//
surface
=
std
::
move
(
surface
),
//
caller_continuation
,
//
&
latch
]()
mutable
{
auto
gpu_continuation
=
fxl
::
MakeCopyable
([
this
,
//
surface
=
std
::
move
(
surface
),
//
caller_continuation
,
//
&
latch
]()
mutable
{
auto
ui_continuation
=
fxl
::
MakeCopyable
([
this
,
//
surface
=
std
::
move
(
surface
),
//
caller_continuation
,
//
&
latch
]()
mutable
{
auto
gpu_continuation
=
fxl
::
MakeCopyable
([
this
,
//
surface
=
std
::
move
(
surface
),
//
caller_continuation
,
//
&
latch
]()
mutable
{
// Runs on the GPU Thread. So does the Caller Continuation.
rasterizer_
->
Setup
(
std
::
move
(
surface
),
caller_continuation
,
&
latch
);
});
...
...
@@ -195,10 +191,8 @@ void PlatformView::SetupResourceContextOnIOThreadPerform(
// that feature, which will cause texture uploads to do CPU YUV conversion.
options
.
fDisableGpuYUVConversion
=
true
;
blink
::
ResourceContext
::
Set
(
GrContext
::
Create
(
GrBackend
::
kOpenGL_GrBackend
,
reinterpret_cast
<
GrBackendContext
>
(
GrGLCreateNativeInterface
()),
options
));
blink
::
ResourceContext
::
Set
(
GrContext
::
MakeGL
(
GrGLMakeNativeInterface
(),
options
));
// Do not cache textures created by the image decoder. These textures should
// be deleted when they are no longer referenced by an SkImage.
...
...
shell/gpu/gpu_surface_gl.cc
浏览文件 @
58e6c23e
...
...
@@ -30,14 +30,10 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate)
return
;
}
auto
backend_context
=
reinterpret_cast
<
GrBackendContext
>
(
GrGLCreateNativeInterface
());
GrContextOptions
options
;
options
.
fAvoidStencilBuffers
=
true
;
auto
context
=
sk_sp
<
GrContext
>
(
GrContext
::
Create
(
kOpenGL_GrBackend
,
backend_context
,
options
));
auto
context
=
GrContext
::
MakeGL
(
GrGLMakeNativeInterface
(),
options
);
if
(
context
==
nullptr
)
{
FXL_LOG
(
ERROR
)
<<
"Failed to setup Skia Gr context."
;
...
...
@@ -80,7 +76,6 @@ static GrPixelConfig FirstSupportedConfig(GrContext* context) {
if (context->caps()->isConfigRenderable((x), false)) { \
return (x); \
}
RETURN_IF_RENDERABLE
(
kRGBA_8888_GrPixelConfig
);
RETURN_IF_RENDERABLE
(
kRGBA_4444_GrPixelConfig
);
RETURN_IF_RENDERABLE
(
kRGB_565_GrPixelConfig
);
...
...
vulkan/vulkan_window.cc
浏览文件 @
58e6c23e
...
...
@@ -103,9 +103,7 @@ bool VulkanWindow::CreateSkiaGrContext() {
return
false
;
}
sk_sp
<
GrContext
>
context
(
GrContext
::
Create
(
kVulkan_GrBackend
,
reinterpret_cast
<
GrBackendContext
>
(
backend_context
.
get
())));
sk_sp
<
GrContext
>
context
=
GrContext
::
MakeVulkan
(
backend_context
);
if
(
context
==
nullptr
)
{
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录