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
4e329a67
Commit
4e329a67
authored
Nov 13, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #350 from abarth/dispose_host_objects
Explicitly dispose heavy C++ objects
parents
b628ff40
679a423b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+21
-0
view.dart
packages/flutter/lib/src/rendering/view.dart
+3
-1
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
4e329a67
...
...
@@ -59,6 +59,10 @@ abstract class Layer {
_nextSibling
=
null
;
_previousSibling
=
null
;
_parent
=
null
;
_dispose
();
}
void
_dispose
()
{
}
/// Override this function to upload this layer to the engine
...
...
@@ -84,6 +88,11 @@ 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
);
}
...
...
@@ -181,6 +190,7 @@ 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
...
...
@@ -191,12 +201,23 @@ 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/view.dart
View file @
4e329a67
...
...
@@ -122,7 +122,9 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
Rect
bounds
=
Point
.
origin
&
(
size
*
ui
.
window
.
devicePixelRatio
);
ui
.
SceneBuilder
builder
=
new
ui
.
SceneBuilder
(
bounds
);
layer
.
addToScene
(
builder
,
Offset
.
zero
);
ui
.
window
.
render
(
builder
.
build
());
ui
.
Scene
scene
=
builder
.
build
();
ui
.
window
.
render
(
scene
);
scene
.
dispose
();
}
finally
{
ui
.
tracing
.
end
(
'RenderView.compositeFrame'
);
}
...
...
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