From owner-freebsd-bugs Mon May 22 23:20: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id CA73237BB60 for ; Mon, 22 May 2000 23:20:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id XAA66017; Mon, 22 May 2000 23:20:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 2149537B85A; Mon, 22 May 2000 23:12:36 -0700 (PDT) Message-Id: <20000523061236.2149537B85A@hub.freebsd.org> Date: Mon, 22 May 2000 23:12:36 -0700 (PDT) From: giffunip@asme.org To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/18769: Minor speedups for libvgl's boxing functions Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 18769 >Category: misc >Synopsis: Minor speedups for libvgl's boxing functions >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon May 22 23:20:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Pedro F. Giffuni >Release: 3.4-Release >Organization: Universidad Nacional de Colombia >Environment: >Description: The VGL boxing functions usually call VGLLine, which uses some arithmetic to work out the slope. In the case of boxes we already know which lines are horizontal or vertical and we can do it faster. >How-To-Repeat: The problem is admittedly not noticeable, however the enhancements in /usr/lib/libvgl/simple.c were trivial. >Fix: *** simple.c.orig Mon May 22 23:31:21 2000 --- simple.c Tue May 23 00:53:51 2000 *************** *** 140,157 **** void VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) { ! VGLLine(object, x1, y1, x2, y1, color); ! VGLLine(object, x2, y1, x2, y2, color); ! VGLLine(object, x2, y2, x1, y2, color); ! VGLLine(object, x1, y2, x1, y1, color); } void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) { ! int y; ! for (y=y1; y<=y2; y++) VGLLine(object, x1, y, x2, y, color); } void --- 140,165 ---- void VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) { ! int y,x; ! ! for (x=x1; x<=x2; x++) { /* Horizontal lines */ ! VGLSetXY(object, x, y1, color); ! VGLSetXY(object, x, y2, color); ! } ! for (y= ++y1; yRelease-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message