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
aa493478
Commit
aa493478
authored
Jul 29, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Where possible directly access the DC instead of using GetCurrentObject().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d4d65e2d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
dc.c
dlls/gdi32/dc.c
+3
-3
driver.c
dlls/gdi32/driver.c
+2
-2
objects.c
dlls/gdi32/enhmfdrv/objects.c
+4
-2
font.c
dlls/gdi32/font.c
+1
-1
palette.c
dlls/gdi32/palette.c
+2
-1
No files found.
dlls/gdi32/dc.c
View file @
aa493478
...
...
@@ -354,8 +354,8 @@ void DC_UpdateXforms( DC *dc )
if
(
memcmp
(
&
oldworld2vport
,
&
dc
->
xformWorld2Vport
,
sizeof
(
oldworld2vport
))
&&
!
GdiIsMetaFileDC
(
dc
->
hSelf
))
{
SelectObject
(
dc
->
hSelf
,
GetCurrentObject
(
dc
->
hSelf
,
OBJ_FONT
)
);
SelectObject
(
dc
->
hSelf
,
GetCurrentObject
(
dc
->
hSelf
,
OBJ_PEN
)
);
SelectObject
(
dc
->
hSelf
,
dc
->
hFont
);
SelectObject
(
dc
->
hSelf
,
dc
->
hPen
);
}
}
...
...
@@ -1038,7 +1038,7 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode )
dc
->
GraphicsMode
=
mode
;
}
/* font metrics depend on the graphics mode */
if
(
ret
!=
mode
)
SelectObject
(
dc
->
hSelf
,
GetCurrentObject
(
dc
->
hSelf
,
OBJ_FONT
)
);
if
(
ret
!=
mode
)
SelectObject
(
dc
->
hSelf
,
dc
->
hFont
);
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
dlls/gdi32/driver.c
View file @
aa493478
...
...
@@ -390,9 +390,9 @@ static INT nulldrv_GetTextFace( PHYSDEV dev, INT size, LPWSTR name )
{
INT
ret
=
0
;
LOGFONTW
font
;
HFONT
hfont
=
GetCurrentObject
(
dev
->
hdc
,
OBJ_FONT
);
DC
*
dc
=
get_nulldrv_dc
(
dev
);
if
(
GetObjectW
(
hf
ont
,
sizeof
(
font
),
&
font
))
if
(
GetObjectW
(
dc
->
hF
ont
,
sizeof
(
font
),
&
font
))
{
ret
=
strlenW
(
font
.
lfFaceName
)
+
1
;
if
(
name
)
...
...
dlls/gdi32/enhmfdrv/objects.c
View file @
aa493478
...
...
@@ -463,10 +463,11 @@ found:
COLORREF
EMFDRV_SetDCBrushColor
(
PHYSDEV
dev
,
COLORREF
color
)
{
EMFDRV_PDEVICE
*
physDev
=
get_emf_physdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
EMRSELECTOBJECT
emr
;
DWORD
index
;
if
(
GetCurrentObject
(
dev
->
hdc
,
OBJ_BRUSH
)
!=
GetStockObject
(
DC_BRUSH
))
return
color
;
if
(
dc
->
hBrush
!=
GetStockObject
(
DC_BRUSH
))
return
color
;
if
(
physDev
->
dc_brush
)
DeleteObject
(
physDev
->
dc_brush
);
if
(
!
(
physDev
->
dc_brush
=
CreateSolidBrush
(
color
)))
return
CLR_INVALID
;
...
...
@@ -484,11 +485,12 @@ COLORREF EMFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color )
COLORREF
EMFDRV_SetDCPenColor
(
PHYSDEV
dev
,
COLORREF
color
)
{
EMFDRV_PDEVICE
*
physDev
=
get_emf_physdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
EMRSELECTOBJECT
emr
;
DWORD
index
;
LOGPEN
logpen
=
{
PS_SOLID
,
{
0
,
0
},
color
};
if
(
GetCurrentObject
(
dev
->
hdc
,
OBJ_PEN
)
!=
GetStockObject
(
DC_PEN
))
return
color
;
if
(
dc
->
hPen
!=
GetStockObject
(
DC_PEN
))
return
color
;
if
(
physDev
->
dc_pen
)
DeleteObject
(
physDev
->
dc_pen
);
if
(
!
(
physDev
->
dc_pen
=
CreatePenIndirect
(
&
logpen
)))
return
CLR_INVALID
;
...
...
dlls/gdi32/font.c
View file @
aa493478
...
...
@@ -2269,7 +2269,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
}
GetTextMetricsW
(
hdc
,
&
tm
);
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
)
,
sizeof
(
lf
),
&
lf
);
GetObjectW
(
dc
->
hFont
,
sizeof
(
lf
),
&
lf
);
if
(
!
(
tm
.
tmPitchAndFamily
&
TMPF_VECTOR
))
/* Non-scalable fonts shouldn't be rotated */
lf
.
lfEscapement
=
0
;
...
...
dlls/gdi32/palette.c
View file @
aa493478
...
...
@@ -503,6 +503,7 @@ UINT WINAPI GetNearestPaletteIndex(
COLORREF
nulldrv_GetNearestColor
(
PHYSDEV
dev
,
COLORREF
color
)
{
unsigned
char
spec_type
;
DC
*
dc
=
get_nulldrv_dc
(
dev
);
if
(
!
(
GetDeviceCaps
(
dev
->
hdc
,
RASTERCAPS
)
&
RC_PALETTE
))
return
color
;
...
...
@@ -512,7 +513,7 @@ COLORREF nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color )
/* we need logical palette for PALETTERGB and PALETTEINDEX colorrefs */
UINT
index
;
PALETTEENTRY
entry
;
HPALETTE
hpal
=
GetCurrentObject
(
dev
->
hdc
,
OBJ_PAL
)
;
HPALETTE
hpal
=
dc
->
hPalette
;
if
(
!
hpal
)
hpal
=
GetStockObject
(
DEFAULT_PALETTE
);
if
(
spec_type
==
2
)
/* PALETTERGB */
...
...
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