gimp r25058 - in trunk: . app/display
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25058 - in trunk: . app/display
- Date: Thu, 6 Mar 2008 23:20:27 +0000 (GMT)
Author: neo
Date: Thu Mar 6 23:20:27 2008
New Revision: 25058
URL: http://svn.gnome.org/viewvc/gimp?rev=25058&view=rev
Log:
2008-03-07 Sven Neumann <sven gimp org>
* app/display/gimpdisplayshell-preview.c: minor optimization.
Modified:
trunk/ChangeLog
trunk/app/display/gimpdisplayshell-preview.c
Modified: trunk/app/display/gimpdisplayshell-preview.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-preview.c (original)
+++ trunk/app/display/gimpdisplayshell-preview.c Thu Mar 6 23:20:27 2008
@@ -42,7 +42,9 @@
#include "gimpdisplayshell-transform.h"
-#define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t)) >> 8))
+#define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t)) >> 8))
+#define INT_MULT3(a,b,c,t) ((t) = (a) * (b) * (c) + 0x7F5B, \
+ ((((t) >> 7) + (t)) >> 16))
#define MAX_SUB_COLS 6 /* number of columns and */
@@ -917,14 +919,12 @@
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, &maskval);
- maskval = INT_MULT (maskval, pixel[1], tmp);
-
offset = pixel[0] + pixel[0] + pixel[0];
pptr[0] = cmap[offset + 0];
pptr[1] = cmap[offset + 1];
pptr[2] = cmap[offset + 2];
- pptr[3] = INT_MULT (opacity, maskval, tmp);
+ pptr[3] = INT_MULT3 (opacity, maskval, pixel[1], tmp);
pptr += 4;
@@ -965,12 +965,10 @@
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, &maskval);
- maskval = INT_MULT (maskval, pixel[1], tmp);
-
pptr[0] = pixel[0];
pptr[1] = pixel[0];
pptr[2] = pixel[0];
- pptr[3] = INT_MULT (opacity, maskval, tmp);
+ pptr[3] = INT_MULT3 (opacity, maskval, pixel[1], tmp);
pptr += 4;
@@ -1011,12 +1009,10 @@
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, &maskval);
- maskval = INT_MULT (maskval, pixel[3], tmp);
-
pptr[0] = pixel[0];
pptr[1] = pixel[1];
pptr[2] = pixel[2];
- pptr[3] = INT_MULT (opacity, maskval, tmp);
+ pptr[3] = INT_MULT3 (opacity, maskval, pixel[3], tmp);
pptr += 4;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]