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
5c1f1d76
Unverified
Commit
5c1f1d76
authored
Dec 13, 2018
by
Michael Goderbauer
Committed by
GitHub
Dec 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call mark* methods before attaching child (#25239)
parent
75228a59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+7
-1
repaint_boundary_test.dart
packages/flutter/test/rendering/repaint_boundary_test.dart
+17
-0
No files found.
packages/flutter/lib/src/rendering/object.dart
View file @
5c1f1d76
...
...
@@ -1138,10 +1138,10 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert
(
_debugCanPerformMutations
);
assert
(
child
!=
null
);
setupParentData
(
child
);
super
.
adoptChild
(
child
);
markNeedsLayout
();
markNeedsCompositingBitsUpdate
();
markNeedsSemanticsUpdate
();
super
.
adoptChild
(
child
);
}
/// Called by subclasses when they decide a render object is no longer a child.
...
...
@@ -1830,6 +1830,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
bool
_needsCompositingBitsUpdate
=
false
;
// set to true when a child is added
/// Mark the compositing state for this render object as dirty.
///
/// This is called to indicate that the value for [needsCompositing] needs to
/// be recomputed during the next [flushCompositingBits] engine phase.
///
/// When the subtree is mutated, we need to recompute our
/// [needsCompositing] bit, and some of our ancestors need to do the
/// same (in case ours changed in a way that will change theirs). To
...
...
@@ -1867,6 +1870,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
bool
_needsCompositing
;
// initialised in the constructor
/// Whether we or one of our descendants has a compositing layer.
///
/// If this node needs compositing as indicated by this bit, then all ancestor
/// nodes will also need compositing.
///
/// Only legal to call after [PipelineOwner.flushLayout] and
/// [PipelineOwner.flushCompositingBits] have been called.
bool
get
needsCompositing
{
...
...
packages/flutter/test/rendering/repaint_boundary_test.dart
View file @
5c1f1d76
...
...
@@ -34,4 +34,21 @@ void main() {
c
.
opacity
=
0.7
;
pumpFrame
(
phase:
EnginePhase
.
flushSemantics
);
});
test
(
'Repaint boundary can get new parent after markNeedsCompositingBitsUpdate'
,
()
{
// Regression test for https://github.com/flutter/flutter/issues/24029.
final
RenderRepaintBoundary
repaintBoundary
=
RenderRepaintBoundary
();
layout
(
repaintBoundary
,
phase:
EnginePhase
.
flushSemantics
);
repaintBoundary
.
markNeedsCompositingBitsUpdate
();
renderer
.
renderView
.
child
=
null
;
final
RenderPadding
padding
=
RenderPadding
(
padding:
const
EdgeInsets
.
all
(
50
),
);
renderer
.
renderView
.
child
=
padding
;
padding
.
child
=
repaintBoundary
;
pumpFrame
(
phase:
EnginePhase
.
flushSemantics
);
});
}
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