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
6047c6da
Commit
6047c6da
authored
Dec 14, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be clearer about whether renderView can be null.
parent
7dd28659
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+14
-9
No files found.
packages/flutter/lib/src/rendering/binding.dart
View file @
6047c6da
...
...
@@ -24,6 +24,7 @@ abstract class Renderer extends Scheduler
_instance
=
this
;
ui
.
window
.
onMetricsChanged
=
handleMetricsChanged
;
initRenderView
();
assert
(
renderView
!=
null
);
assert
(()
{
initServiceExtensions
();
return
true
;
...
...
@@ -39,24 +40,25 @@ abstract class Renderer extends Scheduler
renderView
=
new
RenderView
();
renderView
.
scheduleInitialFrame
();
}
handleMetricsChanged
();
// configures
_
renderView's metrics
handleMetricsChanged
();
// configures renderView's metrics
}
/// The render tree that's attached to the output surface.
RenderView
get
renderView
=>
_renderView
;
RenderView
_renderView
;
void
set
renderView
(
RenderView
value
)
{
assert
(
value
!=
null
);
if
(
_renderView
==
value
)
return
;
if
(
_renderView
!=
null
)
_renderView
.
detach
();
_renderView
=
value
;
if
(
_renderView
!=
null
)
_renderView
.
attach
();
_renderView
.
attach
();
}
void
handleMetricsChanged
()
{
_renderView
.
rootConstraints
=
new
ViewConstraints
(
size:
ui
.
window
.
size
);
assert
(
renderView
!=
null
);
renderView
.
rootConstraints
=
new
ViewConstraints
(
size:
ui
.
window
.
size
);
}
void
_handlePersistentFrameCallback
(
Duration
timeStamp
)
{
...
...
@@ -65,32 +67,35 @@ abstract class Renderer extends Scheduler
/// Pump the rendering pipeline to generate a frame.
void
beginFrame
()
{
assert
(
renderView
!=
null
);
RenderObject
.
flushLayout
();
_
renderView
.
updateCompositingBits
();
renderView
.
updateCompositingBits
();
RenderObject
.
flushPaint
();
_
renderView
.
compositeFrame
();
renderView
.
compositeFrame
();
}
void
hitTest
(
HitTestResult
result
,
Point
position
)
{
_renderView
.
hitTest
(
result
,
position:
position
);
assert
(
renderView
!=
null
);
renderView
.
hitTest
(
result
,
position:
position
);
super
.
hitTest
(
result
,
position
);
}
}
/// Prints a textual representation of the entire render tree.
void
debugDumpRenderTree
(
)
{
debugPrint
(
Renderer
.
instance
.
renderView
.
toStringDeep
());
debugPrint
(
Renderer
.
instance
?.
renderView
?
.
toStringDeep
());
}
/// Prints a textual representation of the entire layer tree.
void
debugDumpLayerTree
(
)
{
debugPrint
(
Renderer
.
instance
.
renderView
.
layer
.
toStringDeep
());
debugPrint
(
Renderer
.
instance
?.
renderView
?.
layer
?
.
toStringDeep
());
}
/// A concrete binding for applications that use the Rendering framework
/// directly. This is the glue that binds the framework to the Flutter engine.
class
RenderingFlutterBinding
extends
BindingBase
with
Scheduler
,
Renderer
,
Gesturer
{
RenderingFlutterBinding
({
RenderBox
root
})
{
assert
(
renderView
!=
null
);
renderView
.
child
=
root
;
}
}
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