Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
712abb08
Unverified
Commit
712abb08
authored
Mar 28, 2022
by
wangying
Committed by
GitHub
Mar 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add benchmark for ShaderMask RasterCache (#100127)
parent
654aaa8e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
140 additions
and
1 deletion
+140
-1
.ci.yaml
.ci.yaml
+12
-1
TESTOWNERS
TESTOWNERS
+1
-0
common.dart
dev/benchmarks/macrobenchmarks/lib/common.dart
+1
-0
main.dart
dev/benchmarks/macrobenchmarks/lib/main.dart
+9
-0
shader_mask_cache.dart
...benchmarks/macrobenchmarks/lib/src/shader_mask_cache.dart
+80
-0
shader_mask_cache_perf_e2e.dart
...arks/macrobenchmarks/test/shader_mask_cache_perf_e2e.dart
+16
-0
shader_mask_cache_perf__e2e_summary.dart
...icelab/bin/tasks/shader_mask_cache_perf__e2e_summary.dart
+14
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+7
-0
No files found.
.ci.yaml
View file @
712abb08
...
@@ -1522,7 +1522,18 @@ targets:
...
@@ -1522,7 +1522,18 @@ targets:
tags
:
>
tags
:
>
["devicelab","android","linux"]
["devicelab","android","linux"]
task_name
:
color_filter_cache_perf__e2e_summary
task_name
:
color_filter_cache_perf__e2e_summary
benchmark
:
"
true"
scheduler
:
luci
-
name
:
Linux_android shader_mask_cache_perf__e2e_summary
bringup
:
true
recipe
:
devicelab/devicelab_drone
presubmit
:
false
timeout
:
60
properties
:
tags
:
>
["devicelab","android","linux"]
task_name
:
shader_mask_cache_perf__e2e_summary
scheduler
:
luci
-
name
:
Linux_android complex_layout_android__compile
-
name
:
Linux_android complex_layout_android__compile
recipe
:
devicelab/devicelab_drone
recipe
:
devicelab/devicelab_drone
...
...
TESTOWNERS
View file @
712abb08
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
/dev/devicelab/bin/tasks/basic_material_app_android__compile.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/basic_material_app_android__compile.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/codegen_integration.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/codegen_integration.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/color_filter_and_fade_perf__e2e_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/color_filter_and_fade_perf__e2e_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/shader_mask_cache_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/color_filter_cache_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/color_filter_cache_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/complex_layout_android__compile.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/complex_layout_android__compile.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/complex_layout_android__scroll_smoothness.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/complex_layout_android__scroll_smoothness.dart @zanderso @flutter/engine
...
...
dev/benchmarks/macrobenchmarks/lib/common.dart
View file @
712abb08
...
@@ -20,6 +20,7 @@ const String kFadingChildAnimationRouteName = '/fading_child_animation';
...
@@ -20,6 +20,7 @@ const String kFadingChildAnimationRouteName = '/fading_child_animation';
const
String
kImageFilteredTransformAnimationRouteName
=
'/imagefiltered_transform_animation'
;
const
String
kImageFilteredTransformAnimationRouteName
=
'/imagefiltered_transform_animation'
;
const
String
kMultiWidgetConstructionRouteName
=
'/multi_widget_construction'
;
const
String
kMultiWidgetConstructionRouteName
=
'/multi_widget_construction'
;
const
String
kHeavyGridViewRouteName
=
'/heavy_gridview'
;
const
String
kHeavyGridViewRouteName
=
'/heavy_gridview'
;
const
String
kShaderMaskCacheRouteName
=
'/shader_mask_cache'
;
const
String
kSimpleScrollRouteName
=
'/simple_scroll'
;
const
String
kSimpleScrollRouteName
=
'/simple_scroll'
;
const
String
kStackSizeRouteName
=
'/stack_size'
;
const
String
kStackSizeRouteName
=
'/stack_size'
;
const
String
kAnimationWithMicrotasksRouteName
=
'/animation_with_microtasks'
;
const
String
kAnimationWithMicrotasksRouteName
=
'/animation_with_microtasks'
;
...
...
dev/benchmarks/macrobenchmarks/lib/main.dart
View file @
712abb08
...
@@ -24,6 +24,7 @@ import 'src/opacity_peephole.dart';
...
@@ -24,6 +24,7 @@ import 'src/opacity_peephole.dart';
import
'src/picture_cache.dart'
;
import
'src/picture_cache.dart'
;
import
'src/picture_cache_complexity_scoring.dart'
;
import
'src/picture_cache_complexity_scoring.dart'
;
import
'src/post_backdrop_filter.dart'
;
import
'src/post_backdrop_filter.dart'
;
import
'src/shader_mask_cache.dart'
;
import
'src/simple_animation.dart'
;
import
'src/simple_animation.dart'
;
import
'src/simple_scroll.dart'
;
import
'src/simple_scroll.dart'
;
import
'src/stack_size.dart'
;
import
'src/stack_size.dart'
;
...
@@ -61,6 +62,7 @@ class MacrobenchmarksApp extends StatelessWidget {
...
@@ -61,6 +62,7 @@ class MacrobenchmarksApp extends StatelessWidget {
kImageFilteredTransformAnimationRouteName:
(
BuildContext
context
)
=>
const
FilteredChildAnimationPage
(
FilterType
.
rotateFilter
),
kImageFilteredTransformAnimationRouteName:
(
BuildContext
context
)
=>
const
FilteredChildAnimationPage
(
FilterType
.
rotateFilter
),
kMultiWidgetConstructionRouteName:
(
BuildContext
context
)
=>
const
MultiWidgetConstructTable
(
10
,
20
),
kMultiWidgetConstructionRouteName:
(
BuildContext
context
)
=>
const
MultiWidgetConstructTable
(
10
,
20
),
kHeavyGridViewRouteName:
(
BuildContext
context
)
=>
const
HeavyGridViewPage
(),
kHeavyGridViewRouteName:
(
BuildContext
context
)
=>
const
HeavyGridViewPage
(),
kShaderMaskCacheRouteName:
(
BuildContext
context
)
=>
const
ShaderMaskCachePage
(),
kSimpleScrollRouteName:
(
BuildContext
context
)
=>
const
SimpleScroll
(),
kSimpleScrollRouteName:
(
BuildContext
context
)
=>
const
SimpleScroll
(),
kStackSizeRouteName:
(
BuildContext
context
)
=>
const
StackSizePage
(),
kStackSizeRouteName:
(
BuildContext
context
)
=>
const
StackSizePage
(),
kAnimationWithMicrotasksRouteName:
(
BuildContext
context
)
=>
const
AnimationWithMicrotasks
(),
kAnimationWithMicrotasksRouteName:
(
BuildContext
context
)
=>
const
AnimationWithMicrotasks
(),
...
@@ -175,6 +177,13 @@ class HomePage extends StatelessWidget {
...
@@ -175,6 +177,13 @@ class HomePage extends StatelessWidget {
Navigator
.
pushNamed
(
context
,
kColorFilterCacheRouteName
);
Navigator
.
pushNamed
(
context
,
kColorFilterCacheRouteName
);
},
},
),
),
ElevatedButton
(
key:
const
Key
(
kShaderMaskCacheRouteName
),
child:
const
Text
(
'Shader Mask Cache'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
kShaderMaskCacheRouteName
);
},
),
ElevatedButton
(
ElevatedButton
(
key:
const
Key
(
kFadingChildAnimationRouteName
),
key:
const
Key
(
kFadingChildAnimationRouteName
),
child:
const
Text
(
'Fading Child Animation'
),
child:
const
Text
(
'Fading Child Animation'
),
...
...
dev/benchmarks/macrobenchmarks/lib/src/shader_mask_cache.dart
0 → 100644
View file @
712abb08
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:ui'
;
import
'package:flutter/material.dart'
;
import
'picture_cache.dart'
;
class
ShaderMaskCachePage
extends
StatefulWidget
{
const
ShaderMaskCachePage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
ShaderMaskCachePage
>
createState
()
=>
_ShaderMaskCachePageState
();
}
class
_ShaderMaskCachePageState
extends
State
<
ShaderMaskCachePage
>
with
TickerProviderStateMixin
{
final
ScrollController
_controller
=
ScrollController
();
@override
void
initState
()
{
super
.
initState
();
_controller
.
addListener
(()
{
if
(
_controller
.
offset
<
10
)
{
_controller
.
animateTo
(
100
,
duration:
const
Duration
(
milliseconds:
1000
),
curve:
Curves
.
ease
);
}
else
if
(
_controller
.
offset
>
90
)
{
_controller
.
animateTo
(
0
,
duration:
const
Duration
(
milliseconds:
1000
),
curve:
Curves
.
ease
);
}
});
Timer
(
const
Duration
(
milliseconds:
500
),
()
{
_controller
.
animateTo
(
100
,
duration:
const
Duration
(
milliseconds:
1000
),
curve:
Curves
.
ease
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
Colors
.
lightBlue
,
body:
ListView
(
controller:
_controller
,
children:
<
Widget
>[
const
SizedBox
(
height:
100
),
buildShaderMask
(
0
),
const
SizedBox
(
height:
10
),
buildShaderMask
(
1
),
const
SizedBox
(
height:
1000
),
],
),
);
}
Widget
buildShaderMask
(
int
index
)
{
return
ShaderMask
(
shaderCallback:
(
Rect
bounds
)
{
return
const
RadialGradient
(
center:
Alignment
.
topLeft
,
radius:
1.0
,
colors:
<
Color
>[
Colors
.
yellow
,
Colors
.
red
],
tileMode:
TileMode
.
mirror
,
).
createShader
(
bounds
);
},
child:
Container
(
clipBehavior:
Clip
.
antiAlias
,
decoration:
const
BoxDecoration
(
boxShadow:
<
BoxShadow
>[
BoxShadow
(
color:
Colors
.
white
,
blurRadius:
5.0
,
),
]),
child:
ListItem
(
index:
index
),
),
);
}
@override
void
dispose
()
{
_controller
.
dispose
();
super
.
dispose
();
}
}
dev/benchmarks/macrobenchmarks/test/shader_mask_cache_perf_e2e.dart
0 → 100644
View file @
712abb08
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:macrobenchmarks/common.dart'
;
import
'util.dart'
;
void
main
(
)
{
macroPerfTestE2E
(
'shader_mask_cache_perf'
,
kShaderMaskCacheRouteName
,
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
}
dev/devicelab/bin/tasks/shader_mask_cache_perf__e2e_summary.dart
0 → 100644
View file @
712abb08
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter_devicelab/framework/devices.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createShaderMaskCachePerfE2ETest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
712abb08
...
@@ -378,6 +378,13 @@ TaskFunction createColorFilterCachePerfE2ETest() {
...
@@ -378,6 +378,13 @@ TaskFunction createColorFilterCachePerfE2ETest() {
).
run
;
).
run
;
}
}
TaskFunction
createShaderMaskCachePerfE2ETest
(
)
{
return
PerfTest
.
e2e
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'test/shader_mask_cache_perf_e2e.dart'
,
).
run
;
}
TaskFunction
createFadingChildAnimationPerfTest
(
)
{
TaskFunction
createFadingChildAnimationPerfTest
(
)
{
return
PerfTest
(
return
PerfTest
(
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment