Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
8a01ce59
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,发现更多精彩内容 >>
未验证
提交
8a01ce59
编写于
2月 02, 2021
作者:
M
Michael Reed
提交者:
GitHub
2月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update to sampling versions (#24125)
Co-authored-by:
N
Mike Reed
<
reed@google.com
>
上级
daaaee2c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
13 deletion
+21
-13
flow/instrumentation.cc
flow/instrumentation.cc
+1
-2
flow/layers/image_filter_layer_unittests.cc
flow/layers/image_filter_layer_unittests.cc
+16
-8
lib/ui/painting/image_filter.cc
lib/ui/painting/image_filter.cc
+4
-3
未找到文件。
flow/instrumentation.cc
浏览文件 @
8a01ce59
...
...
@@ -225,8 +225,7 @@ void Stopwatch::Visualize(SkCanvas* canvas, const SkRect& rect) const {
prev_drawn_sample_index_
=
current_sample_
;
// Draw the cached surface onto the output canvas.
paint
.
reset
();
visualize_cache_surface_
->
draw
(
canvas
,
rect
.
x
(),
rect
.
y
(),
&
paint
);
visualize_cache_surface_
->
draw
(
canvas
,
rect
.
x
(),
rect
.
y
());
}
CounterValues
::
CounterValues
()
:
current_sample_
(
kMaxSamples
-
1
)
{
...
...
flow/layers/image_filter_layer_unittests.cc
浏览文件 @
8a01ce59
...
...
@@ -75,7 +75,8 @@ TEST_F(ImageFilterLayerTest, SimpleFilter) {
const
SkPath
child_path
=
SkPath
().
addRect
(
child_bounds
);
const
SkPaint
child_paint
=
SkPaint
(
SkColors
::
kYellow
);
auto
layer_filter
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
mock_layer
=
std
::
make_shared
<
MockLayer
>
(
child_path
,
child_paint
);
auto
layer
=
std
::
make_shared
<
ImageFilterLayer
>
(
layer_filter
);
layer
->
Add
(
mock_layer
);
...
...
@@ -109,7 +110,8 @@ TEST_F(ImageFilterLayerTest, SimpleFilterBounds) {
const
SkPaint
child_paint
=
SkPaint
(
SkColors
::
kYellow
);
const
SkMatrix
filter_transform
=
SkMatrix
::
Scale
(
2.0
,
2.0
);
auto
layer_filter
=
SkImageFilters
::
MatrixTransform
(
filter_transform
,
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
filter_transform
,
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
mock_layer
=
std
::
make_shared
<
MockLayer
>
(
child_path
,
child_paint
);
auto
layer
=
std
::
make_shared
<
ImageFilterLayer
>
(
layer_filter
);
layer
->
Add
(
mock_layer
);
...
...
@@ -144,7 +146,8 @@ TEST_F(ImageFilterLayerTest, MultipleChildren) {
const
SkPaint
child_paint1
=
SkPaint
(
SkColors
::
kYellow
);
const
SkPaint
child_paint2
=
SkPaint
(
SkColors
::
kCyan
);
auto
layer_filter
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
mock_layer1
=
std
::
make_shared
<
MockLayer
>
(
child_path1
,
child_paint1
);
auto
mock_layer2
=
std
::
make_shared
<
MockLayer
>
(
child_path2
,
child_paint2
);
auto
layer
=
std
::
make_shared
<
ImageFilterLayer
>
(
layer_filter
);
...
...
@@ -189,9 +192,11 @@ TEST_F(ImageFilterLayerTest, Nested) {
const
SkPaint
child_paint1
=
SkPaint
(
SkColors
::
kYellow
);
const
SkPaint
child_paint2
=
SkPaint
(
SkColors
::
kCyan
);
auto
layer_filter1
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
layer_filter2
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
mock_layer1
=
std
::
make_shared
<
MockLayer
>
(
child_path1
,
child_paint1
);
auto
mock_layer2
=
std
::
make_shared
<
MockLayer
>
(
child_path2
,
child_paint2
);
auto
layer1
=
std
::
make_shared
<
ImageFilterLayer
>
(
layer_filter1
);
...
...
@@ -242,7 +247,8 @@ TEST_F(ImageFilterLayerTest, Nested) {
TEST_F
(
ImageFilterLayerTest
,
Readback
)
{
auto
layer_filter
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
initial_transform
=
SkMatrix
();
// ImageFilterLayer does not read from surface
...
...
@@ -262,7 +268,8 @@ TEST_F(ImageFilterLayerTest, Readback) {
TEST_F
(
ImageFilterLayerTest
,
ChildIsCached
)
{
auto
layer_filter
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
initial_transform
=
SkMatrix
::
Translate
(
50.0
,
25.5
);
auto
other_transform
=
SkMatrix
::
Scale
(
1.0
,
2.0
);
const
SkPath
child_path
=
SkPath
().
addRect
(
SkRect
::
MakeWH
(
5.0
f
,
5.0
f
));
...
...
@@ -291,7 +298,8 @@ TEST_F(ImageFilterLayerTest, ChildIsCached) {
TEST_F
(
ImageFilterLayerTest
,
ChildrenNotCached
)
{
auto
layer_filter
=
SkImageFilters
::
MatrixTransform
(
SkMatrix
(),
SkFilterQuality
::
kMedium_SkFilterQuality
,
nullptr
);
SkMatrix
(),
SkSamplingOptions
(
SkFilterMode
::
kLinear
,
SkMipmapMode
::
kLinear
),
nullptr
);
auto
initial_transform
=
SkMatrix
::
Translate
(
50.0
,
25.5
);
auto
other_transform
=
SkMatrix
::
Scale
(
1.0
,
2.0
);
const
SkPath
child_path1
=
SkPath
().
addRect
(
SkRect
::
MakeWH
(
5.0
f
,
5.0
f
));
...
...
lib/ui/painting/image_filter.cc
浏览文件 @
8a01ce59
...
...
@@ -60,9 +60,10 @@ void ImageFilter::initBlur(double sigma_x,
void
ImageFilter
::
initMatrix
(
const
tonic
::
Float64List
&
matrix4
,
int
filterQuality
)
{
filter_
=
SkImageFilters
::
MatrixTransform
(
ToSkMatrix
(
matrix4
),
static_cast
<
SkFilterQuality
>
(
filterQuality
),
nullptr
);
auto
sampling
=
SkSamplingOptions
(
static_cast
<
SkFilterQuality
>
(
filterQuality
),
SkSamplingOptions
::
kMedium_asMipmapLinear
);
filter_
=
SkImageFilters
::
MatrixTransform
(
ToSkMatrix
(
matrix4
),
sampling
,
nullptr
);
}
void
ImageFilter
::
initColorFilter
(
ColorFilter
*
colorFilter
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录