Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
ba775291
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,发现更多精彩内容 >>
未验证
提交
ba775291
编写于
9月 17, 2018
作者:
J
Jason Simmons
提交者:
GitHub
9月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure that Layer::AutoSaveLayer objects are not immediately destructed (#6264)
Fixes
https://github.com/flutter/flutter/issues/20859
上级
b0b19d6c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
35 addition
and
8 deletion
+35
-8
flow/layers/backdrop_filter_layer.cc
flow/layers/backdrop_filter_layer.cc
+3
-2
flow/layers/color_filter_layer.cc
flow/layers/color_filter_layer.cc
+2
-1
flow/layers/layer.cc
flow/layers/layer.cc
+13
-0
flow/layers/layer.h
flow/layers/layer.h
+13
-3
flow/layers/opacity_layer.cc
flow/layers/opacity_layer.cc
+2
-1
flow/layers/shader_mask_layer.cc
flow/layers/shader_mask_layer.cc
+2
-1
未找到文件。
flow/layers/backdrop_filter_layer.cc
浏览文件 @
ba775291
...
...
@@ -16,8 +16,9 @@ void BackdropFilterLayer::Paint(PaintContext& context) const {
TRACE_EVENT0
(
"flutter"
,
"BackdropFilterLayer::Paint"
);
FML_DCHECK
(
needs_painting
());
Layer
::
AutoSaveLayer
(
context
,
SkCanvas
::
SaveLayerRec
{
&
paint_bounds
(),
nullptr
,
filter_
.
get
(),
0
});
Layer
::
AutoSaveLayer
save
=
Layer
::
AutoSaveLayer
::
Create
(
context
,
SkCanvas
::
SaveLayerRec
{
&
paint_bounds
(),
nullptr
,
filter_
.
get
(),
0
});
PaintChildren
(
context
);
}
...
...
flow/layers/color_filter_layer.cc
浏览文件 @
ba775291
...
...
@@ -19,7 +19,8 @@ void ColorFilterLayer::Paint(PaintContext& context) const {
SkPaint
paint
;
paint
.
setColorFilter
(
std
::
move
(
color_filter
));
Layer
::
AutoSaveLayer
(
context
,
paint_bounds
(),
&
paint
);
Layer
::
AutoSaveLayer
save
=
Layer
::
AutoSaveLayer
::
Create
(
context
,
paint_bounds
(),
&
paint
);
PaintChildren
(
context
);
}
...
...
flow/layers/layer.cc
浏览文件 @
ba775291
...
...
@@ -35,6 +35,19 @@ Layer::AutoSaveLayer::AutoSaveLayer(const PaintContext& paint_context,
paint_context_
.
canvas
.
saveLayer
(
layer_rec
);
}
Layer
::
AutoSaveLayer
Layer
::
AutoSaveLayer
::
Create
(
const
PaintContext
&
paint_context
,
const
SkRect
&
bounds
,
const
SkPaint
*
paint
)
{
return
Layer
::
AutoSaveLayer
(
paint_context
,
bounds
,
paint
);
}
Layer
::
AutoSaveLayer
Layer
::
AutoSaveLayer
::
Create
(
const
PaintContext
&
paint_context
,
const
SkCanvas
::
SaveLayerRec
&
layer_rec
)
{
return
Layer
::
AutoSaveLayer
(
paint_context
,
layer_rec
);
}
Layer
::
AutoSaveLayer
::~
AutoSaveLayer
()
{
if
(
paint_context_
.
checkerboard_offscreen_layers
)
{
DrawCheckerboard
(
&
paint_context_
.
canvas
,
bounds_
);
...
...
flow/layers/layer.h
浏览文件 @
ba775291
...
...
@@ -12,6 +12,7 @@
#include "flutter/flow/raster_cache.h"
#include "flutter/flow/texture.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/trace_event.h"
...
...
@@ -67,6 +68,18 @@ class Layer {
// draws a checkerboard over the layer if that is enabled in the PaintContext.
class
AutoSaveLayer
{
public:
FML_WARN_UNUSED_RESULT
static
AutoSaveLayer
Create
(
const
PaintContext
&
paint_context
,
const
SkRect
&
bounds
,
const
SkPaint
*
paint
);
FML_WARN_UNUSED_RESULT
static
AutoSaveLayer
Create
(
const
PaintContext
&
paint_context
,
const
SkCanvas
::
SaveLayerRec
&
layer_rec
);
~
AutoSaveLayer
();
private:
AutoSaveLayer
(
const
PaintContext
&
paint_context
,
const
SkRect
&
bounds
,
const
SkPaint
*
paint
);
...
...
@@ -74,9 +87,6 @@ class Layer {
AutoSaveLayer
(
const
PaintContext
&
paint_context
,
const
SkCanvas
::
SaveLayerRec
&
layer_rec
);
~
AutoSaveLayer
();
private:
const
PaintContext
&
paint_context_
;
const
SkRect
bounds_
;
};
...
...
flow/layers/opacity_layer.cc
浏览文件 @
ba775291
...
...
@@ -17,7 +17,8 @@ void OpacityLayer::Paint(PaintContext& context) const {
SkPaint
paint
;
paint
.
setAlpha
(
alpha_
);
Layer
::
AutoSaveLayer
save
(
context
,
paint_bounds
(),
&
paint
);
Layer
::
AutoSaveLayer
save
=
Layer
::
AutoSaveLayer
::
Create
(
context
,
paint_bounds
(),
&
paint
);
PaintChildren
(
context
);
}
...
...
flow/layers/shader_mask_layer.cc
浏览文件 @
ba775291
...
...
@@ -14,7 +14,8 @@ void ShaderMaskLayer::Paint(PaintContext& context) const {
TRACE_EVENT0
(
"flutter"
,
"ShaderMaskLayer::Paint"
);
FML_DCHECK
(
needs_painting
());
Layer
::
AutoSaveLayer
(
context
,
paint_bounds
(),
nullptr
);
Layer
::
AutoSaveLayer
save
=
Layer
::
AutoSaveLayer
::
Create
(
context
,
paint_bounds
(),
nullptr
);
PaintChildren
(
context
);
SkPaint
paint
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录