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
88c43c3f
Commit
88c43c3f
authored
Jan 11, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename StatisticsOverlay to PerformanceOverlay.
parent
e20ef502
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
53 deletions
+59
-53
main.dart
examples/stocks/lib/main.dart
+2
-2
stock_settings.dart
examples/stocks/lib/stock_settings.dart
+5
-5
stock_types.dart
examples/stocks/lib/stock_types.dart
+5
-5
rendering.dart
packages/flutter/lib/rendering.dart
+1
-1
material_app.dart
packages/flutter/lib/src/material/material_app.dart
+5
-5
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+4
-4
object.dart
packages/flutter/lib/src/rendering/object.dart
+5
-5
performance_overlay.dart
packages/flutter/lib/src/rendering/performance_overlay.dart
+18
-12
performance_overlay.dart
packages/flutter/lib/src/widgets/performance_overlay.dart
+12
-12
widgets.dart
packages/flutter/lib/widgets.dart
+2
-2
No files found.
examples/stocks/lib/main.dart
View file @
88c43c3f
...
...
@@ -42,7 +42,7 @@ class StocksAppState extends State<StocksApp> {
backupMode:
BackupMode
.
enabled
,
debugShowGrid:
false
,
debugShowSizes:
false
,
show
RenderingStatistics
:
false
show
PerformanceOverlay
:
false
);
void
initState
()
{
...
...
@@ -108,7 +108,7 @@ class StocksAppState extends State<StocksApp> {
title:
'Stocks'
,
theme:
theme
,
debugShowMaterialGrid:
_configuration
.
debugShowGrid
,
show
RenderingPerformanceOverlay:
_configuration
.
showRenderingStatistics
,
show
PerformanceOverlay:
_configuration
.
showPerformanceOverlay
,
routes:
<
String
,
RouteBuilder
>{
'/'
:
(
RouteArguments
args
)
=>
new
StockHome
(
_stocks
,
_symbols
,
_configuration
,
configurationUpdater
),
'/settings'
:
(
RouteArguments
args
)
=>
new
StockSettings
(
_configuration
,
configurationUpdater
)
...
...
examples/stocks/lib/stock_settings.dart
View file @
88c43c3f
...
...
@@ -31,8 +31,8 @@ class StockSettingsState extends State<StockSettings> {
sendUpdates
(
config
.
configuration
.
copyWith
(
debugShowSizes:
value
));
}
void
_handleShow
RenderingStatistics
Changed
(
bool
value
)
{
sendUpdates
(
config
.
configuration
.
copyWith
(
show
RenderingStatistics
:
value
));
void
_handleShow
PerformanceOverlay
Changed
(
bool
value
)
{
sendUpdates
(
config
.
configuration
.
copyWith
(
show
PerformanceOverlay
:
value
));
}
void
_confirmOptimismChange
()
{
...
...
@@ -103,12 +103,12 @@ class StockSettingsState extends State<StockSettings> {
),
new
DrawerItem
(
icon:
'action/picture_in_picture'
,
onPressed:
()
{
_handleShow
RenderingStatisticsChanged
(!
config
.
configuration
.
showRenderingStatistics
);
},
onPressed:
()
{
_handleShow
PerformanceOverlayChanged
(!
config
.
configuration
.
showPerformanceOverlay
);
},
child:
new
Row
(<
Widget
>[
new
Flexible
(
child:
new
Text
(
'Show rendering performance overlay'
)),
new
Switch
(
value:
config
.
configuration
.
show
RenderingStatistics
,
onChanged:
_handleShow
RenderingStatistics
Changed
value:
config
.
configuration
.
show
PerformanceOverlay
,
onChanged:
_handleShow
PerformanceOverlay
Changed
),
])
),
...
...
examples/stocks/lib/stock_types.dart
View file @
88c43c3f
...
...
@@ -13,34 +13,34 @@ class StockConfiguration {
this
.
backupMode
,
this
.
debugShowGrid
,
this
.
debugShowSizes
,
this
.
show
RenderingStatistics
this
.
show
PerformanceOverlay
})
{
assert
(
stockMode
!=
null
);
assert
(
backupMode
!=
null
);
assert
(
debugShowGrid
!=
null
);
assert
(
debugShowSizes
!=
null
);
assert
(
show
RenderingStatistics
!=
null
);
assert
(
show
PerformanceOverlay
!=
null
);
}
final
StockMode
stockMode
;
final
BackupMode
backupMode
;
final
bool
debugShowGrid
;
final
bool
debugShowSizes
;
final
bool
show
RenderingStatistics
;
final
bool
show
PerformanceOverlay
;
StockConfiguration
copyWith
({
StockMode
stockMode
,
BackupMode
backupMode
,
bool
debugShowGrid
,
bool
debugShowSizes
,
bool
show
RenderingStatistics
bool
show
PerformanceOverlay
})
{
return
new
StockConfiguration
(
stockMode:
stockMode
??
this
.
stockMode
,
backupMode:
backupMode
??
this
.
backupMode
,
debugShowGrid:
debugShowGrid
??
this
.
debugShowGrid
,
debugShowSizes:
debugShowSizes
??
this
.
debugShowSizes
,
show
RenderingStatistics:
showRenderingStatistics
??
this
.
showRenderingStatistics
show
PerformanceOverlay:
showPerformanceOverlay
??
this
.
showPerformanceOverlay
);
}
}
\ No newline at end of file
packages/flutter/lib/rendering.dart
View file @
88c43c3f
...
...
@@ -23,10 +23,10 @@ export 'src/rendering/node.dart';
export
'src/rendering/object.dart'
;
export
'src/rendering/overflow.dart'
;
export
'src/rendering/paragraph.dart'
;
export
'src/rendering/performance_overlay.dart'
;
export
'src/rendering/proxy_box.dart'
;
export
'src/rendering/shifted_box.dart'
;
export
'src/rendering/stack.dart'
;
export
'src/rendering/statistics_box.dart'
;
export
'src/rendering/view.dart'
;
export
'src/rendering/viewport.dart'
;
...
...
packages/flutter/lib/src/material/material_app.dart
View file @
88c43c3f
...
...
@@ -49,12 +49,12 @@ class MaterialApp extends StatefulComponent {
this
.
onGenerateRoute
,
this
.
onLocaleChanged
,
this
.
debugShowMaterialGrid
:
false
,
this
.
show
Rendering
PerformanceOverlay
:
false
this
.
showPerformanceOverlay
:
false
})
:
super
(
key:
key
)
{
assert
(
routes
!=
null
);
assert
(
routes
.
containsKey
(
Navigator
.
defaultRouteName
)
||
onGenerateRoute
!=
null
);
assert
(
debugShowMaterialGrid
!=
null
);
assert
(
show
Rendering
PerformanceOverlay
!=
null
);
assert
(
showPerformanceOverlay
!=
null
);
}
final
String
title
;
...
...
@@ -63,7 +63,7 @@ class MaterialApp extends StatefulComponent {
final
RouteFactory
onGenerateRoute
;
final
LocaleChangedCallback
onLocaleChanged
;
final
bool
debugShowMaterialGrid
;
final
bool
show
Rendering
PerformanceOverlay
;
final
bool
showPerformanceOverlay
;
_MaterialAppState
createState
()
=>
new
_MaterialAppState
();
}
...
...
@@ -174,10 +174,10 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
}
return
true
;
});
if
(
config
.
show
Rendering
PerformanceOverlay
)
{
if
(
config
.
showPerformanceOverlay
)
{
result
=
new
Stack
([
result
,
new
Positioned
(
bottom:
0.0
,
left:
0.0
,
right:
0.0
,
child:
new
Statistics
Overlay
.
allEnabled
()),
new
Positioned
(
bottom:
0.0
,
left:
0.0
,
right:
0.0
,
child:
new
Performance
Overlay
.
allEnabled
()),
]);
}
return
result
;
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
88c43c3f
...
...
@@ -128,9 +128,9 @@ class PictureLayer extends Layer {
}
/// A layer that indicates to the compositor that it should display
/// certain
statistics within it
class
Statistics
Layer
extends
Layer
{
Statistics
Layer
({
/// certain
performance statistics within it.
class
PerformanceOverlay
Layer
extends
Layer
{
PerformanceOverlay
Layer
({
Offset
offset:
Offset
.
zero
,
this
.
paintBounds
,
this
.
optionsMask
,
...
...
@@ -147,7 +147,7 @@ class StatisticsLayer extends Layer {
void
addToScene
(
ui
.
SceneBuilder
builder
,
Offset
layerOffset
)
{
assert
(
optionsMask
!=
null
);
builder
.
add
Statistics
(
optionsMask
,
paintBounds
.
shift
(
offset
+
layerOffset
));
builder
.
add
PerformanceOverlay
(
optionsMask
,
paintBounds
.
shift
(
offset
+
layerOffset
));
builder
.
setRasterizerTracingThreshold
(
rasterizerThreshold
);
}
}
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
88c43c3f
...
...
@@ -183,18 +183,18 @@ class PaintingContext {
static
final
Paint
_disableAntialias
=
new
Paint
()..
isAntiAlias
=
false
;
/// Push a
statistics
overlay.
/// Push a
performance
overlay.
///
///
Statistics
overlays are always composited because they're drawn by the
///
Performance
overlays are always composited because they're drawn by the
/// compositor.
void
push
Statistics
(
Offset
offset
,
int
optionsMask
,
int
rasterizerThreshold
,
Size
size
)
{
void
push
PerformanceOverlay
(
Offset
offset
,
int
optionsMask
,
int
rasterizerThreshold
,
Size
size
)
{
_stopRecordingIfNeeded
();
StatisticsLayer
statisticsLayer
=
new
Statistics
Layer
(
PerformanceOverlayLayer
performanceOverlayLayer
=
new
PerformanceOverlay
Layer
(
paintBounds:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
size
.
width
,
size
.
height
),
optionsMask:
optionsMask
,
rasterizerThreshold:
rasterizerThreshold
);
_appendLayer
(
statistics
Layer
,
offset
);
_appendLayer
(
performanceOverlay
Layer
,
offset
);
}
/// Push a rectangular clip rect.
...
...
packages/flutter/lib/src/rendering/
statistics_box
.dart
→
packages/flutter/lib/src/rendering/
performance_overlay
.dart
View file @
88c43c3f
...
...
@@ -5,9 +5,12 @@
import
'box.dart'
;
import
'object.dart'
;
/// The options that control whether the statistics overlay displays certain
/// aspects of the compositor
enum
StatisticsOption
{
/// The options that control whether the performance overlay displays certain
/// aspects of the compositor.
enum
PerformanceOverlayOption
{
// these must be in the order needed for their index values to match the
// constants in //engine/src/sky/compositor/performance_overlay_layer.h
/// Display the frame time and FPS of the last frame rendered. This field is
/// updated every frame.
///
...
...
@@ -16,11 +19,13 @@ enum StatisticsOption {
/// and tries to flush them onto the screen. When the total time taken by this
/// step exceeds the frame slice, a frame is lost.
displayRasterizerStatistics
,
/// Display the rasterizer frame times as they change over a set period of
/// time in the form of a graph. The y axis of the graph denotes the total
/// time spent by the rasterizer as a fraction of the total frame slice. When
/// the bar turns red, a frame is lost.
visualizeRasterizerStatistics
,
/// Display the frame time and FPS at which the interface can construct a
/// layer tree for the rasterizer (whose behavior is described above) to
/// consume.
...
...
@@ -28,6 +33,7 @@ enum StatisticsOption {
/// This involves all layout, animations, etc. When the total time taken by
/// this step exceeds the frame slice, a frame is lost.
displayEngineStatistics
,
/// Display the engine frame times as they change over a set period of time
/// in the form of a graph. The y axis of the graph denotes the total time
/// spent by the eninge as a fraction of the total frame slice. When the bar
...
...
@@ -35,13 +41,13 @@ enum StatisticsOption {
visualizeEngineStatistics
,
}
class
Render
StatisticsBox
extends
RenderBox
{
Render
StatisticsBox
({
int
optionsMask:
0
,
int
rasterizerThreshold:
0
})
class
Render
PerformanceOverlay
extends
RenderBox
{
Render
PerformanceOverlay
({
int
optionsMask:
0
,
int
rasterizerThreshold:
0
})
:
_optionsMask
=
optionsMask
,
_rasterizerThreshold
=
rasterizerThreshold
;
/// The mask is created by shifting 1 by the index of the specific
///
Statistic
Option to enable.
///
PerformanceOverlay
Option to enable.
int
get
optionsMask
=>
_optionsMask
;
int
_optionsMask
;
void
set
optionsMask
(
int
mask
)
{
...
...
@@ -71,13 +77,13 @@ class RenderStatisticsBox extends RenderBox {
}
double
get
intrinsicHeight
{
const
double
kGraphHeight
=
80.0
;
// must match value in
statistics
_layer.cc
const
double
kGraphHeight
=
80.0
;
// must match value in
performance_overlay
_layer.cc
double
result
=
0.0
;
if
((
optionsMask
|
(
1
<<
Statistics
Option
.
displayRasterizerStatistics
.
index
)
>
0
)
||
(
optionsMask
|
(
1
<<
Statistics
Option
.
visualizeRasterizerStatistics
.
index
)
>
0
))
if
((
optionsMask
|
(
1
<<
PerformanceOverlay
Option
.
displayRasterizerStatistics
.
index
)
>
0
)
||
(
optionsMask
|
(
1
<<
PerformanceOverlay
Option
.
visualizeRasterizerStatistics
.
index
)
>
0
))
result
+=
kGraphHeight
;
if
((
optionsMask
|
(
1
<<
Statistics
Option
.
displayEngineStatistics
.
index
)
>
0
)
||
(
optionsMask
|
(
1
<<
Statistics
Option
.
visualizeEngineStatistics
.
index
)
>
0
))
if
((
optionsMask
|
(
1
<<
PerformanceOverlay
Option
.
displayEngineStatistics
.
index
)
>
0
)
||
(
optionsMask
|
(
1
<<
PerformanceOverlay
Option
.
visualizeEngineStatistics
.
index
)
>
0
))
result
+=
kGraphHeight
;
return
result
;
}
...
...
@@ -95,6 +101,6 @@ class RenderStatisticsBox extends RenderBox {
}
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
context
.
push
Statistics
(
offset
,
optionsMask
,
rasterizerThreshold
,
size
);
context
.
push
PerformanceOverlay
(
offset
,
optionsMask
,
rasterizerThreshold
,
size
);
}
}
packages/flutter/lib/src/widgets/
statistics
_overlay.dart
→
packages/flutter/lib/src/widgets/
performance
_overlay.dart
View file @
88c43c3f
...
...
@@ -7,22 +7,22 @@ import 'package:flutter/rendering.dart';
import
'framework.dart'
;
/// Displays performance statistics.
class
Statistics
Overlay
extends
LeafRenderObjectWidget
{
class
Performance
Overlay
extends
LeafRenderObjectWidget
{
// TODO(abarth): We should have a page on the web site with a screenshot and
// an explanation of all the various readouts.
/// Create a
statistics
overlay that only displays specific statistics. The
/// Create a
performance
overlay that only displays specific statistics. The
/// mask is created by shifting 1 by the index of the specific
/// [StatisticOption] to enable.
Statistics
Overlay
({
this
.
optionsMask
,
this
.
rasterizerThreshold
:
0
,
Key
key
})
:
super
(
key:
key
);
Performance
Overlay
({
this
.
optionsMask
,
this
.
rasterizerThreshold
:
0
,
Key
key
})
:
super
(
key:
key
);
/// Create a
statistics overal
y that displays all available statistics
Statistics
Overlay
.
allEnabled
({
Key
key
,
this
.
rasterizerThreshold
:
0
})
/// Create a
performance overla
y that displays all available statistics
Performance
Overlay
.
allEnabled
({
Key
key
,
this
.
rasterizerThreshold
:
0
})
:
optionsMask
=
(
1
<<
Statistics
Option
.
displayRasterizerStatistics
.
index
|
1
<<
Statistics
Option
.
visualizeRasterizerStatistics
.
index
|
1
<<
Statistics
Option
.
displayEngineStatistics
.
index
|
1
<<
Statistics
Option
.
visualizeEngineStatistics
.
index
1
<<
PerformanceOverlay
Option
.
displayRasterizerStatistics
.
index
|
1
<<
PerformanceOverlay
Option
.
visualizeRasterizerStatistics
.
index
|
1
<<
PerformanceOverlay
Option
.
displayEngineStatistics
.
index
|
1
<<
PerformanceOverlay
Option
.
visualizeEngineStatistics
.
index
),
super
(
key:
key
);
...
...
@@ -51,17 +51,17 @@ class StatisticsOverlay extends LeafRenderObjectWidget {
/// the instrumentation available in observatory.
///
/// To decide what threshold interval to use, count the number of horizontal
/// lines displayed in the
statistics
overlay for the rasterizer (not the
/// lines displayed in the
performance
overlay for the rasterizer (not the
/// engine). That should give an idea of how often frames are skipped (and by
/// how many frame intervals).
final
int
rasterizerThreshold
;
Render
StatisticsBox
createRenderObject
()
=>
new
RenderStatisticsBox
(
Render
PerformanceOverlay
createRenderObject
()
=>
new
RenderPerformanceOverlay
(
optionsMask:
optionsMask
,
rasterizerThreshold:
rasterizerThreshold
);
void
updateRenderObject
(
Render
StatisticsBox
renderObject
,
RenderObjectWidget
oldWidget
)
{
void
updateRenderObject
(
Render
PerformanceOverlay
renderObject
,
RenderObjectWidget
oldWidget
)
{
renderObject
.
optionsMask
=
optionsMask
;
renderObject
.
rasterizerThreshold
=
rasterizerThreshold
;
}
...
...
packages/flutter/lib/widgets.dart
View file @
88c43c3f
...
...
@@ -27,14 +27,14 @@ export 'src/widgets/navigator.dart';
export
'src/widgets/notification_listener.dart'
;
export
'src/widgets/overlay.dart'
;
export
'src/widgets/page_storage.dart'
;
export
'src/widgets/pages.dart'
;
export
'src/widgets/pageable_list.dart'
;
export
'src/widgets/pages.dart'
;
export
'src/widgets/performance_overlay.dart'
;
export
'src/widgets/placeholder.dart'
;
export
'src/widgets/routes.dart'
;
export
'src/widgets/scrollable.dart'
;
export
'src/widgets/scrollable_grid.dart'
;
export
'src/widgets/scrollable_list.dart'
;
export
'src/widgets/statistics_overlay.dart'
;
export
'src/widgets/status_transitions.dart'
;
export
'src/widgets/title.dart'
;
export
'src/widgets/transitions.dart'
;
...
...
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