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
f6c7e96a
Commit
f6c7e96a
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 GetPixel.
parent
70be58c1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
27 deletions
+50
-27
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
+23
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+25
-25
palette.c
dlls/gdi32/tests/palette.c
+0
-1
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
f6c7e96a
...
...
@@ -554,7 +554,7 @@ const struct gdi_dc_funcs dib_driver =
NULL
,
/* pGetICMProfile */
dibdrv_GetImage
,
/* pGetImage */
NULL
,
/* pGetNearestColor */
NULL
,
/* pGetPixel */
dibdrv_GetPixel
,
/* pGetPixel */
NULL
,
/* pGetPixelFormat */
NULL
,
/* pGetSystemPaletteEntries */
NULL
,
/* pGetTextExtentExPoint */
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
f6c7e96a
...
...
@@ -106,6 +106,7 @@ extern DWORD dibdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct g
struct
bitblt_coords
*
src
,
struct
bitblt_coords
*
dst
,
BLENDFUNCTION
func
)
DECLSPEC_HIDDEN
;
extern
DWORD
dibdrv_GetImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
DECLSPEC_HIDDEN
;
extern
COLORREF
dibdrv_GetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
extern
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
extern
BOOL
dibdrv_PatBlt
(
PHYSDEV
dev
,
struct
bitblt_coords
*
dst
,
DWORD
rop
)
DECLSPEC_HIDDEN
;
extern
BOOL
dibdrv_PaintRgn
(
PHYSDEV
dev
,
HRGN
hrgn
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
f6c7e96a
...
...
@@ -57,6 +57,29 @@ static RECT get_device_rect( HDC hdc, int left, int top, int right, int bottom,
}
/***********************************************************************
* dibdrv_GetPixel
*/
COLORREF
dibdrv_GetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
POINT
pt
;
DWORD
pixel
;
TRACE
(
"(%p, %d, %d)
\n
"
,
dev
,
x
,
y
);
pt
.
x
=
x
;
pt
.
y
=
y
;
LPtoDP
(
dev
->
hdc
,
&
pt
,
1
);
if
(
pt
.
x
<
0
||
pt
.
x
>=
pdev
->
dib
.
width
||
pt
.
y
<
0
||
pt
.
y
>=
pdev
->
dib
.
height
)
return
CLR_INVALID
;
pixel
=
pdev
->
dib
.
funcs
->
get_pixel
(
&
pdev
->
dib
,
&
pt
);
return
pdev
->
dib
.
funcs
->
pixel_to_colorref
(
&
pdev
->
dib
,
pixel
);
}
/***********************************************************************
* dibdrv_LineTo
*/
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
...
...
dlls/gdi32/tests/bitmap.c
View file @
f6c7e96a
...
...
@@ -580,19 +580,19 @@ static void test_dibsections(void)
c0
=
RGB
(
pbmi
->
bmiColors
[
0
].
rgbRed
,
pbmi
->
bmiColors
[
0
].
rgbGreen
,
pbmi
->
bmiColors
[
0
].
rgbBlue
);
c1
=
RGB
(
pbmi
->
bmiColors
[
1
].
rgbRed
,
pbmi
->
bmiColors
[
1
].
rgbGreen
,
pbmi
->
bmiColors
[
1
].
rgbBlue
);
test_color
(
hdcmem
,
DIBINDEX
(
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
1
),
c1
,
0
,
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
,
DIBINDEX
(
0
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
DIBINDEX
(
1
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
DIBINDEX
(
2
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTEINDEX
(
0
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTEINDEX
(
1
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTEINDEX
(
2
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
pbmi
->
bmiColors
[
0
].
rgbRed
,
pbmi
->
bmiColors
[
0
].
rgbGreen
,
pbmi
->
bmiColors
[
0
].
rgbBlue
),
c0
,
0
,
1
);
pbmi
->
bmiColors
[
0
].
rgbBlue
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
pbmi
->
bmiColors
[
1
].
rgbRed
,
pbmi
->
bmiColors
[
1
].
rgbGreen
,
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
);
pbmi
->
bmiColors
[
1
].
rgbBlue
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0xff
,
0xff
,
0xff
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0xfe
),
c1
,
0
,
0
);
SelectObject
(
hdcmem
,
oldbm
);
DeleteObject
(
hdib
);
...
...
@@ -704,22 +704,22 @@ static void test_dibsections(void)
c0
=
RGB
(
plogpal
->
palPalEntry
[
0
].
peRed
,
plogpal
->
palPalEntry
[
0
].
peGreen
,
plogpal
->
palPalEntry
[
0
].
peBlue
);
c1
=
RGB
(
plogpal
->
palPalEntry
[
1
].
peRed
,
plogpal
->
palPalEntry
[
1
].
peGreen
,
plogpal
->
palPalEntry
[
1
].
peBlue
);
test_color
(
hdcmem
,
DIBINDEX
(
0
),
c0
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
1
),
c1
,
0
,
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
,
0
,
1
);
test_color
(
hdcmem
,
DIBINDEX
(
0
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
DIBINDEX
(
1
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
DIBINDEX
(
2
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTEINDEX
(
0
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTEINDEX
(
1
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
PALETTEINDEX
(
2
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
plogpal
->
palPalEntry
[
0
].
peRed
,
plogpal
->
palPalEntry
[
0
].
peGreen
,
plogpal
->
palPalEntry
[
0
].
peBlue
),
c0
,
0
,
1
);
plogpal
->
palPalEntry
[
0
].
peBlue
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
plogpal
->
palPalEntry
[
1
].
peRed
,
plogpal
->
palPalEntry
[
1
].
peGreen
,
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
);
plogpal
->
palPalEntry
[
1
].
peBlue
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0xff
,
0xff
,
0xff
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
0
,
0xfe
),
c0
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0
,
1
,
0
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0x3f
,
0
,
0x3f
),
c1
,
0
,
0
);
test_color
(
hdcmem
,
PALETTERGB
(
0x40
,
0
,
0x40
),
c0
,
0
,
0
);
/* Bottom and 2nd row from top green, everything else magenta */
bits
[
0
]
=
bits
[
1
]
=
0xff
;
...
...
dlls/gdi32/tests/palette.c
View file @
f6c7e96a
...
...
@@ -109,7 +109,6 @@ 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