From patchwork Wed Jul 3 12:10:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11029409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACF2E112C for ; Wed, 3 Jul 2019 12:10:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E343283E8 for ; Wed, 3 Jul 2019 12:10:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9264E28574; Wed, 3 Jul 2019 12:10:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DD4B283E8 for ; Wed, 3 Jul 2019 12:10:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726255AbfGCMKw (ORCPT ); Wed, 3 Jul 2019 08:10:52 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40591 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfGCMKv (ORCPT ); Wed, 3 Jul 2019 08:10:51 -0400 Received: by mail-wr1-f66.google.com with SMTP id p11so2508286wre.7 for ; Wed, 03 Jul 2019 05:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j7cr3StBGwcU2SsCSs1GWd+RPeSNRJZkMH6+uCYOwWc=; b=R26TYqwKPMTxfDg5DRJI+vWbfyafT7ybA3R7lfRVbmQEJreokk1eSMWR/w9dZ3r2UQ zqomm+p0kDaHZijWBXy+2NsExxQurSDtTTjsF91eapEvTGRNBSeyc2dRA7bBvf1a5EFf vsFD9ycpN6bqurReGV88r4mRtayfii5nsQecHU3o8nND10UEpmVI6ALtCG17yAjLsBIU k4dBLq0MdtIqpOHDaoJOrQ6fHkdwz3l36wN8ug2KSqLRZQBPpJT4+aDO8ZyfDshze/BH hSJ/BSwQ3XE9wp1CFFsdHt2loOi/6cqZui/+H94wynOjwRTSaE7CyZz8kxWpqw3G4y66 qK6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j7cr3StBGwcU2SsCSs1GWd+RPeSNRJZkMH6+uCYOwWc=; b=RBWOSiIcobZRKyUYWzXpHFl/ySsY8eH2i+fn+yxYqjCFw7zaElmw9fP5YGeHMpfR+E DvoXlRsWWm8FSQXqMVUDbIi4r9ECs6cBJ5KP2sgaVm6fBHBr5n54fMi2AY7pRfS93KMU aKGrRxkNVAgZP3cQ1dhen38gfmbfGXOh97AmTwK5ensLQYkVyRc3e4o5W76nineCdkK2 nD8OZJbDZvV49y7T3UZmTAwcOwOvgS2Jw6h718miOYjWGpeCDPPRKb+I5Zj7e59ud/q9 pWBxgAk/fN7HIQSMeqitoEKm7ue6zKvsovGQP9daWhGA+pcORi2wKK1iO92LsXkASFsA DCfQ== X-Gm-Message-State: APjAAAUTucCdYA6l+egoIE3so9VOd28nZ0dWl1k40IHmjQZ7k/5CcCcO bAC7nVRYhduHRbmUeX3sZ64= X-Google-Smtp-Source: APXvYqxfQgIbVWMFeY+3KhwptsiRBsWdatKD+Dii2ILoCKOdn9LPOr9OZbKag9YD5iMRvLpzQbs6CA== X-Received: by 2002:a5d:5112:: with SMTP id s18mr27779252wrt.111.1562155849911; Wed, 03 Jul 2019 05:10:49 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id u18sm2321587wmd.19.2019.07.03.05.10.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 05:10:49 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" , Slavomir Kaslev Subject: [RFC PATCH v2 1/5] kernel-shark: Simplify the drawing of the Triangle Fan Date: Wed, 3 Jul 2019 15:10:19 +0300 Message-Id: <20190703121023.16655-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190703121023.16655-1-y.karadz@gmail.com> References: <20190703121023.16655-1-y.karadz@gmail.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Yordan Karadzhov (VMware) --- 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);