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
3cb51cd3
Commit
3cb51cd3
authored
Nov 08, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Get rid of the DIB color table now that it's stored in gdi32.
parent
f7ffbe45
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
117 deletions
+17
-117
dib.c
dlls/winex11.drv/dib.c
+10
-108
palette.c
dlls/winex11.drv/palette.c
+7
-6
winex11.drv.spec
dlls/winex11.drv/winex11.drv.spec
+0
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-2
No files found.
dlls/winex11.drv/dib.c
View file @
3cb51cd3
...
@@ -299,11 +299,11 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
...
@@ -299,11 +299,11 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
if
(
depth
==
1
)
/* Monochrome */
if
(
depth
==
1
)
/* Monochrome */
{
{
BOOL
invert
=
FALSE
;
BOOL
invert
=
FALSE
;
if
(
physDev
&&
physDev
->
bitmap
&&
physDev
->
bitmap
->
colorTable
)
RGBQUAD
table
[
2
];
{
if
(
!
colour_is_brighter
(
physDev
->
bitmap
->
colorTable
[
1
],
physDev
->
bitmap
->
colorTable
[
0
])
)
if
(
GetDIBColorTable
(
physDev
->
hdc
,
0
,
2
,
table
)
==
2
)
invert
=
TRUE
;
invert
=
!
colour_is_brighter
(
table
[
1
],
table
[
0
])
;
}
for
(
i
=
start
;
i
<
end
;
i
++
,
rgb
++
)
for
(
i
=
start
;
i
<
end
;
i
++
,
rgb
++
)
colorMapping
[
i
]
=
((
rgb
->
rgbRed
+
rgb
->
rgbGreen
+
colorMapping
[
i
]
=
((
rgb
->
rgbRed
+
rgb
->
rgbGreen
+
rgb
->
rgbBlue
>
255
*
3
/
2
&&
!
invert
)
||
rgb
->
rgbBlue
>
255
*
3
/
2
&&
!
invert
)
||
...
@@ -323,11 +323,11 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
...
@@ -323,11 +323,11 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
if
(
depth
==
1
)
/* Monochrome */
if
(
depth
==
1
)
/* Monochrome */
{
{
BOOL
invert
=
FALSE
;
BOOL
invert
=
FALSE
;
if
(
physDev
&&
physDev
->
bitmap
&&
physDev
->
bitmap
->
colorTable
)
RGBQUAD
table
[
2
];
{
if
(
!
colour_is_brighter
(
physDev
->
bitmap
->
colorTable
[
1
],
physDev
->
bitmap
->
colorTable
[
0
])
)
if
(
GetDIBColorTable
(
physDev
->
hdc
,
0
,
2
,
table
)
==
2
)
invert
=
TRUE
;
invert
=
!
colour_is_brighter
(
table
[
1
],
table
[
0
])
;
}
for
(
i
=
start
;
i
<
end
;
i
++
,
rgb
++
)
for
(
i
=
start
;
i
<
end
;
i
++
,
rgb
++
)
colorMapping
[
i
]
=
((
rgb
->
rgbtRed
+
rgb
->
rgbtGreen
+
colorMapping
[
i
]
=
((
rgb
->
rgbtRed
+
rgb
->
rgbtGreen
+
rgb
->
rgbtBlue
>
255
*
3
/
2
&&
!
invert
)
||
rgb
->
rgbtBlue
>
255
*
3
/
2
&&
!
invert
)
||
...
@@ -403,84 +403,6 @@ static int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WO
...
@@ -403,84 +403,6 @@ static int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WO
}
}
/***********************************************************************
/***********************************************************************
* X11DRV_DIB_BuildColorTable
*
* Build the dib color table. This either keeps a copy of the bmiColors array if
* usage is DIB_RGB_COLORS, or looks up the palette indices if usage is
* DIB_PAL_COLORS.
* Should not be called for a >8-bit deep bitmap.
*/
static
RGBQUAD
*
X11DRV_DIB_BuildColorTable
(
X11DRV_PDEVICE
*
physDev
,
WORD
coloruse
,
WORD
depth
,
const
BITMAPINFO
*
info
)
{
RGBQUAD
*
colorTable
;
unsigned
int
colors
;
int
i
;
BOOL
core_info
=
info
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPCOREHEADER
);
if
(
core_info
)
{
colors
=
1
<<
((
const
BITMAPCOREINFO
*
)
info
)
->
bmciHeader
.
bcBitCount
;
}
else
{
colors
=
info
->
bmiHeader
.
biClrUsed
;
if
(
!
colors
)
colors
=
1
<<
info
->
bmiHeader
.
biBitCount
;
}
if
(
colors
>
256
)
{
ERR
(
"called with >256 colors!
\n
"
);
return
NULL
;
}
if
(
!
(
colorTable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
colors
*
sizeof
(
RGBQUAD
)
)))
return
NULL
;
if
(
coloruse
==
DIB_RGB_COLORS
)
{
if
(
core_info
)
{
/* Convert RGBTRIPLEs to RGBQUADs */
for
(
i
=
0
;
i
<
colors
;
i
++
)
{
colorTable
[
i
].
rgbRed
=
((
const
BITMAPCOREINFO
*
)
info
)
->
bmciColors
[
i
].
rgbtRed
;
colorTable
[
i
].
rgbGreen
=
((
const
BITMAPCOREINFO
*
)
info
)
->
bmciColors
[
i
].
rgbtGreen
;
colorTable
[
i
].
rgbBlue
=
((
const
BITMAPCOREINFO
*
)
info
)
->
bmciColors
[
i
].
rgbtBlue
;
colorTable
[
i
].
rgbReserved
=
0
;
}
}
else
{
memcpy
(
colorTable
,
(
const
BYTE
*
)
info
+
(
WORD
)
info
->
bmiHeader
.
biSize
,
colors
*
sizeof
(
RGBQUAD
));
}
}
else
{
HPALETTE
hpal
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_PAL
);
PALETTEENTRY
*
pal_ents
;
const
WORD
*
index
=
(
const
WORD
*
)
((
const
BYTE
*
)
info
+
(
WORD
)
info
->
bmiHeader
.
biSize
);
int
logcolors
,
entry
;
logcolors
=
GetPaletteEntries
(
hpal
,
0
,
0
,
NULL
);
pal_ents
=
HeapAlloc
(
GetProcessHeap
(),
0
,
logcolors
*
sizeof
(
*
pal_ents
));
logcolors
=
GetPaletteEntries
(
hpal
,
0
,
logcolors
,
pal_ents
);
for
(
i
=
0
;
i
<
colors
;
i
++
,
index
++
)
{
entry
=
*
index
%
logcolors
;
colorTable
[
i
].
rgbRed
=
pal_ents
[
entry
].
peRed
;
colorTable
[
i
].
rgbGreen
=
pal_ents
[
entry
].
peGreen
;
colorTable
[
i
].
rgbBlue
=
pal_ents
[
entry
].
peBlue
;
colorTable
[
i
].
rgbReserved
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
pal_ents
);
}
return
colorTable
;
}
/***********************************************************************
* X11DRV_DIB_MapColor
* X11DRV_DIB_MapColor
*/
*/
static
int
X11DRV_DIB_MapColor
(
int
*
physMap
,
int
nPhysMap
,
int
phys
,
int
oldcol
)
static
int
X11DRV_DIB_MapColor
(
int
*
physMap
,
int
nPhysMap
,
int
phys
,
int
oldcol
)
...
@@ -4663,7 +4585,6 @@ HBITMAP X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap,
...
@@ -4663,7 +4585,6 @@ HBITMAP X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap,
/* create color map */
/* create color map */
if
(
dib
.
dsBm
.
bmBitsPixel
<=
8
)
if
(
dib
.
dsBm
.
bmBitsPixel
<=
8
)
{
{
physBitmap
->
colorTable
=
X11DRV_DIB_BuildColorTable
(
physDev
,
usage
,
dib
.
dsBm
.
bmBitsPixel
,
bmi
);
physBitmap
->
colorMap
=
X11DRV_DIB_BuildColorMap
(
physDev
,
physBitmap
->
colorMap
=
X11DRV_DIB_BuildColorMap
(
physDev
,
usage
,
dib
.
dsBm
.
bmBitsPixel
,
bmi
,
usage
,
dib
.
dsBm
.
bmBitsPixel
,
bmi
,
&
physBitmap
->
nColorMap
);
&
physBitmap
->
nColorMap
);
...
@@ -4742,7 +4663,6 @@ void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib)
...
@@ -4742,7 +4663,6 @@ void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
physBitmap
->
colorMap
);
HeapFree
(
GetProcessHeap
(),
0
,
physBitmap
->
colorMap
);
HeapFree
(
GetProcessHeap
(),
0
,
physBitmap
->
colorTable
);
DeleteCriticalSection
(
&
physBitmap
->
lock
);
DeleteCriticalSection
(
&
physBitmap
->
lock
);
}
}
...
@@ -4771,7 +4691,6 @@ UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, c
...
@@ -4771,7 +4691,6 @@ UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, c
* at least for a 1 bpp dibsection
* at least for a 1 bpp dibsection
*/
*/
X11DRV_DIB_Lock
(
physBitmap
,
DIB_Status_AppMod
,
FALSE
);
X11DRV_DIB_Lock
(
physBitmap
,
DIB_Status_AppMod
,
FALSE
);
memcpy
(
physBitmap
->
colorTable
+
start
,
colors
,
(
end
-
start
)
*
sizeof
(
RGBQUAD
));
X11DRV_DIB_GenColorMap
(
physDev
,
physBitmap
->
colorMap
,
DIB_RGB_COLORS
,
X11DRV_DIB_GenColorMap
(
physDev
,
physBitmap
->
colorMap
,
DIB_RGB_COLORS
,
dib
.
dsBm
.
bmBitsPixel
,
dib
.
dsBm
.
bmBitsPixel
,
TRUE
,
colors
,
start
,
end
);
TRUE
,
colors
,
start
,
end
);
...
@@ -4781,23 +4700,6 @@ UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, c
...
@@ -4781,23 +4700,6 @@ UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, c
return
ret
;
return
ret
;
}
}
/***********************************************************************
* GetDIBColorTable (X11DRV.@)
*/
UINT
X11DRV_GetDIBColorTable
(
X11DRV_PDEVICE
*
physDev
,
UINT
start
,
UINT
count
,
RGBQUAD
*
colors
)
{
UINT
ret
=
0
;
X_PHYSBITMAP
*
physBitmap
=
physDev
->
bitmap
;
if
(
physBitmap
&&
physBitmap
->
colorTable
&&
start
<
physBitmap
->
nColorMap
)
{
if
(
start
+
count
>
physBitmap
->
nColorMap
)
count
=
physBitmap
->
nColorMap
-
start
;
memcpy
(
colors
,
physBitmap
->
colorTable
+
start
,
count
*
sizeof
(
RGBQUAD
));
ret
=
count
;
}
return
ret
;
}
/***********************************************************************
/***********************************************************************
* X11DRV_DIB_CreateDIBFromBitmap
* X11DRV_DIB_CreateDIBFromBitmap
...
...
dlls/winex11.drv/palette.c
View file @
3cb51cd3
...
@@ -843,7 +843,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
...
@@ -843,7 +843,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
switch
(
spec_type
)
switch
(
spec_type
)
{
{
case
0x10
:
/* DIBINDEX */
case
0x10
:
/* DIBINDEX */
if
(
X11DRV_GetDIBColorTable
(
physDev
,
idx
,
1
,
&
quad
)
!=
1
)
{
if
(
GetDIBColorTable
(
physDev
->
hdc
,
idx
,
1
,
&
quad
)
!=
1
)
{
WARN
(
"DIBINDEX(%x) : idx %d is out of bounds, assuming black
\n
"
,
color
,
idx
);
WARN
(
"DIBINDEX(%x) : idx %d is out of bounds, assuming black
\n
"
,
color
,
idx
);
GDI_ReleaseObj
(
hPal
);
GDI_ReleaseObj
(
hPal
);
return
0
;
return
0
;
...
@@ -877,12 +877,12 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
...
@@ -877,12 +877,12 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
if
(
physDev
&&
(
physDev
->
depth
==
1
)
)
if
(
physDev
&&
(
physDev
->
depth
==
1
)
)
{
{
int
white
=
1
;
int
white
=
1
;
RGBQUAD
table
[
2
];
GDI_ReleaseObj
(
hPal
);
GDI_ReleaseObj
(
hPal
);
if
(
physDev
->
bitmap
&&
physDev
->
bitmap
->
colorTable
)
if
(
GetDIBColorTable
(
physDev
->
hdc
,
0
,
2
,
table
)
==
2
)
{
{
if
(
!
colour_is_brighter
(
physDev
->
bitmap
->
colorTable
[
1
],
physDev
->
bitmap
->
colorTable
[
0
]))
if
(
!
colour_is_brighter
(
table
[
1
],
table
[
0
]))
white
=
0
;
white
=
0
;
}
}
return
(((
color
>>
16
)
&
0xff
)
+
return
(((
color
>>
16
)
&
0xff
)
+
((
color
>>
8
)
&
0xff
)
+
(
color
&
0xff
)
>
255
*
3
/
2
)
?
white
:
1
-
white
;
((
color
>>
8
)
&
0xff
)
+
(
color
&
0xff
)
>
255
*
3
/
2
)
?
white
:
1
-
white
;
...
@@ -937,11 +937,12 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
...
@@ -937,11 +937,12 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
if
(
physDev
&&
(
physDev
->
depth
==
1
)
)
if
(
physDev
&&
(
physDev
->
depth
==
1
)
)
{
{
int
white
=
1
;
int
white
=
1
;
RGBQUAD
table
[
2
];
GDI_ReleaseObj
(
hPal
);
GDI_ReleaseObj
(
hPal
);
if
(
physDev
->
bitmap
&&
physDev
->
bitmap
->
colorTable
)
if
(
GetDIBColorTable
(
physDev
->
hdc
,
0
,
2
,
table
)
==
2
)
{
{
if
(
!
colour_is_brighter
(
physDev
->
bitmap
->
colorTable
[
1
],
physDev
->
bitmap
->
colorT
able
[
0
]))
if
(
!
colour_is_brighter
(
table
[
1
],
t
able
[
0
]))
white
=
0
;
white
=
0
;
}
}
return
(((
color
>>
16
)
&
0xff
)
+
return
(((
color
>>
16
)
&
0xff
)
+
...
...
dlls/winex11.drv/winex11.drv.spec
View file @
3cb51cd3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
@ cdecl GetBitmapBits(long ptr long) X11DRV_GetBitmapBits
@ cdecl GetBitmapBits(long ptr long) X11DRV_GetBitmapBits
@ cdecl GetCharWidth(ptr long long ptr) X11DRV_GetCharWidth
@ cdecl GetCharWidth(ptr long long ptr) X11DRV_GetCharWidth
@ cdecl GetDCOrgEx(ptr ptr) X11DRV_GetDCOrgEx
@ cdecl GetDCOrgEx(ptr ptr) X11DRV_GetDCOrgEx
@ cdecl GetDIBColorTable(ptr long long ptr) X11DRV_GetDIBColorTable
@ cdecl GetDIBits(ptr long long long ptr ptr long) X11DRV_GetDIBits
@ cdecl GetDIBits(ptr long long long ptr ptr long) X11DRV_GetDIBits
@ cdecl GetDeviceCaps(ptr long) X11DRV_GetDeviceCaps
@ cdecl GetDeviceCaps(ptr long) X11DRV_GetDeviceCaps
@ cdecl GetDeviceGammaRamp(ptr ptr) X11DRV_GetDeviceGammaRamp
@ cdecl GetDeviceGammaRamp(ptr ptr) X11DRV_GetDeviceGammaRamp
...
...
dlls/winex11.drv/x11drv.h
View file @
3cb51cd3
...
@@ -103,7 +103,6 @@ typedef struct
...
@@ -103,7 +103,6 @@ typedef struct
XImage
*
image
;
/* cached XImage */
XImage
*
image
;
/* cached XImage */
int
*
colorMap
;
/* color map info */
int
*
colorMap
;
/* color map info */
int
nColorMap
;
int
nColorMap
;
RGBQUAD
*
colorTable
;
/* original dib color table converted to rgb values if usage was DIB_PAL_COLORS */
CRITICAL_SECTION
lock
;
/* GDI access lock */
CRITICAL_SECTION
lock
;
/* GDI access lock */
#ifdef HAVE_LIBXXSHM
#ifdef HAVE_LIBXXSHM
XShmSegmentInfo
shminfo
;
/* shared memory segment info */
XShmSegmentInfo
shminfo
;
/* shared memory segment info */
...
@@ -422,7 +421,6 @@ extern INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev,INT,BOOL);
...
@@ -422,7 +421,6 @@ extern INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev,INT,BOOL);
extern
void
X11DRV_UnlockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
BOOL
);
extern
void
X11DRV_UnlockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
BOOL
);
extern
void
X11DRV_DIB_DeleteDIBSection
(
X_PHYSBITMAP
*
physBitmap
,
DIBSECTION
*
dib
);
extern
void
X11DRV_DIB_DeleteDIBSection
(
X_PHYSBITMAP
*
physBitmap
,
DIBSECTION
*
dib
);
extern
UINT
X11DRV_GetDIBColorTable
(
X11DRV_PDEVICE
*
physDev
,
UINT
start
,
UINT
count
,
RGBQUAD
*
colors
);
extern
void
X11DRV_DIB_CopyDIBSection
(
X11DRV_PDEVICE
*
physDevSrc
,
X11DRV_PDEVICE
*
physDevDst
,
extern
void
X11DRV_DIB_CopyDIBSection
(
X11DRV_PDEVICE
*
physDevSrc
,
X11DRV_PDEVICE
*
physDevDst
,
DWORD
xSrc
,
DWORD
ySrc
,
DWORD
xDest
,
DWORD
yDest
,
DWORD
xSrc
,
DWORD
ySrc
,
DWORD
xDest
,
DWORD
yDest
,
DWORD
width
,
DWORD
height
);
DWORD
width
,
DWORD
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