Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
4d42626d
Commit
4d42626d
authored
Sep 13, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add preliminary support for pixel offset modes.
parent
556bdf24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
graphics.c
dlls/gdiplus/graphics.c
+24
-4
No files found.
dlls/gdiplus/graphics.c
View file @
4d42626d
...
...
@@ -836,7 +836,7 @@ static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT wi
static
ARGB
resample_bitmap_pixel
(
GDIPCONST
GpRect
*
src_rect
,
LPBYTE
bits
,
UINT
width
,
UINT
height
,
GpPointF
*
point
,
GDIPCONST
GpImageAttributes
*
attributes
,
InterpolationMode
interpolation
)
InterpolationMode
interpolation
,
PixelOffsetMode
offset_mode
)
{
static
int
fixme
;
...
...
@@ -881,8 +881,25 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT
return
blend_colors
(
top
,
bottom
,
point
->
Y
-
topyf
);
}
case
InterpolationModeNearestNeighbor
:
{
FLOAT
pixel_offset
;
switch
(
offset_mode
)
{
default:
case
PixelOffsetModeNone
:
case
PixelOffsetModeHighSpeed
:
pixel_offset
=
0
.
5
;
break
;
case
PixelOffsetModeHalf
:
case
PixelOffsetModeHighQuality
:
pixel_offset
=
0
.
0
;
break
;
}
return
sample_bitmap_pixel
(
src_rect
,
bits
,
width
,
height
,
gdip_round
(
point
->
X
),
gdip_round
(
point
->
Y
),
attributes
);
floorf
(
point
->
X
+
pixel_offset
),
floorf
(
point
->
Y
+
pixel_offset
),
attributes
);
}
}
}
...
...
@@ -1176,7 +1193,8 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush,
argb_pixels
[
x
+
y
*
cdwStride
]
=
resample_bitmap_pixel
(
&
src_area
,
fill
->
bitmap_bits
,
bitmap
->
width
,
bitmap
->
height
,
&
point
,
fill
->
imageattributes
,
graphics
->
interpolation
);
&
point
,
fill
->
imageattributes
,
graphics
->
interpolation
,
graphics
->
pixeloffset
);
}
}
}
...
...
@@ -3122,6 +3140,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
LPBYTE
src_data
,
dst_data
;
BitmapData
lockeddata
;
InterpolationMode
interpolation
=
graphics
->
interpolation
;
PixelOffsetMode
offset_mode
=
graphics
->
pixeloffset
;
GpPointF
dst_to_src_points
[
3
]
=
{{
0
.
0
,
0
.
0
},
{
1
.
0
,
0
.
0
},
{
0
.
0
,
1
.
0
}};
REAL
x_dx
,
x_dy
,
y_dx
,
y_dy
;
static
const
GpImageAttributes
defaultImageAttributes
=
{
WrapModeClamp
,
0
,
FALSE
};
...
...
@@ -3228,7 +3247,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
dst_color
=
(
ARGB
*
)(
dst_data
+
dst_stride
*
(
y
-
dst_area
.
top
)
+
sizeof
(
ARGB
)
*
(
x
-
dst_area
.
left
));
if
(
src_pointf
.
X
>=
srcx
&&
src_pointf
.
X
<
srcx
+
srcwidth
&&
src_pointf
.
Y
>=
srcy
&&
src_pointf
.
Y
<
srcy
+
srcheight
)
*
dst_color
=
resample_bitmap_pixel
(
&
src_area
,
src_data
,
bitmap
->
width
,
bitmap
->
height
,
&
src_pointf
,
imageAttributes
,
interpolation
);
*
dst_color
=
resample_bitmap_pixel
(
&
src_area
,
src_data
,
bitmap
->
width
,
bitmap
->
height
,
&
src_pointf
,
imageAttributes
,
interpolation
,
offset_mode
);
else
*
dst_color
=
0
;
}
...
...
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