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
2ac6a1bb
Commit
2ac6a1bb
authored
Oct 19, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Oct 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement SetPixel.
parent
ddbaa949
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
26 deletions
+68
-26
dc.c
dlls/gdi32/dibdrv/dc.c
+1
-1
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+1
-0
graphics.c
dlls/gdi32/dibdrv/graphics.c
+40
-0
objects.c
dlls/gdi32/dibdrv/objects.c
+0
-6
gdi_private.h
dlls/gdi32/gdi_private.h
+6
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+19
-19
palette.c
dlls/gdi32/tests/palette.c
+1
-0
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
2ac6a1bb
...
...
@@ -606,7 +606,7 @@ const struct gdi_dc_funcs dib_driver =
NULL
,
/* pSetLayout */
NULL
,
/* pSetMapMode */
NULL
,
/* pSetMapperFlags */
NULL
,
/* pSetPixel */
dibdrv_SetPixel
,
/* pSetPixel */
NULL
,
/* pSetPixelFormat */
NULL
,
/* pSetPolyFillMode */
dibdrv_SetROP2
,
/* pSetROP2 */
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
2ac6a1bb
...
...
@@ -120,6 +120,7 @@ extern HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) DECLSPEC_HIDDEN
extern
HPEN
dibdrv_SelectPen
(
PHYSDEV
dev
,
HPEN
hpen
)
DECLSPEC_HIDDEN
;
extern
COLORREF
dibdrv_SetDCBrushColor
(
PHYSDEV
dev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
COLORREF
dibdrv_SetDCPenColor
(
PHYSDEV
dev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
COLORREF
dibdrv_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
BOOL
dibdrv_StretchBlt
(
PHYSDEV
dst_dev
,
struct
bitblt_coords
*
dst
,
PHYSDEV
src_dev
,
struct
bitblt_coords
*
src
,
DWORD
rop
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
2ac6a1bb
...
...
@@ -240,3 +240,43 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
return
TRUE
;
}
/***********************************************************************
* dibdrv_SetPixel
*/
COLORREF
dibdrv_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
int
i
;
POINT
pt
;
DWORD
pixel
;
const
WINEREGION
*
clip
=
get_wine_region
(
pdev
->
clip
);
TRACE
(
"(%p, %d, %d, %08x)
\n
"
,
dev
,
x
,
y
,
color
);
pt
.
x
=
x
;
pt
.
y
=
y
;
LPtoDP
(
dev
->
hdc
,
&
pt
,
1
);
/* SetPixel doesn't do the 1bpp massaging like other fg colors */
pixel
=
get_pixel_color
(
pdev
,
color
,
FALSE
);
color
=
pdev
->
dib
.
funcs
->
pixel_to_colorref
(
&
pdev
->
dib
,
pixel
);
for
(
i
=
0
;
i
<
clip
->
numRects
;
i
++
)
{
if
(
pt_in_rect
(
clip
->
rects
+
i
,
pt
))
{
RECT
rect
;
rect
.
left
=
pt
.
x
;
rect
.
top
=
pt
.
y
;
rect
.
right
=
rect
.
left
+
1
;
rect
.
bottom
=
rect
.
top
+
1
;
pdev
->
dib
.
funcs
->
solid_rects
(
&
pdev
->
dib
,
1
,
&
rect
,
0
,
pixel
);
break
;
}
}
release_wine_region
(
pdev
->
clip
);
return
color
;
}
dlls/gdi32/dibdrv/objects.c
View file @
2ac6a1bb
...
...
@@ -259,12 +259,6 @@ static inline void order_end_points(int *s, int *e)
}
}
static
inline
BOOL
pt_in_rect
(
const
RECT
*
rect
,
const
POINT
*
pt
)
{
return
((
pt
->
x
>=
rect
->
left
)
&&
(
pt
->
x
<
rect
->
right
)
&&
(
pt
->
y
>=
rect
->
top
)
&&
(
pt
->
y
<
rect
->
bottom
));
}
#define Y_INCREASING_MASK 0x0f
#define X_INCREASING_MASK 0xc3
#define X_MAJOR_MASK 0x99
...
...
dlls/gdi32/gdi_private.h
View file @
2ac6a1bb
...
...
@@ -480,6 +480,12 @@ static inline void offset_rect( RECT *rect, int offset_x, int offset_y )
rect
->
bottom
+=
offset_y
;
}
static
inline
BOOL
pt_in_rect
(
const
RECT
*
rect
,
POINT
pt
)
{
return
((
pt
.
x
>=
rect
->
left
)
&&
(
pt
.
x
<
rect
->
right
)
&&
(
pt
.
y
>=
rect
->
top
)
&&
(
pt
.
y
<
rect
->
bottom
));
}
static
inline
void
get_bounding_rect
(
RECT
*
rect
,
int
x
,
int
y
,
int
width
,
int
height
)
{
rect
->
left
=
x
;
...
...
dlls/gdi32/tests/bitmap.c
View file @
2ac6a1bb
...
...
@@ -582,17 +582,17 @@ static void test_dibsections(void)
test_color
(
hdcmem
,
DIBINDEX
(
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
1
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
2
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
0
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
1
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
2
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
2
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
1
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
2
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
pbmi
->
bmiColors
[
0
].
rgbRed
,
pbmi
->
bmiColors
[
0
].
rgbGreen
,
pbmi
->
bmiColors
[
0
].
rgbBlue
),
c0
,
1
,
1
);
pbmi
->
bmiColors
[
0
].
rgbBlue
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
pbmi
->
bmiColors
[
1
].
rgbRed
,
pbmi
->
bmiColors
[
1
].
rgbGreen
,
pbmi
->
bmiColors
[
1
].
rgbBlue
),
c1
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0xff
,
0xff
,
0xff
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0xfe
),
c1
,
1
,
1
);
pbmi
->
bmiColors
[
1
].
rgbBlue
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0xff
,
0xff
,
0xff
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0xfe
),
c1
,
0
,
1
);
SelectObject
(
hdcmem
,
oldbm
);
DeleteObject
(
hdib
);
...
...
@@ -706,20 +706,20 @@ static void test_dibsections(void)
test_color
(
hdcmem
,
DIBINDEX
(
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
1
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
2
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
2
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
1
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
2
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTEINDEX
(
2
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
plogpal
->
palPalEntry
[
0
].
peRed
,
plogpal
->
palPalEntry
[
0
].
peGreen
,
plogpal
->
palPalEntry
[
0
].
peBlue
),
c0
,
1
,
1
);
plogpal
->
palPalEntry
[
0
].
peBlue
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
plogpal
->
palPalEntry
[
1
].
peRed
,
plogpal
->
palPalEntry
[
1
].
peGreen
,
plogpal
->
palPalEntry
[
1
].
peBlue
),
c1
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0
),
c1
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0xff
,
0xff
,
0xff
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0xfe
),
c0
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
1
,
0
),
c1
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0x3f
,
0
,
0x3f
),
c1
,
1
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0x40
,
0
,
0x40
),
c0
,
1
,
1
);
plogpal
->
palPalEntry
[
1
].
peBlue
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0xff
,
0xff
,
0xff
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0xfe
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
1
,
0
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0x3f
,
0
,
0x3f
),
c1
,
0
,
1
);
test_color
(
hdcmem
,
PALETTERGB
(
0x40
,
0
,
0x40
),
c0
,
0
,
1
);
/* Bottom and 2nd row from top green, everything else magenta */
bits
[
0
]
=
bits
[
1
]
=
0xff
;
...
...
dlls/gdi32/tests/palette.c
View file @
2ac6a1bb
...
...
@@ -109,6 +109,7 @@ static void test_DIB_PAL_COLORS(void) {
SetPixel
(
memhdc
,
0
,
0
,
setColor
);
chkColor
=
RGB
(
logpalettedata
[
3
].
peRed
,
logpalettedata
[
3
].
peGreen
,
logpalettedata
[
3
].
peBlue
);
getColor
=
GetPixel
(
memhdc
,
0
,
0
);
todo_wine
/* this will be removed with the GetPixel patch */
ok
(
getColor
==
chkColor
,
"getColor=%08X
\n
"
,
(
UINT
)
getColor
);
SelectPalette
(
memhdc
,
hpalOld
,
FALSE
);
...
...
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