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
602dbbee
Commit
602dbbee
authored
Aug 13, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #600 from abarth/requires_compositing
Rename createsNewDisplayList to requiresCompositing
parents
5cf3b58f
be845407
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
27 deletions
+9
-27
object.dart
packages/flutter/lib/rendering/object.dart
+9
-27
No files found.
packages/flutter/lib/rendering/object.dart
View file @
602dbbee
...
...
@@ -36,15 +36,10 @@ class PaintingContext {
PaintingContext
(
this
.
canvas
);
List
<
RenderObject
>
_descendentsWithPaintingCanvases
=
new
List
<
RenderObject
>();
// used by RenderObject._updatePaintingCanvas() to find out which RenderObjects to ask to paint
void
paintChild
(
RenderObject
child
,
Point
point
)
{
if
(
child
.
createNewDisplayList
)
{
assert
(!
_descendentsWithPaintingCanvases
.
contains
(
child
));
_descendentsWithPaintingCanvases
.
add
(
child
);
canvas
.
drawPaintingNode
(
child
.
_paintingNode
,
point
);
}
else
{
child
.
_paintWithContext
(
this
,
point
.
toOffset
());
}
// TODO(abarth): Support compositing.
assert
(!
child
.
requiresCompositing
);
child
.
_paintWithContext
(
this
,
point
.
toOffset
());
}
}
...
...
@@ -320,11 +315,6 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
static
List
<
RenderObject
>
_nodesNeedingPaint
=
new
List
<
RenderObject
>();
final
sky
.
PaintingNode
_paintingNode
=
new
sky
.
PaintingNode
();
sky
.
PaintingNode
get
paintingNode
{
assert
(
createNewDisplayList
);
return
_paintingNode
;
}
bool
_needsPaint
=
true
;
bool
get
needsPaint
=>
_needsPaint
;
...
...
@@ -332,7 +322,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert
(!
debugDoingPaint
);
if
(!
attached
)
return
;
// Don't try painting things that aren't in the hierarchy
if
(
_needsPaint
)
return
;
if
(
createNewDisplayList
)
{
if
(
requiresCompositing
)
{
_needsPaint
=
true
;
_nodesNeedingPaint
.
add
(
this
);
scheduler
.
ensureVisualUpdate
();
...
...
@@ -355,7 +345,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
_nodesNeedingPaint
=
new
List
<
RenderObject
>();
for
(
RenderObject
node
in
dirtyNodes
..
sort
((
a
,
b
)
=>
a
.
depth
-
b
.
depth
))
{
if
(
node
.
_needsPaint
&&
node
.
attached
)
node
.
_
updatePaintingCanvas
();
node
.
_
repaint
();
};
assert
(
_nodesNeedingPaint
.
length
==
0
);
}
finally
{
...
...
@@ -364,9 +354,9 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
}
}
void
_
updatePaintingCanvas
()
{
void
_
repaint
()
{
assert
(!
_needsLayout
);
assert
(
createNewDisplayList
);
assert
(
requiresCompositing
);
sky
.
PictureRecorder
recorder
=
new
sky
.
PictureRecorder
();
sky
.
Canvas
canvas
=
new
sky
.
Canvas
(
recorder
,
paintBounds
);
PaintingContext
context
=
new
PaintingContext
(
canvas
);
...
...
@@ -374,21 +364,13 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
try
{
_paintWithContext
(
context
,
Offset
.
zero
);
}
catch
(
e
)
{
print
(
'Exception raised during _
updatePaintingCanvas
:
\n
${e}
\n
Context:
\n
${this}
'
);
print
(
'Exception raised during _
repaint
:
\n
${e}
\n
Context:
\n
${this}
'
);
if
(
inDebugBuild
)
rethrow
;
return
;
}
assert
(!
_needsLayout
);
// check that the paint() method didn't mark us dirty again
assert
(!
_needsPaint
);
// check that the paint() method didn't mark us dirty again
_paintingNode
.
setBackingDrawable
(
recorder
.
endRecordingAsDrawable
());
if
(
context
.
_descendentsWithPaintingCanvases
!=
null
)
{
for
(
RenderObject
node
in
context
.
_descendentsWithPaintingCanvases
)
{
assert
(
node
.
attached
==
attached
);
if
(
node
.
_needsPaint
)
node
.
_updatePaintingCanvas
();
};
}
}
void
_paintWithContext
(
PaintingContext
context
,
Offset
offset
)
{
...
...
@@ -417,7 +399,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert
(!
_needsPaint
);
}
bool
get
createNewDisplayList
=>
false
;
bool
get
requiresCompositing
=>
false
;
Rect
get
paintBounds
;
void
debugPaint
(
PaintingContext
context
,
Offset
offset
)
{
}
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
}
...
...
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