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
91551c79
Commit
91551c79
authored
Jan 11, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1180 from abarth/always_be_compositing
Rename RenderObject.hasLayer to isRepaintBoundary
parents
e20ef502
0b775984
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
20 deletions
+30
-20
block.dart
packages/flutter/lib/src/rendering/block.dart
+1
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+27
-17
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+1
-1
view.dart
packages/flutter/lib/src/rendering/view.dart
+1
-1
No files found.
packages/flutter/lib/src/rendering/block.dart
View file @
91551c79
...
...
@@ -256,7 +256,7 @@ class RenderBlockViewport extends RenderBlockBase {
super
(
children:
children
,
direction:
direction
,
itemExtent:
itemExtent
,
minExtent:
minExtent
);
bool
_inCallback
=
false
;
bool
get
hasLayer
=>
true
;
bool
get
isRepaintBoundary
=>
true
;
/// Called during [layout] to determine the block's children.
///
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
91551c79
...
...
@@ -67,7 +67,7 @@ class PaintingContext {
/// painting. The render object's layer is re-used, along with any layers in
/// the subtree that don't need to be repainted.
static
void
repaintCompositedChild
(
RenderObject
child
)
{
assert
(
child
.
hasLayer
);
assert
(
child
.
isRepaintBoundary
);
assert
(
child
.
needsPaint
);
child
.
_layer
??=
new
ContainerLayer
();
child
.
_layer
.
removeAllChildren
();
...
...
@@ -86,7 +86,7 @@ class PaintingContext {
/// into the layer subtree associated with this painting context. Otherwise,
/// the child will be painted into the current PictureLayer for this context.
void
paintChild
(
RenderObject
child
,
Offset
offset
)
{
if
(
child
.
hasLayer
)
{
if
(
child
.
isRepaintBoundary
)
{
_stopRecordingIfNeeded
();
_compositeChild
(
child
,
offset
);
}
else
{
...
...
@@ -96,7 +96,7 @@ class PaintingContext {
void
_compositeChild
(
RenderObject
child
,
Offset
offset
)
{
assert
(!
_isRecording
);
assert
(
child
.
hasLayer
);
assert
(
child
.
isRepaintBoundary
);
assert
(
_canvas
==
null
||
_canvas
.
getSaveCount
()
==
1
);
// Create a layer for our child, and paint the child into it.
...
...
@@ -393,7 +393,7 @@ RenderingExceptionHandler debugRenderingExceptionHandler;
abstract
class
RenderObject
extends
AbstractNode
implements
HitTestTarget
{
RenderObject
()
{
_needsCompositing
=
hasLayer
;
_needsCompositing
=
isRepaintBoundary
||
alwaysNeedsCompositing
;
}
// LAYOUT
...
...
@@ -838,21 +838,31 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
static
List
<
RenderObject
>
_nodesNeedingPaint
=
<
RenderObject
>[];
static
List
<
RenderObject
>
_nodesNeedingCompositingBitsUpdate
=
<
RenderObject
>[];
/// Whether this render object
paints using a composited layer
.
/// Whether this render object
repaints separately from its parent
.
///
/// Override this in subclasses to indicate that instances of your class need
/// to have their own compositing layer. For example, videos should return
/// Override this in subclasses to indicate that instances of your class ought
/// to repaint independently. For example, render objects that repaint
/// frequently might want to repaint themselves without requiring their parent
/// to repaint.
///
/// Warning: This getter must not change value over the lifetime of this object.
bool
get
isRepaintBoundary
=>
false
;
/// Whether this render object always needs compositing.
///
/// Override this in subclasses to indicate that your paint function always
/// creates at least one composited layer. For example, videos should return
/// true if they use hardware decoders.
///
///
Note
: This getter must not change value over the lifetime of this object.
bool
get
hasLayer
=>
false
;
///
Warning
: This getter must not change value over the lifetime of this object.
bool
get
alwaysNeedsCompositing
=>
false
;
ContainerLayer
_layer
;
/// The compositing layer that this render object uses to paint.
/// The compositing layer that this render object uses to
re
paint.
///
/// Call only when [
hasLayer
] is true.
/// Call only when [
isRepaintBoundary
] is true.
ContainerLayer
get
layer
{
assert
(
hasLayer
);
assert
(
isRepaintBoundary
);
assert
(!
_needsPaint
);
return
_layer
;
}
...
...
@@ -878,7 +888,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
final
RenderObject
parent
=
this
.
parent
;
if
(
parent
.
_needsCompositingBitsUpdate
)
return
;
if
(!
hasLayer
&&
!
parent
.
hasLayer
)
{
if
(!
isRepaintBoundary
&&
!
parent
.
isRepaintBoundary
)
{
parent
.
_markNeedsCompositingBitsUpdate
();
return
;
}
...
...
@@ -927,7 +937,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
if
(
child
.
needsCompositing
)
_needsCompositing
=
true
;
});
if
(
hasLayer
)
if
(
isRepaintBoundary
||
alwaysNeedsCompositing
)
_needsCompositing
=
true
;
if
(
oldNeedsCompositing
!=
_needsCompositing
)
markNeedsPaint
();
...
...
@@ -955,7 +965,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
if
(
_needsPaint
)
return
;
_needsPaint
=
true
;
if
(
hasLayer
)
{
if
(
isRepaintBoundary
)
{
assert
(()
{
if
(
debugPrintMarkNeedsPaintStacks
)
debugPrintStack
();
...
...
@@ -1019,7 +1029,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert
(
attached
);
assert
(
parent
is
!
RenderObject
);
assert
(!
_debugDoingPaint
);
assert
(
hasLayer
);
assert
(
isRepaintBoundary
);
assert
(
_layer
==
null
);
_layer
=
rootLayer
;
assert
(
_needsPaint
);
...
...
@@ -1034,7 +1044,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
_debugDoingThisPaint
=
true
;
debugLastActivePaint
=
_debugActivePaint
;
_debugActivePaint
=
this
;
assert
(!
hasLayer
||
_layer
!=
null
);
assert
(!
isRepaintBoundary
||
_layer
!=
null
);
return
true
;
});
_needsPaint
=
false
;
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
91551c79
...
...
@@ -1287,7 +1287,7 @@ class RenderPointerListener extends RenderProxyBox {
/// not, we can re-record its display list without re-recording the display list
/// for the surround tree.
class
RenderRepaintBoundary
extends
RenderProxyBox
{
bool
get
hasLayer
=>
true
;
bool
get
isRepaintBoundary
=>
true
;
}
/// Is invisible during hit testing.
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
91551c79
...
...
@@ -108,7 +108,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
return
true
;
}
bool
get
hasLayer
=>
true
;
bool
get
isRepaintBoundary
=>
true
;
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
if
(
child
!=
null
)
...
...
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