Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
564f53f0
E
engine
项目概览
qq_34031325
/
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,发现更多精彩内容 >>
未验证
提交
564f53f0
编写于
7月 10, 2019
作者:
D
Dan Field
提交者:
GitHub
7月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Improve caching limits for Skia (#9503)" (#9740)
This reverts commit
63c2c331
.
上级
b453d3c3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
4 addition
and
44 deletion
+4
-44
shell/common/rasterizer.cc
shell/common/rasterizer.cc
+1
-20
shell/common/rasterizer.h
shell/common/rasterizer.h
+1
-8
shell/common/shell.cc
shell/common/shell.cc
+1
-12
shell/gpu/gpu_surface_gl.cc
shell/gpu/gpu_surface_gl.cc
+1
-4
未找到文件。
shell/common/rasterizer.cc
浏览文件 @
564f53f0
...
...
@@ -43,7 +43,6 @@ Rasterizer::Rasterizer(
:
delegate_
(
delegate
),
task_runners_
(
std
::
move
(
task_runners
)),
compositor_context_
(
std
::
move
(
compositor_context
)),
user_override_resource_cache_bytes_
(
false
),
weak_factory_
(
this
)
{
FML_DCHECK
(
compositor_context_
);
}
...
...
@@ -412,15 +411,7 @@ void Rasterizer::FireNextFrameCallbackIfPresent() {
callback
();
}
void
Rasterizer
::
SetResourceCacheMaxBytes
(
size_t
max_bytes
,
bool
from_user
)
{
user_override_resource_cache_bytes_
|=
from_user
;
if
(
!
from_user
&&
user_override_resource_cache_bytes_
)
{
// We should not update the setting here if a user has explicitly set a
// value for this over the flutter/skia channel.
return
;
}
void
Rasterizer
::
SetResourceCacheMaxBytes
(
int
max_bytes
)
{
GrContext
*
context
=
surface_
->
GetContext
();
if
(
context
)
{
int
max_resources
;
...
...
@@ -429,16 +420,6 @@ void Rasterizer::SetResourceCacheMaxBytes(size_t max_bytes, bool from_user) {
}
}
size_t
Rasterizer
::
GetResourceCacheMaxBytes
()
const
{
GrContext
*
context
=
surface_
->
GetContext
();
if
(
context
)
{
size_t
max_bytes
;
context
->
getResourceCacheLimits
(
nullptr
,
&
max_bytes
);
return
max_bytes
;
}
return
0
;
}
Rasterizer
::
Screenshot
::
Screenshot
()
{}
Rasterizer
::
Screenshot
::
Screenshot
(
sk_sp
<
SkData
>
p_data
,
SkISize
p_size
)
...
...
shell/common/rasterizer.h
浏览文件 @
564f53f0
...
...
@@ -92,13 +92,7 @@ class Rasterizer final : public SnapshotDelegate {
return
compositor_context_
.
get
();
}
// Sets the max size in bytes of the Skia resource cache. If this call is
// originating from the user, e.g. over the flutter/skia system channel,
// set from_user to true and the value will take precedence over system
// generated values, e.g. from a display resolution change.
void
SetResourceCacheMaxBytes
(
size_t
max_bytes
,
bool
from_user
);
size_t
GetResourceCacheMaxBytes
()
const
;
void
SetResourceCacheMaxBytes
(
int
max_bytes
);
private:
Delegate
&
delegate_
;
...
...
@@ -107,7 +101,6 @@ class Rasterizer final : public SnapshotDelegate {
std
::
unique_ptr
<
flutter
::
CompositorContext
>
compositor_context_
;
std
::
unique_ptr
<
flutter
::
LayerTree
>
last_layer_tree_
;
fml
::
closure
next_frame_callback_
;
bool
user_override_resource_cache_bytes_
;
fml
::
WeakPtrFactory
<
Rasterizer
>
weak_factory_
;
// |SnapshotDelegate|
...
...
shell/common/shell.cc
浏览文件 @
564f53f0
...
...
@@ -610,16 +610,6 @@ void Shell::OnPlatformViewSetViewportMetrics(const ViewportMetrics& metrics) {
FML_DCHECK
(
is_setup_
);
FML_DCHECK
(
task_runners_
.
GetPlatformTaskRunner
()
->
RunsTasksOnCurrentThread
());
// This is the formula Android uses.
// https://android.googlesource.com/platform/frameworks/base/+/master/libs/hwui/renderthread/CacheManager.cpp#41
int
max_bytes
=
metrics
.
physical_width
*
metrics
.
physical_height
*
12
*
4
;
task_runners_
.
GetGPUTaskRunner
()
->
PostTask
(
[
rasterizer
=
rasterizer_
->
GetWeakPtr
(),
max_bytes
]
{
if
(
rasterizer
)
{
rasterizer
->
SetResourceCacheMaxBytes
(
max_bytes
,
false
);
}
});
task_runners_
.
GetUITaskRunner
()
->
PostTask
(
[
engine
=
engine_
->
GetWeakPtr
(),
metrics
]()
{
if
(
engine
)
{
...
...
@@ -873,8 +863,7 @@ void Shell::HandleEngineSkiaMessage(fml::RefPtr<PlatformMessage> message) {
[
rasterizer
=
rasterizer_
->
GetWeakPtr
(),
max_bytes
=
args
->
value
.
GetInt
()]
{
if
(
rasterizer
)
{
rasterizer
->
SetResourceCacheMaxBytes
(
static_cast
<
size_t
>
(
max_bytes
),
true
);
rasterizer
->
SetResourceCacheMaxBytes
(
max_bytes
);
}
});
}
...
...
shell/gpu/gpu_surface_gl.cc
浏览文件 @
564f53f0
...
...
@@ -28,10 +28,7 @@ static const int kGrCacheMaxCount = 8192;
// Default maximum number of bytes of GPU memory of budgeted resources in the
// cache.
// The shell will dynamically increase or decrease this cache based on the
// viewport size, unless a user has specifically requested a size on the Skia
// system channel.
static
const
size_t
kGrCacheMaxByteSize
=
24
*
(
1
<<
20
);
static
const
size_t
kGrCacheMaxByteSize
=
512
*
(
1
<<
20
);
GPUSurfaceGL
::
GPUSurfaceGL
(
GPUSurfaceGLDelegate
*
delegate
)
:
delegate_
(
delegate
),
weak_factory_
(
this
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录