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
c25beb84
Commit
c25beb84
authored
Aug 11, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #551 from abarth/rm_weak_paint
Remove weak handle from sky.Paint
parents
7d3a6c4a
375c2477
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
28 deletions
+21
-28
painting.dart
examples/raw/painting.dart
+16
-21
shadow.dart
examples/raw/shadow.dart
+1
-1
shadows.dart
packages/flutter/lib/painting/shadows.dart
+4
-6
No files found.
examples/raw/painting.dart
View file @
c25beb84
...
@@ -55,34 +55,29 @@ void beginFrame(double timeStamp) {
...
@@ -55,34 +55,29 @@ void beginFrame(double timeStamp) {
..
setOffset
(
const
sky
.
Offset
(
150.0
,
0.0
))
..
setOffset
(
const
sky
.
Offset
(
150.0
,
0.0
))
..
setColorMode
(
sky
.
TransferMode
.
src
)
..
setColorMode
(
sky
.
TransferMode
.
src
)
..
setPaintBits
(
sky
.
PaintBits
.
all
),
..
setPaintBits
(
sky
.
PaintBits
.
all
),
(
sky
.
Paint
layerPaint
)
{
new
sky
.
Paint
()
layerPaint
.
color
=
const
sky
.
Color
.
fromARGB
(
128
,
255
,
255
,
0
);
..
color
=
const
sky
.
Color
.
fromARGB
(
128
,
255
,
255
,
0
)
layerPaint
.
setColorFilter
(
new
sky
.
ColorFilter
.
mode
(
..
setColorFilter
(
new
sky
.
ColorFilter
.
mode
(
const
sky
.
Color
.
fromARGB
(
128
,
0
,
0
,
255
),
sky
.
TransferMode
.
srcIn
));
const
sky
.
Color
.
fromARGB
(
128
,
0
,
0
,
255
),
sky
.
TransferMode
.
srcIn
))
layerPaint
.
setMaskFilter
(
new
sky
.
MaskFilter
.
blur
(
..
setMaskFilter
(
new
sky
.
MaskFilter
.
blur
(
sky
.
BlurStyle
.
normal
,
3.0
,
highQuality:
true
));
sky
.
BlurStyle
.
normal
,
3.0
,
highQuality:
true
)))
})
..
addLayerOnTop
(
..
addLayerOnTop
(
new
sky
.
DrawLooperLayerInfo
()
new
sky
.
DrawLooperLayerInfo
()
..
setOffset
(
const
sky
.
Offset
(
75.0
,
75.0
))
..
setOffset
(
const
sky
.
Offset
(
75.0
,
75.0
))
..
setColorMode
(
sky
.
TransferMode
.
src
)
..
setColorMode
(
sky
.
TransferMode
.
src
)
..
setPaintBits
(
sky
.
PaintBits
.
shader
),
..
setPaintBits
(
sky
.
PaintBits
.
shader
),
(
sky
.
Paint
layerPaint
)
{
new
sky
.
Paint
()
sky
.
Gradient
redYellow
=
new
sky
.
Gradient
.
radial
(
..
setShader
(
new
sky
.
Gradient
.
radial
(
new
sky
.
Point
(
0.0
,
0.0
),
radius
/
3.0
,
new
sky
.
Point
(
0.0
,
0.0
),
radius
/
3.0
,
[
const
sky
.
Color
(
0xFFFFFF00
),
const
sky
.
Color
(
0xFFFF0000
)],
[
const
sky
.
Color
(
0xFFFFFF00
),
const
sky
.
Color
(
0xFFFF0000
)],
null
,
sky
.
TileMode
.
mirror
);
null
,
sky
.
TileMode
.
mirror
))
layerPaint
.
setShader
(
redYellow
);
// Since we're don't set sky.PaintBits.maskFilter, this has no effect.
// Since we're don't set sky.PaintBits.maskFilter, this has no effect.
..
setMaskFilter
(
new
sky
.
MaskFilter
.
blur
(
layerPaint
.
setMaskFilter
(
new
sky
.
MaskFilter
.
blur
(
sky
.
BlurStyle
.
normal
,
50.0
,
highQuality:
true
)))
sky
.
BlurStyle
.
normal
,
50.0
,
highQuality:
true
));
})
..
addLayerOnTop
(
..
addLayerOnTop
(
new
sky
.
DrawLooperLayerInfo
()..
setOffset
(
const
sky
.
Offset
(
225.0
,
75.0
)),
new
sky
.
DrawLooperLayerInfo
()..
setOffset
(
const
sky
.
Offset
(
225.0
,
75.0
)),
(
sky
.
Paint
layerPaint
)
{
// Since this layer uses a DST color mode, this has no effect.
// Since this layer uses a DST color mode, this has no effect.
new
sky
.
Paint
()..
color
=
const
sky
.
Color
.
fromARGB
(
128
,
255
,
0
,
0
));
layerPaint
.
color
=
const
sky
.
Color
.
fromARGB
(
128
,
255
,
0
,
0
);
});
paint
.
setDrawLooper
(
builder
.
build
());
paint
.
setDrawLooper
(
builder
.
build
());
canvas
.
drawCircle
(
sky
.
Point
.
origin
,
radius
,
paint
);
canvas
.
drawCircle
(
sky
.
Point
.
origin
,
radius
,
paint
);
...
...
examples/raw/shadow.dart
View file @
c25beb84
...
@@ -27,7 +27,7 @@ void beginFrame(double timeStamp) {
...
@@ -27,7 +27,7 @@ void beginFrame(double timeStamp) {
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
5.0
,
highQuality:
true
));
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
5.0
,
highQuality:
true
));
})
})
// Main layer.
// Main layer.
..
addLayerOnTop
(
new
DrawLooperLayerInfo
(),
(
Paint
)
{}
);
..
addLayerOnTop
(
new
DrawLooperLayerInfo
(),
new
Paint
()
);
paint
.
setDrawLooper
(
builder
.
build
());
paint
.
setDrawLooper
(
builder
.
build
());
canvas
.
drawPaint
(
canvas
.
drawPaint
(
...
...
packages/flutter/lib/painting/shadows.dart
View file @
c25beb84
...
@@ -15,15 +15,13 @@ class ShadowDrawLooperBuilder {
...
@@ -15,15 +15,13 @@ class ShadowDrawLooperBuilder {
..
setPaintBits
(
sky
.
PaintBits
.
all
)
..
setPaintBits
(
sky
.
PaintBits
.
all
)
..
setOffset
(
offset
)
..
setOffset
(
offset
)
..
setColorMode
(
sky
.
TransferMode
.
src
),
..
setColorMode
(
sky
.
TransferMode
.
src
),
(
sky
.
Paint
layerPaint
)
{
new
sky
.
Paint
()
layerPaint
.
color
=
color
;
..
color
=
color
layerPaint
.
setMaskFilter
(
..
setMaskFilter
(
new
sky
.
MaskFilter
.
blur
(
sky
.
BlurStyle
.
normal
,
blur
)));
new
sky
.
MaskFilter
.
blur
(
sky
.
BlurStyle
.
normal
,
blur
));
});
}
}
sky
.
DrawLooper
build
()
{
sky
.
DrawLooper
build
()
{
builder_
.
addLayerOnTop
(
new
sky
.
DrawLooperLayerInfo
(),
(
_
)
{}
);
builder_
.
addLayerOnTop
(
new
sky
.
DrawLooperLayerInfo
(),
new
sky
.
Paint
()
);
return
builder_
.
build
();
return
builder_
.
build
();
}
}
}
}
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