Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
6ada6367
Commit
6ada6367
authored
Mar 05, 2017
by
Dmitry Timoshkov
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Remove ceilf/floorf calls from bilinear scaler. (v2)
This improves performance by about 55%.
parent
ea4f8f13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
graphics.c
dlls/gdiplus/graphics.c
+12
-7
No files found.
dlls/gdiplus/graphics.c
View file @
6ada6367
...
@@ -605,7 +605,7 @@ static ARGB blend_colors(ARGB start, ARGB end, REAL position)
...
@@ -605,7 +605,7 @@ static ARGB blend_colors(ARGB start, ARGB end, REAL position)
INT
start_a
,
end_a
,
final_a
;
INT
start_a
,
end_a
,
final_a
;
INT
pos
;
INT
pos
;
pos
=
gdip_round
(
position
*
0xf
f
);
pos
=
(
INT
)(
position
*
255
.
0
f
+
0
.
5
f
);
start_a
=
((
start
>>
24
)
&
0xff
)
*
(
pos
^
0xff
);
start_a
=
((
start
>>
24
)
&
0xff
)
*
(
pos
^
0xff
);
end_a
=
((
end
>>
24
)
&
0xff
)
*
pos
;
end_a
=
((
end
>>
24
)
&
0xff
)
*
pos
;
...
@@ -1011,6 +1011,11 @@ static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT wi
...
@@ -1011,6 +1011,11 @@ static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT wi
return
((
DWORD
*
)(
bits
))[(
x
-
src_rect
->
X
)
+
(
y
-
src_rect
->
Y
)
*
src_rect
->
Width
];
return
((
DWORD
*
)(
bits
))[(
x
-
src_rect
->
X
)
+
(
y
-
src_rect
->
Y
)
*
src_rect
->
Width
];
}
}
static
FORCEINLINE
int
positive_ceilf
(
float
f
)
{
return
f
-
(
int
)
f
>
0
.
0
f
?
f
+
1
.
0
f
:
f
;
}
static
ARGB
resample_bitmap_pixel
(
GDIPCONST
GpRect
*
src_rect
,
LPBYTE
bits
,
UINT
width
,
static
ARGB
resample_bitmap_pixel
(
GDIPCONST
GpRect
*
src_rect
,
LPBYTE
bits
,
UINT
width
,
UINT
height
,
GpPointF
*
point
,
GDIPCONST
GpImageAttributes
*
attributes
,
UINT
height
,
GpPointF
*
point
,
GDIPCONST
GpImageAttributes
*
attributes
,
InterpolationMode
interpolation
,
PixelOffsetMode
offset_mode
)
InterpolationMode
interpolation
,
PixelOffsetMode
offset_mode
)
...
@@ -1031,12 +1036,12 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT
...
@@ -1031,12 +1036,12 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT
ARGB
top
,
bottom
;
ARGB
top
,
bottom
;
float
x_offset
;
float
x_offset
;
leftx
f
=
floorf
(
point
->
X
)
;
leftx
=
(
INT
)
point
->
X
;
leftx
=
(
INT
)
leftxf
;
leftx
f
=
(
REAL
)
leftx
;
rightx
=
(
INT
)
ceilf
(
point
->
X
);
rightx
=
positive_
ceilf
(
point
->
X
);
topy
f
=
floorf
(
point
->
Y
)
;
topy
=
(
INT
)
point
->
Y
;
topy
=
(
INT
)
topyf
;
topy
f
=
(
REAL
)
topy
;
bottomy
=
(
INT
)
ceilf
(
point
->
Y
);
bottomy
=
positive_
ceilf
(
point
->
Y
);
if
(
leftx
==
rightx
&&
topy
==
bottomy
)
if
(
leftx
==
rightx
&&
topy
==
bottomy
)
return
sample_bitmap_pixel
(
src_rect
,
bits
,
width
,
height
,
return
sample_bitmap_pixel
(
src_rect
,
bits
,
width
,
height
,
...
...
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