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
ec5b1c1a
Commit
ec5b1c1a
authored
Nov 18, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #476 from abarth/forced_layer
Reduce record time in Stocks drawer animation by 55%
parents
57bbc496
298f4a6e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
22 deletions
+21
-22
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+0
-21
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+13
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+5
-0
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+3
-1
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
ec5b1c1a
...
...
@@ -59,10 +59,6 @@ abstract class Layer {
_nextSibling
=
null
;
_previousSibling
=
null
;
_parent
=
null
;
_dispose
();
}
void
_dispose
()
{
}
/// Override this function to upload this layer to the engine
...
...
@@ -88,11 +84,6 @@ class PictureLayer extends Layer {
/// The picture's coodinate system matches this layer's coodinate system
ui
.
Picture
picture
;
void
_dispose
()
{
super
.
_dispose
();
picture
.
dispose
();
}
void
addToScene
(
ui
.
SceneBuilder
builder
,
Offset
layerOffset
)
{
builder
.
addPicture
(
offset
+
layerOffset
,
picture
,
paintBounds
);
}
...
...
@@ -190,7 +181,6 @@ class ContainerLayer extends Layer {
child
.
_previousSibling
=
null
;
child
.
_nextSibling
=
null
;
child
.
_parent
=
null
;
child
.
_dispose
();
}
/// Removes all of this layer's children from its child list
...
...
@@ -201,23 +191,12 @@ class ContainerLayer extends Layer {
child
.
_previousSibling
=
null
;
child
.
_nextSibling
=
null
;
child
.
_parent
=
null
;
child
.
_dispose
();
child
=
next
;
}
_firstChild
=
null
;
_lastChild
=
null
;
}
void
_dispose
()
{
super
.
_dispose
();
Layer
child
=
_firstChild
;
while
(
child
!=
null
)
{
Layer
next
=
child
.
nextSibling
;
child
.
_dispose
();
child
=
next
;
}
}
void
addToScene
(
ui
.
SceneBuilder
builder
,
Offset
layerOffset
)
{
addChildrenToScene
(
builder
,
offset
+
layerOffset
);
}
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
ec5b1c1a
...
...
@@ -1052,6 +1052,19 @@ class RenderPointerListener extends RenderProxyBox {
}
}
/// Force this subtree to have a layer
///
/// This render object creates a separate display list for its child, which
/// can improve performance if the subtree repaints at different times than
/// the surrounding parts of the tree. Specifically, when the child does not
/// repaint but its parent does, we can re-use the display list we recorded
/// previously. Similarly, when the child repaints but the surround tree does
/// not, we can re-record its display list without re-recording the display list
/// for the surround tree.
class
RenderForcedLayer
extends
RenderProxyBox
{
bool
get
hasLayer
=>
true
;
}
/// Is invisible during hit testing.
///
/// When [ignoring] is true, this render object (and its subtree) is invisible
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
ec5b1c1a
...
...
@@ -1321,6 +1321,11 @@ class Listener extends OneChildRenderObjectWidget {
}
}
class
ForcedLayer
extends
OneChildRenderObjectWidget
{
ForcedLayer
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
RenderForcedLayer
createRenderObject
()
=>
new
RenderForcedLayer
();
}
class
IgnorePointer
extends
OneChildRenderObjectWidget
{
IgnorePointer
({
Key
key
,
Widget
child
,
this
.
ignoring
:
true
})
:
super
(
key:
key
,
child:
child
);
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
ec5b1c1a
...
...
@@ -39,7 +39,9 @@ class OverlayRoute extends Route {
void
didPush
(
OverlayState
overlay
,
OverlayEntry
insertionPoint
)
{
for
(
WidgetBuilder
builder
in
builders
)
{
_overlayEntries
.
add
(
new
OverlayEntry
(
builder:
builder
));
_overlayEntries
.
add
(
new
OverlayEntry
(
builder:
(
BuildContext
context
)
{
return
new
ForcedLayer
(
child:
builder
(
context
));
}));
overlay
?.
insert
(
_overlayEntries
.
last
,
above:
insertionPoint
);
insertionPoint
=
_overlayEntries
.
last
;
}
...
...
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