linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>,
	Slavomir Kaslev <kaslevs@vmware.com>
Subject: [RFC PATCH v2 1/5] kernel-shark: Simplify the drawing of the Triangle Fan
Date: Wed,  3 Jul 2019 15:10:19 +0300	[thread overview]
Message-ID: <20190703121023.16655-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20190703121023.16655-1-y.karadz@gmail.com>

The central vertex of the Triangle Fan doesn't need to be an internal
point. The first point of the polygon can be used instead.

Suggested-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/libkshark-plot.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/kernel-shark/src/libkshark-plot.c b/kernel-shark/src/libkshark-plot.c
index 17d3b90..cdd0ef8 100644
--- a/kernel-shark/src/libkshark-plot.c
+++ b/kernel-shark/src/libkshark-plot.c
@@ -162,18 +162,9 @@ void ksplot_draw_polygon(const struct ksplot_point *points,
 		return;
 	}
 
-	/* Obtain a point inside the surface of the polygon. */
-	struct ksplot_point in_point;
-	in_point.x = (points[0].x + points[2].x) / 2;
-	in_point.y = (points[0].y + points[2].y) / 2;
-
-	/*
-	 * Draw a Triangle Fan using the internal point as a central
-	 * vertex.
-	 */
+	/* Draw a Triangle Fan. */
 	glBegin(GL_TRIANGLE_FAN);
 	glColor3ub(col->red, col->green, col->blue);
-	glVertex2i(in_point.x, in_point.y);
 	for (size_t i = 0; i < n_points; ++i)
 		glVertex2i(points[i].x, points[i].y);
 
-- 
2.20.1


  reply	other threads:[~2019-07-03 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 12:10 [RFC PATCH v2 0/5] Add support for text rendering Yordan Karadzhov (VMware)
2019-07-03 12:10 ` Yordan Karadzhov (VMware) [this message]
2019-07-03 12:10 ` [RFC PATCH v2 2/5] kernel-shark: Add support for drawing text Yordan Karadzhov (VMware)
2019-07-03 12:10 ` [RFC PATCH v2 3/5] kernel-shark: Add text rendering to the plotting example Yordan Karadzhov (VMware)
2019-07-03 12:10 ` [RFC PATCH v2 4/5] kernel-shark: Add hello_kernel plugin Yordan Karadzhov (VMware)
2019-07-03 12:10 ` [RFC PATCH v2 5/5] kernel-shark: Drop Freeglut as a compulsory dependency Yordan Karadzhov (VMware)
2019-07-05  9:13   ` Slavomir Kaslev
2019-07-05 10:25 ` [RFC PATCH v2 0/5] Add support for text rendering Slavomir Kaslev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190703121023.16655-2-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=kaslevs@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).