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
dda253bb
Commit
dda253bb
authored
Aug 20, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder bootstrapping code in rendering/ for slightly cleaner code.
parent
cf03afcd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
object.dart
packages/flutter/lib/rendering/object.dart
+2
-1
sky_binding.dart
packages/flutter/lib/rendering/sky_binding.dart
+2
-3
view.dart
packages/flutter/lib/rendering/view.dart
+8
-3
No files found.
packages/flutter/lib/rendering/object.dart
View file @
dda253bb
...
@@ -394,6 +394,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -394,6 +394,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
void
scheduleInitialLayout
()
{
void
scheduleInitialLayout
()
{
assert
(
attached
);
assert
(
attached
);
assert
(
parent
is
!
RenderObject
);
assert
(
parent
is
!
RenderObject
);
assert
(!
_debugDoingLayout
);
assert
(
_relayoutSubtreeRoot
==
null
);
assert
(
_relayoutSubtreeRoot
==
null
);
_relayoutSubtreeRoot
=
this
;
_relayoutSubtreeRoot
=
this
;
assert
(()
{
assert
(()
{
...
@@ -401,7 +402,6 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -401,7 +402,6 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
return
true
;
return
true
;
});
});
_nodesNeedingLayout
.
add
(
this
);
_nodesNeedingLayout
.
add
(
this
);
scheduler
.
ensureVisualUpdate
();
}
}
static
void
flushLayout
()
{
static
void
flushLayout
()
{
sky
.
tracing
.
begin
(
'RenderObject.flushLayout'
);
sky
.
tracing
.
begin
(
'RenderObject.flushLayout'
);
...
@@ -648,6 +648,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -648,6 +648,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert
(
parent
is
!
RenderObject
);
assert
(
parent
is
!
RenderObject
);
assert
(!
_debugDoingPaint
);
assert
(!
_debugDoingPaint
);
assert
(
hasLayer
);
assert
(
hasLayer
);
assert
(
_layer
==
null
);
_layer
=
rootLayer
;
_layer
=
rootLayer
;
assert
(
_needsPaint
);
assert
(
_needsPaint
);
_nodesNeedingPaint
.
add
(
this
);
_nodesNeedingPaint
.
add
(
this
);
...
...
packages/flutter/lib/rendering/sky_binding.dart
View file @
dda253bb
...
@@ -40,11 +40,10 @@ class SkyBinding {
...
@@ -40,11 +40,10 @@ class SkyBinding {
sky
.
view
.
setMetricsChangedCallback
(
_handleMetricsChanged
);
sky
.
view
.
setMetricsChangedCallback
(
_handleMetricsChanged
);
scheduler
.
init
();
scheduler
.
init
();
if
(
renderViewOverride
==
null
)
{
if
(
renderViewOverride
==
null
)
{
_renderView
=
new
RenderView
(
child:
root
);
_renderView
=
new
RenderView
(
child:
root
,
devicePixelRatio:
sky
.
view
.
devicePixelRatio
);
_renderView
.
attach
();
_renderView
.
attach
();
_renderView
.
rootConstraints
=
_createConstraints
();
_renderView
.
rootConstraints
=
_createConstraints
();
_renderView
.
scheduleInitialLayout
();
_renderView
.
scheduleInitialFrame
();
_renderView
.
initializeLayerTree
();
}
else
{
}
else
{
_renderView
=
renderViewOverride
;
_renderView
=
renderViewOverride
;
}
}
...
...
packages/flutter/lib/rendering/view.dart
View file @
dda253bb
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
import
'dart:sky'
as
sky
;
import
'dart:sky'
as
sky
;
import
'package:sky/base/scheduler.dart'
as
scheduler
;
import
'package:sky/rendering/layer.dart'
;
import
'package:sky/rendering/layer.dart'
;
import
'package:sky/rendering/object.dart'
;
import
'package:sky/rendering/object.dart'
;
import
'package:sky/rendering/box.dart'
;
import
'package:sky/rendering/box.dart'
;
...
@@ -21,17 +22,20 @@ class ViewConstraints {
...
@@ -21,17 +22,20 @@ class ViewConstraints {
class
RenderView
extends
RenderObject
with
RenderObjectWithChildMixin
<
RenderBox
>
{
class
RenderView
extends
RenderObject
with
RenderObjectWithChildMixin
<
RenderBox
>
{
RenderView
({
RenderView
({
RenderBox
child
,
RenderBox
child
,
this
.
devicePixelRatio
,
this
.
timeForRotation
:
const
Duration
(
microseconds:
83333
)
this
.
timeForRotation
:
const
Duration
(
microseconds:
83333
)
})
{
})
{
this
.
child
=
child
;
this
.
child
=
child
;
}
}
final
double
devicePixelRatio
;
Duration
timeForRotation
;
Size
_size
=
Size
.
zero
;
Size
_size
=
Size
.
zero
;
Size
get
size
=>
_size
;
Size
get
size
=>
_size
;
int
_orientation
;
// 0..3
int
_orientation
;
// 0..3
int
get
orientation
=>
_orientation
;
int
get
orientation
=>
_orientation
;
Duration
timeForRotation
;
ViewConstraints
_rootConstraints
;
ViewConstraints
_rootConstraints
;
ViewConstraints
get
rootConstraints
=>
_rootConstraints
;
ViewConstraints
get
rootConstraints
=>
_rootConstraints
;
...
@@ -42,10 +46,11 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
...
@@ -42,10 +46,11 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
markNeedsLayout
();
markNeedsLayout
();
}
}
void
initializeLayerTree
()
{
void
scheduleInitialFrame
()
{
final
double
devicePixelRatio
=
sky
.
view
.
devicePixelRatio
;
Matrix4
logicalToDeviceZoom
=
new
Matrix4
.
diagonal3Values
(
devicePixelRatio
,
devicePixelRatio
,
1.0
);
Matrix4
logicalToDeviceZoom
=
new
Matrix4
.
diagonal3Values
(
devicePixelRatio
,
devicePixelRatio
,
1.0
);
scheduleInitialLayout
();
scheduleInitialPaint
(
new
TransformLayer
(
transform:
logicalToDeviceZoom
));
scheduleInitialPaint
(
new
TransformLayer
(
transform:
logicalToDeviceZoom
));
scheduler
.
ensureVisualUpdate
();
}
}
// We never call layout() on this class, so this should never get
// We never call layout() on this class, so this should never get
...
...
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