diff options
Diffstat (limited to 'servers/visual/rasterizer.h')
| -rw-r--r-- | servers/visual/rasterizer.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 5b60a46ade..69fd097ee8 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -612,6 +612,7 @@ public: enum Type { TYPE_LINE, + TYPE_POLYLINE, TYPE_RECT, TYPE_NINEPATCH, TYPE_PRIMITIVE, @@ -636,6 +637,18 @@ public: bool antialiased; CommandLine() { type = TYPE_LINE; } }; + struct CommandPolyLine : public Command { + + bool antialiased; + Vector<Point2> triangles; + Vector<Color> triangle_colors; + Vector<Point2> lines; + Vector<Color> line_colors; + CommandPolyLine() { + type = TYPE_POLYLINE; + antialiased = false; + } + }; struct CommandRect : public Command { @@ -815,6 +828,31 @@ public: r.position = line->from; r.expand_to(line->to); } break; + case Item::Command::TYPE_POLYLINE: { + + const Item::CommandPolyLine *pline = static_cast<const Item::CommandPolyLine *>(c); + if (pline->triangles.size()) { + for (int j = 0; j < pline->triangles.size(); j++) { + + if (j == 0) { + r.position = pline->triangles[j]; + } else { + r.expand_to(pline->triangles[j]); + } + } + } else { + + for (int j = 0; j < pline->lines.size(); j++) { + + if (j == 0) { + r.position = pline->lines[j]; + } else { + r.expand_to(pline->lines[j]); + } + } + } + + } break; case Item::Command::TYPE_RECT: { const Item::CommandRect *crect = static_cast<const Item::CommandRect *>(c); |
