Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GIMP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,768
Issues
2,768
List
Boards
Labels
Service Desk
Milestones
Merge Requests
39
Merge Requests
39
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
GIMP
Commits
03752a92
Commit
03752a92
authored
Jan 20, 1998
by
Elliot Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc minor performance improvements
parent
401e04f4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
55 deletions
+42
-55
app/Makefile.am
app/Makefile.am
+0
-1
app/asupsample.c
app/asupsample.c
+10
-20
app/gui/layers-dialog.c
app/gui/layers-dialog.c
+2
-1
app/layers_dialog.c
app/layers_dialog.c
+2
-1
app/linked.h
app/linked.h
+14
-14
app/paint-funcs/paint-funcs.c
app/paint-funcs/paint-funcs.c
+7
-9
app/paint_funcs.c
app/paint_funcs.c
+7
-9
No files found.
app/Makefile.am
View file @
03752a92
...
...
@@ -176,7 +176,6 @@ gimp_SOURCES = \
layers_dialogP.h
\
levels.c
\
levels.h
\
linked.c
\
linked.h
\
magnify.c
\
magnify.h
\
...
...
app/asupsample.c
View file @
03752a92
...
...
@@ -30,6 +30,7 @@
#include <math.h>
#include <string.h>
#include "appenv.h"
#include "asupsample.h"
...
...
@@ -114,17 +115,8 @@ adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double
block
=
g_malloc
((
sub_pixel_size
+
1
)
*
sizeof
(
sample_t
*
));
/* Rows */
for
(
y
=
0
;
y
<
(
sub_pixel_size
+
1
);
y
++
)
block
[
y
]
=
g_malloc
((
sub_pixel_size
+
1
)
*
sizeof
(
sample_t
));
/* Columns */
for
(
y
=
0
;
y
<
(
sub_pixel_size
+
1
);
y
++
)
for
(
x
=
0
;
x
<
(
sub_pixel_size
+
1
);
x
++
)
{
block
[
y
][
x
].
ready
=
0
;
block
[
y
][
x
].
color
.
r
=
0
.
0
;
block
[
y
][
x
].
color
.
g
=
0
.
0
;
block
[
y
][
x
].
color
.
b
=
0
.
0
;
block
[
y
][
x
].
color
.
a
=
0
.
0
;
}
/* for */
/* Columns */
block
[
y
]
=
g_malloc0
((
sub_pixel_size
+
1
)
*
sizeof
(
sample_t
));
/* Render region */
...
...
@@ -152,10 +144,9 @@ adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double
/* Copy samples from top row to block */
for
(
xtt
=
0
,
xt
=
(
x
-
x1
)
*
sub_pixel_size
;
xtt
<
(
sub_pixel_size
+
1
);
xtt
++
,
xt
++
)
block
[
0
][
xtt
]
=
top_row
[
xt
];
memcpy
(
block
[
0
],
top_row
+
((
x
-
x1
)
*
sub_pixel_size
),
sizeof
(
sample_t
)
*
sub_pixel_size
);
/* Render pixel on (x, y) */
...
...
@@ -171,10 +162,9 @@ adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double
top_row
[((
x
-
x1
)
+
1
)
*
sub_pixel_size
]
=
block
[
0
][
sub_pixel_size
];
for
(
xtt
=
0
,
xt
=
(
x
-
x1
)
*
sub_pixel_size
;
xtt
<
(
sub_pixel_size
+
1
);
xtt
++
,
xt
++
)
bot_row
[
xt
]
=
block
[
sub_pixel_size
][
xtt
];
memcpy
(
bot_row
+
((
x
-
x1
)
*
sub_pixel_size
),
block
[
sub_pixel_size
],
sub_pixel_size
*
sizeof
(
sample_t
));
/* Swap first and last columns */
...
...
@@ -226,7 +216,7 @@ render_sub_pixel(int max_depth, int depth, sample_t **block,
/* Get offsets for corners */
dx1
=
(
double
)
(
x1
-
sub_pixel_size
/
2
)
/
sub_pixel_size
;
dx1
=
(
double
)
(
x1
-
sub_pixel_size
/
2
)
/
sub_pixel_size
;
dx3
=
(
double
)
(
x3
-
sub_pixel_size
/
2
)
/
sub_pixel_size
;
dy1
=
(
double
)
(
y1
-
sub_pixel_size
/
2
)
/
sub_pixel_size
;
...
...
app/gui/layers-dialog.c
View file @
03752a92
...
...
@@ -784,7 +784,8 @@ layers_dialog_update (int gimage_id)
list
=
next_item
(
list
);
layer_widget_delete
(
lw
);
}
layersD
->
layer_widgets
=
free_list
(
layersD
->
layer_widgets
);
free_list
(
layersD
->
layer_widgets
);
layersD
->
layer_widgets
=
NULL
;
if
(
!
(
gimage
=
gimage_get_ID
(
layersD
->
gimage_id
)))
return
;
...
...
app/layers_dialog.c
View file @
03752a92
...
...
@@ -784,7 +784,8 @@ layers_dialog_update (int gimage_id)
list
=
next_item
(
list
);
layer_widget_delete
(
lw
);
}
layersD
->
layer_widgets
=
free_list
(
layersD
->
layer_widgets
);
free_list
(
layersD
->
layer_widgets
);
layersD
->
layer_widgets
=
NULL
;
if
(
!
(
gimage
=
gimage_get_ID
(
layersD
->
gimage_id
)))
return
;
...
...
app/linked.h
View file @
03752a92
...
...
@@ -15,23 +15,23 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* This is compatibility stuff only... */
#ifndef __LINKED_H__
#define __LINKED_H__
typedef
struct
_link
{
void
*
data
;
struct
_link
*
next
;
}
*
link_ptr
;
#include <glib.h>
typedef
GSList
*
link_ptr
;
extern
link_ptr
alloc_list
(
void
);
extern
link_ptr
free_list
(
link_ptr
);
extern
link_ptr
add_to_list
(
link_ptr
,
void
*
);
extern
link_ptr
append_to_list
(
link_ptr
,
void
*
);
extern
link_ptr
insert_in_list
(
link_ptr
,
void
*
,
int
);
extern
link_ptr
remove_from_list
(
link_ptr
,
void
*
);
extern
link_ptr
next_item
(
link_ptr
);
extern
link_ptr
nth_item
(
link_ptr
,
int
);
extern
int
list_length
(
link_ptr
);
#define alloc_list() g_slist_alloc()
#define free_list(x) g_slist_free((x))
#define add_to_list(x, y) g_slist_prepend((x), (y))
#define append_to_list(x, y) g_slist_append((x), (y))
#define insert_in_list(x, y, z) g_slist_insert((x), (y), (z))
#define remove_from_list(x, y) g_slist_remove((x), (y))
#define next_item(x) (x)?g_slist_next((x)):NULL
#define nth_item(x, y) g_slist_nth((x), (y))
#define list_length(x) g_slist_length((x))
#endif
app/paint-funcs/paint-funcs.c
View file @
03752a92
...
...
@@ -1740,8 +1740,7 @@ combine_inten_a_and_channel_mask_pixels (unsigned char *src,
dest
[
b
]
=
new_alpha
;
}
else
for
(
b
=
0
;
b
<
bytes
;
b
++
)
dest
[
b
]
=
src
[
b
];
memcpy
(
dest
,
src
,
bytes
);
/* advance pointers */
src
+=
bytes
;
...
...
@@ -1784,8 +1783,7 @@ combine_inten_a_and_channel_selection_pixels (unsigned char *src,
dest
[
b
]
=
new_alpha
;
}
else
for
(
b
=
0
;
b
<
bytes
;
b
++
)
dest
[
b
]
=
src
[
b
];
memcpy
(
dest
,
src
,
bytes
);
/* advance pointers */
src
+=
bytes
;
...
...
@@ -3353,6 +3351,7 @@ shapeburst_region (PixelRegion *srcPR,
float
*
distp_prev
;
float
*
tmp
;
float
min_prev
;
float
float_tmp
;
int
min
;
int
min_left
;
int
length
;
...
...
@@ -3380,8 +3379,7 @@ shapeburst_region (PixelRegion *srcPR,
for
(
i
=
0
;
i
<
srcPR
->
h
;
i
++
)
{
/* set the current dist row to 0's */
for
(
j
=
0
;
j
<
length
;
j
++
)
distp_cur
[
j
-
1
]
=
0
.
0
;
memset
(
distp_cur
-
1
,
0
,
sizeof
(
float
)
*
(
length
-
1
));
for
(
j
=
0
;
j
<
srcPR
->
w
;
j
++
)
{
...
...
@@ -3442,10 +3440,10 @@ shapeburst_region (PixelRegion *srcPR,
min
++
;
}
distp_cur
[
j
]
=
min
+
fraction
/
256
.
0
;
float_tmp
=
distp_cur
[
j
]
=
min
+
fraction
/
256
.
0
;
if
(
distp_cur
[
j
]
>
max_iterations
)
max_iterations
=
distp_cur
[
j
]
;
if
(
float_tmp
>
max_iterations
)
max_iterations
=
float_tmp
;
}
/* set the dist row */
...
...
app/paint_funcs.c
View file @
03752a92
...
...
@@ -1740,8 +1740,7 @@ combine_inten_a_and_channel_mask_pixels (unsigned char *src,
dest
[
b
]
=
new_alpha
;
}
else
for
(
b
=
0
;
b
<
bytes
;
b
++
)
dest
[
b
]
=
src
[
b
];
memcpy
(
dest
,
src
,
bytes
);
/* advance pointers */
src
+=
bytes
;
...
...
@@ -1784,8 +1783,7 @@ combine_inten_a_and_channel_selection_pixels (unsigned char *src,
dest
[
b
]
=
new_alpha
;
}
else
for
(
b
=
0
;
b
<
bytes
;
b
++
)
dest
[
b
]
=
src
[
b
];
memcpy
(
dest
,
src
,
bytes
);
/* advance pointers */
src
+=
bytes
;
...
...
@@ -3353,6 +3351,7 @@ shapeburst_region (PixelRegion *srcPR,
float
*
distp_prev
;
float
*
tmp
;
float
min_prev
;
float
float_tmp
;
int
min
;
int
min_left
;
int
length
;
...
...
@@ -3380,8 +3379,7 @@ shapeburst_region (PixelRegion *srcPR,
for
(
i
=
0
;
i
<
srcPR
->
h
;
i
++
)
{
/* set the current dist row to 0's */
for
(
j
=
0
;
j
<
length
;
j
++
)
distp_cur
[
j
-
1
]
=
0
.
0
;
memset
(
distp_cur
-
1
,
0
,
sizeof
(
float
)
*
(
length
-
1
));
for
(
j
=
0
;
j
<
srcPR
->
w
;
j
++
)
{
...
...
@@ -3442,10 +3440,10 @@ shapeburst_region (PixelRegion *srcPR,
min
++
;
}
distp_cur
[
j
]
=
min
+
fraction
/
256
.
0
;
float_tmp
=
distp_cur
[
j
]
=
min
+
fraction
/
256
.
0
;
if
(
distp_cur
[
j
]
>
max_iterations
)
max_iterations
=
distp_cur
[
j
]
;
if
(
float_tmp
>
max_iterations
)
max_iterations
=
float_tmp
;
}
/* set the dist row */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment