Date: Mon, 22 May 2000 23:12:36 -0700 (PDT) From: giffunip@asme.org To: freebsd-gnats-submit@FreeBSD.org Subject: misc/18769: Minor speedups for libvgl's boxing functions Message-ID: <20000523061236.2149537B85A@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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; y<y2; y++) { /* Vertical lines */ ! VGLSetXY(object, x1, y, color); ! VGLSetXY(object, x2, y, color); ! } } void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) { ! int x,y; ! for (y=y1; y<=y2; y++) { /* Horizontal lines */ ! for (x=x1; x<=x2; x++) VGLSetXY(object, x, y, color); ! } } void >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000523061236.2149537B85A>