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
bb51f969
Commit
bb51f969
authored
Nov 17, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Get rid of the palette mapping handling and leave it up to the driver.
parent
719b7068
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
61 deletions
+34
-61
driver.c
dlls/gdi32/driver.c
+1
-0
init.c
dlls/gdi32/enhmfdrv/init.c
+1
-0
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
init.c
dlls/gdi32/mfdrv/init.c
+1
-0
palette.c
dlls/gdi32/palette.c
+30
-52
gdi.h
include/gdi.h
+0
-9
No files found.
dlls/gdi32/driver.c
View file @
bb51f969
...
...
@@ -193,6 +193,7 @@ static struct graphics_driver *create_driver( HMODULE module )
GET_FUNC
(
StrokeAndFillPath
);
GET_FUNC
(
StrokePath
);
GET_FUNC
(
SwapBuffers
);
GET_FUNC
(
UnrealizePalette
);
GET_FUNC
(
WidenPath
);
/* OpenGL32 */
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
bb51f969
...
...
@@ -152,6 +152,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
EMFDRV_StrokeAndFillPath
,
/* pStrokeAndFillPath */
EMFDRV_StrokePath
,
/* pStrokePath */
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
EMFDRV_WidenPath
/* pWidenPath */
};
...
...
dlls/gdi32/gdi_private.h
View file @
bb51f969
...
...
@@ -181,6 +181,7 @@ typedef struct tagDC_FUNCS
BOOL
(
*
pStrokeAndFillPath
)(
PHYSDEV
);
BOOL
(
*
pStrokePath
)(
PHYSDEV
);
BOOL
(
*
pSwapBuffers
)(
PHYSDEV
);
BOOL
(
*
pUnrealizePalette
)(
HPALETTE
);
BOOL
(
*
pWidenPath
)(
PHYSDEV
);
/* OpenGL32 */
...
...
dlls/gdi32/mfdrv/init.c
View file @
bb51f969
...
...
@@ -152,6 +152,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_StrokeAndFillPath
,
/* pStrokeAndFillPath */
MFDRV_StrokePath
,
/* pStrokePath */
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
MFDRV_WidenPath
/* pWidenPath */
};
...
...
dlls/gdi32/palette.c
View file @
bb51f969
...
...
@@ -39,6 +39,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
palette
);
typedef
struct
tagPALETTEOBJ
{
GDIOBJHDR
header
;
const
DC_FUNCTIONS
*
funcs
;
/* DC function table */
LOGPALETTE
logpalette
;
/* _MUST_ be the last field */
}
PALETTEOBJ
;
static
INT
PALETTE_GetObject
(
HGDIOBJ
handle
,
void
*
obj
,
INT
count
,
LPVOID
buffer
);
static
BOOL
PALETTE_UnrealizeObject
(
HGDIOBJ
handle
,
void
*
obj
);
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
);
...
...
@@ -62,7 +69,6 @@ static UINT SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */
static
HPALETTE
hPrimaryPalette
=
0
;
/* used for WM_PALETTECHANGED */
static
HPALETTE
hLastRealizedPalette
=
0
;
/* UnrealizeObject() needs it */
static
const
DC_FUNCTIONS
*
pLastRealizedDC
;
static
const
PALETTEENTRY
sys_pal_template
[
NB_RESERVED_COLORS
]
=
{
...
...
@@ -106,7 +112,6 @@ HPALETTE PALETTE_Init(void)
{
HPALETTE
hpalette
;
LOGPALETTE
*
palPtr
;
PALETTEOBJ
*
palObj
;
/* create default palette (20 system colors) */
...
...
@@ -119,14 +124,6 @@ HPALETTE PALETTE_Init(void)
memcpy
(
palPtr
->
palPalEntry
,
sys_pal_template
,
sizeof
(
sys_pal_template
)
);
hpalette
=
CreatePalette
(
palPtr
);
HeapFree
(
GetProcessHeap
(),
0
,
palPtr
);
palObj
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
if
(
palObj
)
{
if
(
!
(
palObj
->
mapping
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
int
)
*
NB_RESERVED_COLORS
)))
ERR
(
"Cannot create palette mapping -- out of memory!
\n
"
);
GDI_ReleaseObj
(
hpalette
);
}
return
hpalette
;
}
...
...
@@ -156,7 +153,7 @@ HPALETTE WINAPI CreatePalette(
PALETTE_MAGIC
,
(
HGDIOBJ
*
)
&
hpalette
,
&
palette_funcs
)))
return
0
;
memcpy
(
&
palettePtr
->
logpalette
,
palette
,
size
);
palettePtr
->
mapping
=
NULL
;
palettePtr
->
funcs
=
NULL
;
GDI_ReleaseObj
(
hpalette
);
TRACE
(
" returning %p
\n
"
,
hpalette
);
...
...
@@ -368,7 +365,6 @@ BOOL WINAPI ResizePalette(
PALETTEOBJ
*
palPtr
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hPal
,
PALETTE_MAGIC
);
UINT
cPrevEnt
,
prevVer
;
int
prevsize
,
size
=
sizeof
(
LOGPALETTE
)
+
(
cEntries
-
1
)
*
sizeof
(
PALETTEENTRY
);
int
*
mapping
=
NULL
;
TRACE
(
"hpal = %p, prev = %i, new = %i
\n
"
,
hPal
,
palPtr
?
palPtr
->
logpalette
.
palNumEntries
:
-
1
,
cEntries
);
...
...
@@ -378,28 +374,12 @@ BOOL WINAPI ResizePalette(
prevsize
=
sizeof
(
LOGPALETTE
)
+
(
cPrevEnt
-
1
)
*
sizeof
(
PALETTEENTRY
)
+
sizeof
(
int
*
)
+
sizeof
(
GDIOBJHDR
);
size
+=
sizeof
(
int
*
)
+
sizeof
(
GDIOBJHDR
);
mapping
=
palPtr
->
mapping
;
if
(
!
(
palPtr
=
GDI_ReallocObject
(
size
,
hPal
,
palPtr
)))
return
FALSE
;
if
(
mapping
)
{
int
*
newMap
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
mapping
,
cEntries
*
sizeof
(
int
)
);
if
(
newMap
==
NULL
)
{
ERR
(
"Cannot resize mapping -- out of memory!
\n
"
);
GDI_ReleaseObj
(
hPal
);
return
FALSE
;
}
palPtr
->
mapping
=
newMap
;
}
PALETTE_UnrealizeObject
(
hPal
,
palPtr
);
if
(
cEntries
>
cPrevEnt
)
{
if
(
mapping
)
memset
(
palPtr
->
mapping
+
cPrevEnt
,
0
,
(
cEntries
-
cPrevEnt
)
*
sizeof
(
int
));
memset
(
(
BYTE
*
)
palPtr
+
prevsize
,
0
,
size
-
prevsize
);
}
if
(
cEntries
>
cPrevEnt
)
memset
(
(
BYTE
*
)
palPtr
+
prevsize
,
0
,
size
-
prevsize
);
palPtr
->
logpalette
.
palNumEntries
=
cEntries
;
palPtr
->
logpalette
.
palVersion
=
prevVer
;
GDI_ReleaseObj
(
hPal
);
...
...
@@ -458,14 +438,10 @@ BOOL WINAPI AnimatePalette(
TRACE
(
"Not animating entry %d -- not PC_RESERVED
\n
"
,
StartIndex
);
}
}
GDI_ReleaseObj
(
hPal
);
TRACE
(
"pLastRealizedDC %p -- pLastRealizedDC->pRealizePalette %p
\n
"
,
pLastRealizedDC
,
pLastRealizedDC
?
pLastRealizedDC
->
pRealizePalette
:
0
);
if
(
palPtr
->
funcs
&&
palPtr
->
funcs
->
pRealizePalette
)
palPtr
->
funcs
->
pRealizePalette
(
NULL
,
hPal
,
hPal
==
hPrimaryPalette
);
if
(
pLastRealizedDC
&&
pLastRealizedDC
->
pRealizePalette
)
pLastRealizedDC
->
pRealizePalette
(
NULL
,
hPal
,
hPal
==
hPrimaryPalette
);
GDI_ReleaseObj
(
hPal
);
}
return
TRUE
;
}
...
...
@@ -678,14 +654,17 @@ static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj )
{
PALETTEOBJ
*
palette
=
obj
;
HeapFree
(
GetProcessHeap
(),
0
,
palette
->
mapping
);
palette
->
mapping
=
NULL
;
if
(
palette
->
funcs
)
{
if
(
palette
->
funcs
->
pUnrealizePalette
)
palette
->
funcs
->
pUnrealizePalette
(
handle
);
palette
->
funcs
=
NULL
;
}
if
(
hLastRealizedPalette
==
handle
)
{
TRACE
(
"unrealizing palette %p
\n
"
,
handle
);
hLastRealizedPalette
=
0
;
pLastRealizedDC
=
NULL
;
}
return
TRUE
;
}
...
...
@@ -696,15 +675,7 @@ static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj )
*/
static
BOOL
PALETTE_DeleteObject
(
HGDIOBJ
handle
,
void
*
obj
)
{
PALETTEOBJ
*
palette
=
obj
;
HeapFree
(
GetProcessHeap
(),
0
,
palette
->
mapping
);
if
(
hLastRealizedPalette
==
handle
)
{
TRACE
(
"unrealizing palette %p
\n
"
,
handle
);
hLastRealizedPalette
=
0
;
pLastRealizedDC
=
NULL
;
}
PALETTE_UnrealizeObject
(
handle
,
obj
);
return
GDI_FreeObject
(
handle
,
obj
);
}
...
...
@@ -758,10 +729,17 @@ UINT WINAPI GDIRealizePalette( HDC hdc )
else
if
(
dc
->
hPalette
!=
hLastRealizedPalette
)
{
if
(
dc
->
funcs
->
pRealizePalette
)
realized
=
dc
->
funcs
->
pRealizePalette
(
dc
->
physDev
,
dc
->
hPalette
,
(
dc
->
hPalette
==
hPrimaryPalette
)
);
{
PALETTEOBJ
*
palPtr
=
GDI_GetObjPtr
(
dc
->
hPalette
,
PALETTE_MAGIC
);
if
(
palPtr
)
{
realized
=
dc
->
funcs
->
pRealizePalette
(
dc
->
physDev
,
dc
->
hPalette
,
(
dc
->
hPalette
==
hPrimaryPalette
)
);
palPtr
->
funcs
=
dc
->
funcs
;
GDI_ReleaseObj
(
dc
->
hPalette
);
}
}
hLastRealizedPalette
=
dc
->
hPalette
;
pLastRealizedDC
=
dc
->
funcs
;
}
else
TRACE
(
" skipping (hLastRealizedPalette = %p)
\n
"
,
hLastRealizedPalette
);
...
...
include/gdi.h
View file @
bb51f969
...
...
@@ -66,17 +66,8 @@ typedef struct tagGDIOBJHDR
struct
hdc_list
*
hdcs
;
}
GDIOBJHDR
;
/* palette object */
#define NB_RESERVED_COLORS 20
/* number of fixed colors in system palette */
typedef
struct
tagPALETTEOBJ
{
GDIOBJHDR
header
;
int
*
mapping
;
LOGPALETTE
logpalette
;
/* _MUST_ be the last field */
}
PALETTEOBJ
;
/* GDI local heap */
extern
void
*
GDI_GetObjPtr
(
HGDIOBJ
,
WORD
);
...
...
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