Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
external_skia
Commits
5f68c348
Commit
5f68c348
authored
10 years ago
by
reed
Committed by
Commit bot
10 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Update SVGDevice for RRect and drawPoints
BUG=skia: Review URL:
https://codereview.chromium.org/1127933003
parent
e3ababe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
src/svg/SkSVGDevice.cpp
src/svg/SkSVGDevice.cpp
+34
-7
No files found.
src/svg/SkSVGDevice.cpp
View file @
5f68c348
...
...
@@ -603,10 +603,34 @@ void SkSVGDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
SkIntToScalar
(
this
->
height
())));
}
void
SkSVGDevice
::
drawPoints
(
const
SkDraw
&
,
SkCanvas
::
PointMode
mode
,
size_t
count
,
const
SkPoint
[],
const
SkPaint
&
paint
)
{
// todo
SkDebugf
(
"unsupported operation: drawPoints()
\n
"
);
void
SkSVGDevice
::
drawPoints
(
const
SkDraw
&
draw
,
SkCanvas
::
PointMode
mode
,
size_t
count
,
const
SkPoint
pts
[],
const
SkPaint
&
paint
)
{
SkPath
path
;
switch
(
mode
)
{
// todo
case
SkCanvas
::
kPoints_PointMode
:
SkDebugf
(
"unsupported operation: drawPoints(kPoints_PointMode)
\n
"
);
break
;
case
SkCanvas
::
kLines_PointMode
:
count
-=
1
;
for
(
size_t
i
=
0
;
i
<
count
;
i
+=
2
)
{
path
.
rewind
();
path
.
moveTo
(
pts
[
i
]);
path
.
lineTo
(
pts
[
i
+
1
]);
AutoElement
elem
(
"path"
,
fWriter
,
fResourceBucket
,
draw
,
paint
);
elem
.
addPathAttributes
(
path
);
}
break
;
case
SkCanvas
::
kPolygon_PointMode
:
if
(
count
>
1
)
{
path
.
addPoly
(
pts
,
SkToInt
(
count
),
false
);
path
.
moveTo
(
pts
[
0
]);
AutoElement
elem
(
"path"
,
fWriter
,
fResourceBucket
,
draw
,
paint
);
elem
.
addPathAttributes
(
path
);
}
break
;
}
}
void
SkSVGDevice
::
drawRect
(
const
SkDraw
&
draw
,
const
SkRect
&
r
,
const
SkPaint
&
paint
)
{
...
...
@@ -622,9 +646,12 @@ void SkSVGDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint
ellipse
.
addAttribute
(
"ry"
,
oval
.
height
()
/
2
);
}
void
SkSVGDevice
::
drawRRect
(
const
SkDraw
&
,
const
SkRRect
&
rr
,
const
SkPaint
&
paint
)
{
// todo
SkDebugf
(
"unsupported operation: drawRRect()
\n
"
);
void
SkSVGDevice
::
drawRRect
(
const
SkDraw
&
draw
,
const
SkRRect
&
rr
,
const
SkPaint
&
paint
)
{
SkPath
path
;
path
.
addRRect
(
rr
);
AutoElement
elem
(
"path"
,
fWriter
,
fResourceBucket
,
draw
,
paint
);
elem
.
addPathAttributes
(
path
);
}
void
SkSVGDevice
::
drawPath
(
const
SkDraw
&
draw
,
const
SkPath
&
path
,
const
SkPaint
&
paint
,
...
...
This diff is collapsed.
Click to expand it.
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