summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp14
-rw-r--r--drivers/gles2/rasterizer_gles2.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index ba93a26a2d..3809f4c7b9 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -8196,7 +8196,7 @@ RasterizerGLES2::Texture* RasterizerGLES2::_bind_canvas_texture(const RID& p_tex
return NULL;
}
-void RasterizerGLES2::canvas_draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width) {
+void RasterizerGLES2::canvas_draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width,bool p_antialiased) {
_bind_canvas_texture(RID());
Color c=p_color;
@@ -8208,8 +8208,18 @@ void RasterizerGLES2::canvas_draw_line(const Point2& p_from, const Point2& p_to,
Vector3(p_to.x,p_to.y,0)
};
+#ifdef GLEW_ENABLED
+ if (p_antialiased)
+ glEnable(GL_LINE_SMOOTH);
+#endif
glLineWidth(p_width);
_draw_primitive(2,verts,0,0,0);
+
+#ifdef GLEW_ENABLED
+ if (p_antialiased)
+ glDisable(GL_LINE_SMOOTH);
+#endif
+
_rinfo.ci_draw_commands++;
}
@@ -9135,7 +9145,7 @@ void RasterizerGLES2::_canvas_item_render_commands(CanvasItem *p_item,CanvasItem
case CanvasItem::Command::TYPE_LINE: {
CanvasItem::CommandLine* line = static_cast<CanvasItem::CommandLine*>(c);
- canvas_draw_line(line->from,line->to,line->color,line->width);
+ canvas_draw_line(line->from,line->to,line->color,line->width,line->antialiased);
} break;
case CanvasItem::Command::TYPE_RECT: {
diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h
index c9fc0c247d..b18f89d8e7 100644
--- a/drivers/gles2/rasterizer_gles2.h
+++ b/drivers/gles2/rasterizer_gles2.h
@@ -1633,7 +1633,7 @@ public:
virtual void canvas_begin_rect(const Matrix32& p_transform);
virtual void canvas_set_clip(bool p_clip, const Rect2& p_rect);
virtual void canvas_end_rect();
- virtual void canvas_draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width);
+ virtual void canvas_draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width,bool p_antialiased);
virtual void canvas_draw_rect(const Rect2& p_rect, int p_flags, const Rect2& p_source,RID p_texture,const Color& p_modulate);
virtual void canvas_draw_style_box(const Rect2& p_rect, const Rect2& p_src_region, RID p_texture,const float *p_margins, bool p_draw_center=true,const Color& p_modulate=Color(1,1,1));
virtual void canvas_draw_primitive(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width);