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
d2ca2f26
Commit
d2ca2f26
authored
Aug 20, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #712 from abarth/rm_paint_frame
Remove RenderView.paintFrame
parents
58296881
077e75e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
27 deletions
+26
-27
layer.dart
packages/flutter/lib/rendering/layer.dart
+13
-0
object.dart
packages/flutter/lib/rendering/object.dart
+6
-14
sky_binding.dart
packages/flutter/lib/rendering/sky_binding.dart
+1
-1
view.dart
packages/flutter/lib/rendering/view.dart
+6
-12
No files found.
packages/flutter/lib/rendering/layer.dart
View file @
d2ca2f26
...
@@ -169,6 +169,19 @@ class ContainerLayer extends Layer {
...
@@ -169,6 +169,19 @@ class ContainerLayer extends Layer {
child
.
_parent
=
null
;
child
.
_parent
=
null
;
}
}
void
removeAllChildren
()
{
Layer
child
=
_firstChild
;
while
(
child
!=
null
)
{
Layer
next
=
child
.
nextSibling
;
child
.
_previousSibling
=
null
;
child
.
_nextSibling
=
null
;
child
.
_parent
=
null
;
child
=
next
;
}
_firstChild
=
null
;
_lastChild
=
null
;
}
void
paint
(
sky
.
Canvas
canvas
)
{
void
paint
(
sky
.
Canvas
canvas
)
{
canvas
.
translate
(
offset
.
dx
,
offset
.
dy
);
canvas
.
translate
(
offset
.
dx
,
offset
.
dy
);
paintChildren
(
canvas
);
paintChildren
(
canvas
);
...
...
packages/flutter/lib/rendering/object.dart
View file @
d2ca2f26
...
@@ -51,13 +51,6 @@ class PaintingContext {
...
@@ -51,13 +51,6 @@ class PaintingContext {
_startRecording
(
paintBounds
);
_startRecording
(
paintBounds
);
}
}
factory
PaintingContext
.
replacingLayer
(
ContainerLayer
oldLayer
,
Rect
paintBounds
)
{
PaintingContext
newContext
=
new
PaintingContext
.
withOffset
(
oldLayer
.
offset
,
paintBounds
);
if
(
oldLayer
.
parent
!=
null
)
oldLayer
.
replaceWith
(
newContext
.
_containerLayer
);
return
newContext
;
}
PaintingContext
.
forTesting
(
this
.
_canvas
);
PaintingContext
.
forTesting
(
this
.
_canvas
);
ContainerLayer
_containerLayer
;
ContainerLayer
_containerLayer
;
...
@@ -650,21 +643,20 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -650,21 +643,20 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
sky
.
tracing
.
end
(
'RenderObject.flushPaint'
);
sky
.
tracing
.
end
(
'RenderObject.flushPaint'
);
}
}
}
}
void
initialPaint
(
ContainerLayer
rootLayer
,
Size
size
)
{
void
scheduleInitialPaint
(
ContainerLayer
rootLayer
)
{
assert
(
attached
);
assert
(
attached
);
assert
(
parent
is
!
RenderObject
);
assert
(
parent
is
!
RenderObject
);
assert
(!
_debugDoingPaint
);
assert
(!
_debugDoingPaint
);
assert
(
hasLayer
);
assert
(
hasLayer
);
PaintingContext
newContext
=
new
PaintingContext
.
withLayer
(
rootLayer
,
Point
.
origin
&
size
);
_layer
=
rootLayer
;
_paintLayer
(
newContext
);
assert
(
_needsPaint
);
_nodesNeedingPaint
.
add
(
this
);
}
}
void
_repaint
()
{
void
_repaint
()
{
assert
(
hasLayer
);
assert
(
hasLayer
);
assert
(
_layer
!=
null
);
assert
(
_layer
!=
null
);
PaintingContext
newContext
=
new
PaintingContext
.
replacingLayer
(
_layer
,
paintBounds
);
_layer
.
removeAllChildren
();
_paintLayer
(
newContext
);
PaintingContext
context
=
new
PaintingContext
.
withLayer
(
_layer
,
paintBounds
);
}
void
_paintLayer
(
PaintingContext
context
)
{
_layer
=
context
.
_containerLayer
;
_layer
=
context
.
_containerLayer
;
try
{
try
{
_paintWithContext
(
context
,
Offset
.
zero
);
_paintWithContext
(
context
,
Offset
.
zero
);
...
...
packages/flutter/lib/rendering/sky_binding.dart
View file @
d2ca2f26
...
@@ -44,6 +44,7 @@ class SkyBinding {
...
@@ -44,6 +44,7 @@ class SkyBinding {
_renderView
.
attach
();
_renderView
.
attach
();
_renderView
.
rootConstraints
=
_createConstraints
();
_renderView
.
rootConstraints
=
_createConstraints
();
_renderView
.
scheduleInitialLayout
();
_renderView
.
scheduleInitialLayout
();
_renderView
.
initializeLayerTree
();
}
else
{
}
else
{
_renderView
=
renderViewOverride
;
_renderView
=
renderViewOverride
;
}
}
...
@@ -74,7 +75,6 @@ class SkyBinding {
...
@@ -74,7 +75,6 @@ class SkyBinding {
RenderObject
.
flushLayout
();
RenderObject
.
flushLayout
();
_renderView
.
updateCompositingBits
();
_renderView
.
updateCompositingBits
();
RenderObject
.
flushPaint
();
RenderObject
.
flushPaint
();
_renderView
.
paintFrame
();
_renderView
.
compositeFrame
();
_renderView
.
compositeFrame
();
}
}
...
...
packages/flutter/lib/rendering/view.dart
View file @
d2ca2f26
...
@@ -42,6 +42,12 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
...
@@ -42,6 +42,12 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
markNeedsLayout
();
markNeedsLayout
();
}
}
void
initializeLayerTree
()
{
final
double
devicePixelRatio
=
sky
.
view
.
devicePixelRatio
;
Matrix4
logicalToDeviceZoom
=
new
Matrix4
.
diagonal3Values
(
devicePixelRatio
,
devicePixelRatio
,
1.0
);
scheduleInitialPaint
(
new
TransformLayer
(
transform:
logicalToDeviceZoom
));
}
// We never call layout() on this class, so this should never get
// We never call layout() on this class, so this should never get
// checked. (This class is laid out using scheduleInitialLayout().)
// checked. (This class is laid out using scheduleInitialLayout().)
bool
debugDoesMeetConstraints
()
{
assert
(
false
);
return
false
;
}
bool
debugDoesMeetConstraints
()
{
assert
(
false
);
return
false
;
}
...
@@ -84,18 +90,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
...
@@ -84,18 +90,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
context
.
paintChild
(
child
,
offset
.
toPoint
());
context
.
paintChild
(
child
,
offset
.
toPoint
());
}
}
void
paintFrame
()
{
sky
.
tracing
.
begin
(
'RenderView.paintFrame'
);
try
{
final
double
devicePixelRatio
=
sky
.
view
.
devicePixelRatio
;
Matrix4
logicalToDeviceZoom
=
new
Matrix4
.
diagonal3Values
(
devicePixelRatio
,
devicePixelRatio
,
1.0
);
ContainerLayer
rootLayer
=
new
TransformLayer
(
transform:
logicalToDeviceZoom
);
initialPaint
(
rootLayer
,
size
);
}
finally
{
sky
.
tracing
.
end
(
'RenderView.paintFrame'
);
}
}
void
compositeFrame
()
{
void
compositeFrame
()
{
sky
.
tracing
.
begin
(
'RenderView.compositeFrame'
);
sky
.
tracing
.
begin
(
'RenderView.compositeFrame'
);
try
{
try
{
...
...
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