[Pkg-wmaker-commits] [wmbubble] 21/207: Force-inline (using macros) wmPutPixel for performance (~550fps->600fps)
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 04:17:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmbubble.
commit 69d95226b482a1399d435407f87b403a4c93570b
Author: Robert Jacobs <rnjacobs at mit.edu>
Date: Tue Jul 26 19:02:18 2011 -0700
Force-inline (using macros) wmPutPixel for performance (~550fps->600fps)
---
wmx11pixmap.c | 10 ----------
wmx11pixmap.h | 11 ++++++++++-
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/wmx11pixmap.c b/wmx11pixmap.c
index c059814..1245409 100644
--- a/wmx11pixmap.c
+++ b/wmx11pixmap.c
@@ -128,13 +128,3 @@ XImage * initwmX11pixmap(int argc, char *argv[]) {
return xim;
}
-
-void wmPutPixel(XImage * xim, int x, int y, unsigned char r, unsigned char g, unsigned char b) {
- unsigned long pxl;
-
- pxl = ((r*xim->red_mask/255)&xim->red_mask) |
- ((g*xim->green_mask/255)&xim->green_mask) |
- ((b*xim->blue_mask/255)&xim->blue_mask);
-
- XPutPixel(xim, x, y, pxl);
-};
diff --git a/wmx11pixmap.h b/wmx11pixmap.h
index 3db63b2..30ebba6 100644
--- a/wmx11pixmap.h
+++ b/wmx11pixmap.h
@@ -11,7 +11,16 @@
XImage * initwmX11pixmap(int argc, char *argv[]);
void RedrawWindow(XImage * xim);
-void wmPutPixel(XImage *, int x, int y, unsigned char r, unsigned char g, unsigned char b);
+
+#define wmPutPixel(xim, x, y, r, g, b) {\
+ unsigned long pxl;\
+\
+ pxl = ((r*xim->red_mask/255)&xim->red_mask) |\
+ ((g*xim->green_mask/255)&xim->green_mask) |\
+ ((b*xim->blue_mask/255)&xim->blue_mask);\
+\
+ XPutPixel(xim, x, y, pxl);\
+}
/* Global variables necessary for the event handlers */
Display *wmxp_display;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbubble.git
More information about the Pkg-wmaker-commits
mailing list