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
73dce01e
Commit
73dce01e
authored
Oct 07, 2015
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow updating the rasterizer tracing threshold from Dart
parent
90d47520
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
9 deletions
+31
-9
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+6
-2
object.dart
packages/flutter/lib/src/rendering/object.dart
+3
-2
statistics_box.dart
packages/flutter/lib/src/rendering/statistics_box.dart
+14
-2
statistics_overlay.dart
packages/flutter/lib/src/widgets/statistics_overlay.dart
+8
-3
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
73dce01e
...
...
@@ -93,18 +93,22 @@ class StatisticsLayer extends Layer {
StatisticsLayer
({
Offset
offset:
Offset
.
zero
,
this
.
paintBounds
,
this
.
optionsMask
this
.
optionsMask
,
this
.
rasterizerThreshold
})
:
super
(
offset:
offset
);
/// The rectangle in this layer's coodinate system that bounds the recording
Rect
paintBounds
;
/// A mask specifying the statistics to display
int
optionsMask
;
final
int
optionsMask
;
final
int
rasterizerThreshold
;
void
addToScene
(
sky
.
SceneBuilder
builder
,
Offset
layerOffset
)
{
assert
(
optionsMask
!=
null
);
builder
.
addStatistics
(
optionsMask
,
paintBounds
.
shift
(
layerOffset
));
builder
.
setRasterizerTracingThreshold
(
rasterizerThreshold
);
}
}
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
73dce01e
...
...
@@ -132,11 +132,12 @@ class PaintingContext {
}
}
void
paintStatistics
(
int
optionsMask
,
Offset
offset
,
Size
size
)
{
void
paintStatistics
(
int
optionsMask
,
int
rasterizerThreshold
,
Offset
offset
,
Size
size
)
{
StatisticsLayer
statsLayer
=
new
StatisticsLayer
(
offset:
offset
,
paintBounds:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
size
.
width
,
size
.
height
),
optionsMask
:
optionsMask
optionsMask
:
optionsMask
,
rasterizerThreshold
:
rasterizerThreshold
);
_containerLayer
.
append
(
statsLayer
);
}
...
...
packages/flutter/lib/src/rendering/statistics_box.dart
View file @
73dce01e
...
...
@@ -7,7 +7,9 @@ import 'package:sky/src/rendering/object.dart';
class
StatisticsBox
extends
RenderBox
{
StatisticsBox
({
int
optionsMask:
0
})
:
_optionsMask
=
optionsMask
;
StatisticsBox
({
int
optionsMask:
0
,
int
rasterizerThreshold:
0
})
:
_optionsMask
=
optionsMask
,
_rasterizerThreshold
=
rasterizerThreshold
;
int
_optionsMask
;
int
get
optionsMask
=>
_optionsMask
;
...
...
@@ -19,6 +21,16 @@ class StatisticsBox extends RenderBox {
markNeedsPaint
();
}
int
_rasterizerThreshold
;
int
get
rasterizerThreshold
=>
_rasterizerThreshold
;
void
set
rasterizerThreshold
(
int
threshold
)
{
if
(
threshold
==
_rasterizerThreshold
)
{
return
;
}
_rasterizerThreshold
=
threshold
;
markNeedsPaint
();
}
bool
get
sizedByParent
=>
true
;
double
getMinIntrinsicWidth
(
BoxConstraints
constraints
)
{
...
...
@@ -42,6 +54,6 @@ class StatisticsBox extends RenderBox {
}
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
context
.
paintStatistics
(
optionsMask
,
offset
,
size
);
context
.
paintStatistics
(
optionsMask
,
rasterizerThreshold
,
offset
,
size
);
}
}
packages/flutter/lib/src/widgets/statistics_overlay.dart
View file @
73dce01e
...
...
@@ -40,10 +40,10 @@ class StatisticsOverlay extends LeafRenderObjectWidget {
/// Create a statistics overlay that only displays specific statistics. The
/// mask is created by shifting 1 by the index of the specific StatisticOption
/// to enable.
StatisticsOverlay
({
this
.
optionsMask
,
Key
key
})
:
super
(
key:
key
);
StatisticsOverlay
({
this
.
optionsMask
,
this
.
rasterizerThreshold
:
0
,
Key
key
})
:
super
(
key:
key
);
/// Create a statistics overaly that displays all available statistics
StatisticsOverlay
.
allEnabled
({
Key
key
})
:
super
(
key:
key
),
optionsMask
=
(
StatisticsOverlay
.
allEnabled
({
Key
key
,
this
.
rasterizerThreshold
:
0
})
:
super
(
key:
key
),
optionsMask
=
(
1
<<
StatisticsOption
.
displayRasterizerStatistics
.
index
|
1
<<
StatisticsOption
.
visualizeRasterizerStatistics
.
index
|
1
<<
StatisticsOption
.
displayEngineStatistics
.
index
|
...
...
@@ -51,10 +51,15 @@ class StatisticsOverlay extends LeafRenderObjectWidget {
);
final
int
optionsMask
;
final
int
rasterizerThreshold
;
StatisticsBox
createRenderObject
()
=>
new
StatisticsBox
(
optionsMask:
optionsMask
);
StatisticsBox
createRenderObject
()
=>
new
StatisticsBox
(
optionsMask:
optionsMask
,
rasterizerThreshold:
rasterizerThreshold
);
void
updateRenderObject
(
StatisticsBox
renderObject
,
RenderObjectWidget
oldWidget
)
{
renderObject
.
optionsMask
=
optionsMask
;
renderObject
.
rasterizerThreshold
=
rasterizerThreshold
;
}
}
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