Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
90c42fed
Commit
90c42fed
authored
Mar 11, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate some unnecessary direct accesses to DC internals from EMF
driver.
parent
8f82f626
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
23 deletions
+27
-23
bitblt.c
dlls/gdi/enhmfdrv/bitblt.c
+6
-6
graphics.c
dlls/gdi/enhmfdrv/graphics.c
+11
-13
mapping.c
dlls/gdi/enhmfdrv/mapping.c
+10
-4
No files found.
dlls/gdi/enhmfdrv/bitblt.c
View file @
90c42fed
...
...
@@ -85,7 +85,7 @@ static BOOL EMFDRV_BitBlockTransfer(
WORD
nBPP
;
LPBITMAPINFOHEADER
lpBmiH
;
EMFDRV_PDEVICE
*
physDevSrc
=
(
EMFDRV_PDEVICE
*
)
devSrc
;
DC
*
dcSrc
=
physDevSrc
->
dc
;
HBITMAP
hBitmap
=
GetCurrentObject
(
physDevSrc
->
hdc
,
OBJ_BITMAP
)
;
if
(
emrType
==
EMR_BITBLT
)
emrSize
=
sizeof
(
EMRBITBLT
);
...
...
@@ -94,7 +94,7 @@ static BOOL EMFDRV_BitBlockTransfer(
else
return
FALSE
;
GetObject
A
(
dcSrc
->
hBitmap
,
sizeof
(
BITMAP
),
&
BM
);
GetObject
W
(
hBitmap
,
sizeof
(
BITMAP
),
&
BM
);
nBPP
=
BM
.
bmPlanes
*
BM
.
bmBitsPixel
;
if
(
nBPP
>
8
)
nBPP
=
24
;
/* FIXME Can't get 16bpp to work for some reason */
...
...
@@ -127,7 +127,7 @@ static BOOL EMFDRV_BitBlockTransfer(
pEMR
->
xformSrc
.
eM22
=
1
.
0
;
/** Where should we */
pEMR
->
xformSrc
.
eDx
=
0
.
0
;
/** get that info */
pEMR
->
xformSrc
.
eDy
=
0
.
0
;
/** ???? */
pEMR
->
crBkColorSrc
=
dcSrc
->
backgroundColor
;
pEMR
->
crBkColorSrc
=
GetBkColor
(
physDevSrc
->
hdc
)
;
pEMR
->
iUsageSrc
=
DIB_RGB_COLORS
;
pEMR
->
offBmiSrc
=
emrSize
;
pEMR
->
cbBmiSrc
=
bmiSize
;
...
...
@@ -152,16 +152,16 @@ static BOOL EMFDRV_BitBlockTransfer(
lpBmiH
->
biCompression
=
BI_RGB
;
lpBmiH
->
biSizeImage
=
bitsSize
;
lpBmiH
->
biYPelsPerMeter
=
/* 1 meter = 39.37 inch */
MulDiv
(
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSX
),
3937
,
100
);
MulDiv
(
GetDeviceCaps
(
physDevSrc
->
hdc
,
LOGPIXELSX
),
3937
,
100
);
lpBmiH
->
biXPelsPerMeter
=
MulDiv
(
GetDeviceCaps
(
dcSrc
->
hSelf
,
LOGPIXELSY
),
3937
,
100
);
MulDiv
(
GetDeviceCaps
(
physDevSrc
->
hdc
,
LOGPIXELSY
),
3937
,
100
);
lpBmiH
->
biClrUsed
=
nBPP
<=
8
?
1
<<
nBPP
:
0
;
/* Set biClrImportant to 0, indicating that all of the
device colors are important. */
lpBmiH
->
biClrImportant
=
0
;
/* Initiliaze bitmap bits */
if
(
GetDIBits
(
dcSrc
->
hSelf
,
dcSrc
->
hBitmap
,
0
,
(
UINT
)
lpBmiH
->
biHeight
,
if
(
GetDIBits
(
physDevSrc
->
hdc
,
hBitmap
,
0
,
(
UINT
)
lpBmiH
->
biHeight
,
(
BYTE
*
)
pEMR
+
pEMR
->
offBitsSrc
,
(
LPBITMAPINFO
)
lpBmiH
,
DIB_RGB_COLORS
))
{
...
...
dlls/gdi/enhmfdrv/graphics.c
View file @
90c42fed
...
...
@@ -52,10 +52,10 @@ EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y)
BOOL
EMFDRV_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
POINT
pt
;
EMRLINETO
emr
;
RECTL
bounds
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
emr
.
emr
.
iType
=
EMR_LINETO
;
emr
.
emr
.
nSize
=
sizeof
(
emr
);
...
...
@@ -65,10 +65,12 @@ EMFDRV_LineTo( PHYSDEV dev, INT x, INT y )
if
(
!
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
))
return
FALSE
;
bounds
.
left
=
min
(
x
,
dc
->
CursPosX
);
bounds
.
top
=
min
(
y
,
dc
->
CursPosY
);
bounds
.
right
=
max
(
x
,
dc
->
CursPosX
);
bounds
.
bottom
=
max
(
y
,
dc
->
CursPosY
);
GetCurrentPositionEx
(
physDev
->
hdc
,
&
pt
);
bounds
.
left
=
min
(
x
,
pt
.
x
);
bounds
.
top
=
min
(
y
,
pt
.
y
);
bounds
.
right
=
max
(
x
,
pt
.
x
);
bounds
.
bottom
=
max
(
y
,
pt
.
y
);
EMFDRV_UpdateBBox
(
dev
,
&
bounds
);
...
...
@@ -89,14 +91,13 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
EMRARC
emr
;
RECTL
bounds
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
if
(
left
==
right
||
top
==
bottom
)
return
FALSE
;
if
(
left
>
right
)
{
temp
=
left
;
left
=
right
;
right
=
temp
;}
if
(
top
>
bottom
)
{
temp
=
top
;
top
=
bottom
;
bottom
=
temp
;}
if
(
dc
->
GraphicsMode
==
GM_COMPATIBLE
)
{
if
(
GetGraphicsMode
(
physDev
->
hdc
)
==
GM_COMPATIBLE
)
{
right
--
;
bottom
--
;
}
...
...
@@ -224,7 +225,6 @@ EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
EMRELLIPSE
emr
;
INT
temp
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
TRACE
(
"%d,%d - %d,%d
\n
"
,
left
,
top
,
right
,
bottom
);
...
...
@@ -233,7 +233,7 @@ EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
if
(
left
>
right
)
{
temp
=
left
;
left
=
right
;
right
=
temp
;}
if
(
top
>
bottom
)
{
temp
=
top
;
top
=
bottom
;
bottom
=
temp
;}
if
(
dc
->
GraphicsMode
==
GM_COMPATIBLE
)
{
if
(
GetGraphicsMode
(
physDev
->
hdc
)
==
GM_COMPATIBLE
)
{
right
--
;
bottom
--
;
}
...
...
@@ -258,7 +258,6 @@ EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
EMRRECTANGLE
emr
;
INT
temp
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
TRACE
(
"%d,%d - %d,%d
\n
"
,
left
,
top
,
right
,
bottom
);
...
...
@@ -267,7 +266,7 @@ EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
if
(
left
>
right
)
{
temp
=
left
;
left
=
right
;
right
=
temp
;}
if
(
top
>
bottom
)
{
temp
=
top
;
top
=
bottom
;
bottom
=
temp
;}
if
(
dc
->
GraphicsMode
==
GM_COMPATIBLE
)
{
if
(
GetGraphicsMode
(
physDev
->
hdc
)
==
GM_COMPATIBLE
)
{
right
--
;
bottom
--
;
}
...
...
@@ -293,14 +292,13 @@ EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
EMRROUNDRECT
emr
;
INT
temp
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
if
(
left
==
right
||
top
==
bottom
)
return
FALSE
;
if
(
left
>
right
)
{
temp
=
left
;
left
=
right
;
right
=
temp
;}
if
(
top
>
bottom
)
{
temp
=
top
;
top
=
bottom
;
bottom
=
temp
;}
if
(
dc
->
GraphicsMode
==
GM_COMPATIBLE
)
{
if
(
GetGraphicsMode
(
physDev
->
hdc
)
==
GM_COMPATIBLE
)
{
right
--
;
bottom
--
;
}
...
...
dlls/gdi/enhmfdrv/mapping.c
View file @
90c42fed
...
...
@@ -133,26 +133,32 @@ BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode)
INT
EMFDRV_OffsetViewportOrg
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
POINT
pt
;
EMRSETVIEWPORTORGEX
emr
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
GetViewportOrgEx
(
physDev
->
hdc
,
&
pt
);
emr
.
emr
.
iType
=
EMR_SETVIEWPORTORGEX
;
emr
.
emr
.
nSize
=
sizeof
(
emr
);
emr
.
ptlOrigin
.
x
=
p
hysDev
->
dc
->
vportOrgX
+
x
;
emr
.
ptlOrigin
.
y
=
p
hysDev
->
dc
->
vportOrgY
+
y
;
emr
.
ptlOrigin
.
x
=
p
t
.
x
+
x
;
emr
.
ptlOrigin
.
y
=
p
t
.
y
+
y
;
return
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
);
}
INT
EMFDRV_OffsetWindowOrg
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
POINT
pt
;
EMRSETWINDOWORGEX
emr
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
GetWindowOrgEx
(
physDev
->
hdc
,
&
pt
);
emr
.
emr
.
iType
=
EMR_SETWINDOWORGEX
;
emr
.
emr
.
nSize
=
sizeof
(
emr
);
emr
.
ptlOrigin
.
x
=
p
hysDev
->
dc
->
wndOrgX
+
x
;
emr
.
ptlOrigin
.
y
=
p
hysDev
->
dc
->
wndOrgY
+
y
;
emr
.
ptlOrigin
.
x
=
p
t
.
x
+
x
;
emr
.
ptlOrigin
.
y
=
p
t
.
y
+
y
;
return
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
);
}
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