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
d291fcae
Commit
d291fcae
authored
Aug 14, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #620 from abarth/compositing_update
Add a compositing update phase
parents
e0f14e37
e17aa1b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
object.dart
packages/flutter/lib/rendering/object.dart
+36
-4
sky_binding.dart
packages/flutter/lib/rendering/sky_binding.dart
+1
-0
No files found.
packages/flutter/lib/rendering/object.dart
View file @
d291fcae
...
@@ -120,6 +120,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -120,6 +120,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
setupParentData
(
child
);
setupParentData
(
child
);
super
.
adoptChild
(
child
);
super
.
adoptChild
(
child
);
markNeedsLayout
();
markNeedsLayout
();
markNeedsCompositingUpdate
();
}
}
void
dropChild
(
RenderObject
child
)
{
// only for use by subclasses
void
dropChild
(
RenderObject
child
)
{
// only for use by subclasses
assert
(
debugCanPerformMutations
);
assert
(
debugCanPerformMutations
);
...
@@ -129,6 +130,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -129,6 +130,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
child
.
parentData
.
detach
();
child
.
parentData
.
detach
();
super
.
dropChild
(
child
);
super
.
dropChild
(
child
);
markNeedsLayout
();
markNeedsLayout
();
markNeedsCompositingUpdate
();
}
}
// Override in subclasses with children and call the visitor for each child.
// Override in subclasses with children and call the visitor for each child.
...
@@ -367,15 +369,46 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -367,15 +369,46 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
static
List
<
RenderObject
>
_nodesNeedingPaint
=
new
List
<
RenderObject
>();
static
List
<
RenderObject
>
_nodesNeedingPaint
=
new
List
<
RenderObject
>();
bool
_needsPaint
=
true
;
bool
get
needsPaint
=>
_needsPaint
;
PictureLayer
_layer
;
PictureLayer
_layer
;
PictureLayer
get
layer
{
PictureLayer
get
layer
{
assert
(
requiresCompositing
);
assert
(
requiresCompositing
);
return
_layer
;
return
_layer
;
}
}
bool
get
requiresCompositing
=>
false
;
bool
_hasCompositedDescendant
=
false
;
bool
get
hasCompositedDescendant
{
assert
(!
_needsCompositingUpdate
);
return
_hasCompositedDescendant
;
}
bool
_needsCompositingUpdate
=
false
;
void
markNeedsCompositingUpdate
()
{
if
(
_needsCompositingUpdate
)
return
;
_needsCompositingUpdate
=
true
;
final
AbstractNode
parent
=
this
.
parent
;
if
(
parent
is
RenderObject
)
parent
.
markNeedsCompositingUpdate
();
}
void
updateCompositing
()
{
if
(!
_needsCompositingUpdate
)
return
;
visitChildren
((
RenderObject
child
)
{
child
.
updateCompositing
();
if
(
child
.
hasCompositedDescendant
)
_hasCompositedDescendant
=
true
;
});
if
(
requiresCompositing
)
_hasCompositedDescendant
=
true
;
_needsCompositingUpdate
=
false
;
}
bool
_needsPaint
=
true
;
bool
get
needsPaint
=>
_needsPaint
;
void
markNeedsPaint
()
{
void
markNeedsPaint
()
{
assert
(!
debugDoingPaint
);
assert
(!
debugDoingPaint
);
if
(!
attached
)
return
;
// Don't try painting things that aren't in the hierarchy
if
(!
attached
)
return
;
// Don't try painting things that aren't in the hierarchy
...
@@ -461,7 +494,6 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
...
@@ -461,7 +494,6 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert
(!
_needsPaint
);
assert
(!
_needsPaint
);
}
}
bool
get
requiresCompositing
=>
false
;
Rect
get
paintBounds
;
Rect
get
paintBounds
;
void
debugPaint
(
PaintingContext
context
,
Offset
offset
)
{
}
void
debugPaint
(
PaintingContext
context
,
Offset
offset
)
{
}
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
}
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
}
...
...
packages/flutter/lib/rendering/sky_binding.dart
View file @
d291fcae
...
@@ -71,6 +71,7 @@ class SkyBinding {
...
@@ -71,6 +71,7 @@ class SkyBinding {
}
}
void
beginFrame
(
double
timeStamp
)
{
void
beginFrame
(
double
timeStamp
)
{
RenderObject
.
flushLayout
();
RenderObject
.
flushLayout
();
_renderView
.
updateCompositing
();
RenderObject
.
flushPaint
();
RenderObject
.
flushPaint
();
_renderView
.
paintFrame
();
_renderView
.
paintFrame
();
_renderView
.
compositeFrame
();
_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