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
3e85649c
Commit
3e85649c
authored
Aug 10, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #519 from abarth/optimize_clips
Optimize circular clips slightly
parents
de7d8efc
ec0bccfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
box.dart
packages/flutter/lib/rendering/box.dart
+22
-7
No files found.
packages/flutter/lib/rendering/box.dart
View file @
3e85649c
...
...
@@ -802,7 +802,8 @@ class RenderOpacity extends RenderProxyBox {
if
(
_cachedPaint
==
null
)
{
_cachedPaint
=
new
Paint
()
..
color
=
new
Color
.
fromARGB
(
_alpha
,
0
,
0
,
0
)
..
setTransferMode
(
sky
.
TransferMode
.
srcOver
);
..
setTransferMode
(
sky
.
TransferMode
.
srcOver
)
..
isAntiAlias
=
false
;
}
return
_cachedPaint
;
}
...
...
@@ -857,7 +858,8 @@ class RenderColorFilter extends RenderProxyBox {
Paint
get
_paint
{
if
(
_cachedPaint
==
null
)
{
_cachedPaint
=
new
Paint
()
..
setColorFilter
(
new
sky
.
ColorFilter
.
mode
(
_color
,
_transferMode
));
..
setColorFilter
(
new
sky
.
ColorFilter
.
mode
(
_color
,
_transferMode
))
..
isAntiAlias
=
false
;
}
return
_cachedPaint
;
}
...
...
@@ -911,10 +913,12 @@ class RenderClipRRect extends RenderProxyBox {
markNeedsPaint
();
}
final
Paint
_paint
=
new
Paint
()..
isAntiAlias
=
false
;
void
paint
(
PaintingCanvas
canvas
,
Offset
offset
)
{
if
(
child
!=
null
)
{
Rect
rect
=
offset
&
size
;
canvas
.
saveLayer
(
rect
,
new
Paint
()
);
canvas
.
saveLayer
(
rect
,
_paint
);
sky
.
RRect
rrect
=
new
sky
.
RRect
()..
setRectXY
(
rect
,
xRadius
,
yRadius
);
canvas
.
clipRRect
(
rrect
);
canvas
.
paintChild
(
child
,
offset
.
toPoint
());
...
...
@@ -926,13 +930,24 @@ class RenderClipRRect extends RenderProxyBox {
class
RenderClipOval
extends
RenderProxyBox
{
RenderClipOval
({
RenderBox
child
})
:
super
(
child
);
final
Paint
_paint
=
new
Paint
()..
isAntiAlias
=
false
;
Rect
_cachedRect
;
Path
_cachedPath
;
Path
_getPath
(
Rect
rect
)
{
if
(
rect
!=
_cachedRect
)
{
_cachedRect
=
rect
;
_cachedPath
=
new
Path
()..
addOval
(
_cachedRect
);
}
return
_cachedPath
;
}
void
paint
(
PaintingCanvas
canvas
,
Offset
offset
)
{
if
(
child
!=
null
)
{
Rect
rect
=
offset
&
size
;
canvas
.
saveLayer
(
rect
,
new
Paint
());
Path
path
=
new
Path
();
path
.
addOval
(
rect
);
canvas
.
clipPath
(
path
);
canvas
.
saveLayer
(
rect
,
_paint
);
canvas
.
clipPath
(
_getPath
(
rect
));
canvas
.
paintChild
(
child
,
offset
.
toPoint
());
canvas
.
restore
();
}
...
...
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