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
a45df5d9
Commit
a45df5d9
authored
May 19, 2003
by
Huw Davies
Committed by
Alexandre Julliard
May 19, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework clipping so that the PS clip path is only set just before any
graphics output event. Doing it this way means we don't ever need to call initclip which is a Good Thing.
parent
11d09a83
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
194 additions
and
47 deletions
+194
-47
bitblt.c
dlls/wineps/bitblt.c
+4
-0
bitmap.c
dlls/wineps/bitmap.c
+66
-11
brush.c
dlls/wineps/brush.c
+5
-3
clipping.c
dlls/wineps/clipping.c
+34
-3
graphics.c
dlls/wineps/graphics.c
+66
-21
ps.c
dlls/wineps/ps.c
+11
-6
psdrv.h
dlls/wineps/psdrv.h
+5
-3
text.c
dlls/wineps/text.c
+3
-0
No files found.
dlls/wineps/bitblt.c
View file @
a45df5d9
...
...
@@ -41,10 +41,12 @@ BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, D
switch
(
dwRop
)
{
case
PATCOPY
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteRectangle
(
physDev
,
pt
[
0
].
x
,
pt
[
0
].
y
,
pt
[
1
].
x
-
pt
[
0
].
x
,
pt
[
1
].
y
-
pt
[
0
].
y
);
PSDRV_Brush
(
physDev
,
FALSE
);
PSDRV_WriteGRestore
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
case
BLACKNESS
:
...
...
@@ -52,6 +54,7 @@ BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, D
{
PSCOLOR
pscol
;
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteRectangle
(
physDev
,
pt
[
0
].
x
,
pt
[
0
].
y
,
pt
[
1
].
x
-
pt
[
0
].
x
,
pt
[
1
].
y
-
pt
[
0
].
y
);
PSDRV_CreateColor
(
physDev
,
&
pscol
,
(
dwRop
==
BLACKNESS
)
?
...
...
@@ -59,6 +62,7 @@ BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, D
PSDRV_WriteSetColor
(
physDev
,
&
pscol
);
PSDRV_WriteFill
(
physDev
);
PSDRV_WriteGRestore
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
default:
...
...
dlls/wineps/bitmap.c
View file @
a45df5d9
...
...
@@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include "psdrv.h"
#include "winbase.h"
#include "wine/debug.h"
...
...
@@ -147,7 +149,57 @@ static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *inf
}
PSDRV_WriteImageDict
(
physDev
,
info
->
bmiHeader
.
biBitCount
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
,
NULL
);
widthDst
,
heightDst
,
widthSrc
,
heightSrc
,
NULL
,
FALSE
);
return
TRUE
;
}
/***************************************************************************
* PSDRV_WriteImageMaskHeader
*
* Helper for PSDRV_StretchDIBits
*
* We use the imagemask operator for 1bpp bitmaps since the output
* takes much less time for the printer to render.
*
* BUGS
* Uses level 2 PostScript
*/
static
BOOL
PSDRV_WriteImageMaskHeader
(
PSDRV_PDEVICE
*
physDev
,
const
BITMAPINFO
*
info
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
widthSrc
,
INT
heightSrc
)
{
COLORREF
map
[
2
];
PSCOLOR
bkgnd
,
foregnd
;
int
i
;
assert
(
info
->
bmiHeader
.
biBitCount
==
1
);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
map
[
i
]
=
info
->
bmiColors
[
i
].
rgbRed
|
info
->
bmiColors
[
i
].
rgbGreen
<<
8
|
info
->
bmiColors
[
i
].
rgbBlue
<<
16
;
}
/* We'll write the mask with -ve polarity so that
the foregnd color corresponds to a bit equal to
0 in the bitmap.
*/
PSDRV_CreateColor
(
physDev
,
&
foregnd
,
map
[
0
]);
PSDRV_CreateColor
(
physDev
,
&
bkgnd
,
map
[
1
]);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteNewPath
(
physDev
);
PSDRV_WriteRectangle
(
physDev
,
xDst
,
yDst
,
widthDst
,
heightDst
);
PSDRV_WriteSetColor
(
physDev
,
&
bkgnd
);
PSDRV_WriteFill
(
physDev
);
PSDRV_WriteGRestore
(
physDev
);
PSDRV_WriteSetColor
(
physDev
,
&
foregnd
);
PSDRV_WriteImageDict
(
physDev
,
1
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
,
NULL
,
TRUE
);
return
TRUE
;
}
...
...
@@ -180,8 +232,8 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
widthbytes
=
get_dib_width_bytes
(
fullSrcWidth
,
bpp
);
TRACE
(
"full size=%ldx%ld bpp=%d compression=%d
\n
"
,
fullSrcWidth
,
fullSrcHeight
,
bpp
,
compression
);
TRACE
(
"full size=%ldx%ld bpp=%d compression=%d
rop=%08lx
\n
"
,
fullSrcWidth
,
fullSrcHeight
,
bpp
,
compression
,
dwRop
);
if
(
compression
!=
BI_RGB
)
{
...
...
@@ -202,9 +254,12 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
switch
(
bpp
)
{
case
1
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteImageHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
/* Use imagemask rather than image */
PSDRV_WriteImageMaskHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
ptr
=
bits
;
ptr
+=
(
ySrc
*
widthbytes
);
if
(
xSrc
&
7
)
...
...
@@ -214,6 +269,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
break
;
case
4
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteImageHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
...
...
@@ -226,6 +282,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
break
;
case
8
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteImageHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
...
...
@@ -237,6 +294,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
case
15
:
case
16
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteImageHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
...
...
@@ -248,6 +306,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
break
;
case
24
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteImageHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
...
...
@@ -259,6 +318,7 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
break
;
case
32
:
PSDRV_SetClip
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteImageHeader
(
physDev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
...
...
@@ -276,11 +336,6 @@ INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDs
}
PSDRV_WriteSpool
(
physDev
,
">
\n
"
,
2
);
/* End-of-Data for /HexASCIIDecodeFilter */
PSDRV_WriteGRestore
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
dlls/wineps/brush.c
View file @
a45df5d9
...
...
@@ -145,19 +145,20 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
switch
(
logbrush
.
lbStyle
)
{
case
BS_SOLID
:
PSDRV_SetBrush
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_SetBrush
(
physDev
);
PSDRV_Fill
(
physDev
,
EO
);
PSDRV_WriteGRestore
(
physDev
);
break
;
case
BS_HATCHED
:
PSDRV_WriteGSave
(
physDev
);
PSDRV_SetBrush
(
physDev
);
switch
(
logbrush
.
lbHatch
)
{
case
HS_VERTICAL
:
case
HS_CROSS
:
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_Clip
(
physDev
,
EO
);
PSDRV_WriteHatch
(
physDev
);
PSDRV_WriteStroke
(
physDev
);
...
...
@@ -167,7 +168,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
/* else fallthrough for HS_CROSS */
case
HS_HORIZONTAL
:
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteGSave
(
physDev
);
PSDRV_Clip
(
physDev
,
EO
);
PSDRV_WriteRotate
(
physDev
,
90
.
0
);
PSDRV_WriteHatch
(
physDev
);
...
...
@@ -201,6 +202,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
ret
=
FALSE
;
break
;
}
PSDRV_WriteGRestore
(
physDev
);
break
;
case
BS_NULL
:
...
...
dlls/wineps/clipping.c
View file @
a45df5d9
...
...
@@ -29,6 +29,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
*/
VOID
PSDRV_SetDeviceClipping
(
PSDRV_PDEVICE
*
physDev
,
HRGN
ignored
)
{
/* We could set a dirty flag here to speed up PSDRV_SetClip */
return
;
}
/***********************************************************************
* PSDRV_SetClip
*
* The idea here is that every graphics operation should bracket
* output in PSDRV_SetClip/ResetClip calls. The clip path outside
* these calls will be empty; the reason for this is that it is
* impossible in PostScript to cleanly make the clip path larger than
* the current one. Also Photoshop assumes that despite having set a
* small clip area in the printer dc that it can still write raw
* PostScript to the driver and expect this code not to be clipped.
*/
void
PSDRV_SetClip
(
PSDRV_PDEVICE
*
physDev
)
{
CHAR
szArrayName
[]
=
"clippath"
;
DWORD
size
;
RGNDATA
*
rgndata
=
NULL
;
...
...
@@ -39,9 +56,6 @@ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored )
empty
=
!
GetClipRgn
(
physDev
->
hdc
,
hrgn
);
/* We really shouldn't be using initclip */
PSDRV_WriteInitClip
(
physDev
);
if
(
!
empty
)
{
size
=
GetRegionData
(
hrgn
,
0
,
NULL
);
if
(
!
size
)
{
...
...
@@ -57,6 +71,8 @@ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN ignored )
GetRegionData
(
hrgn
,
size
,
rgndata
);
PSDRV_WriteGSave
(
physDev
);
/* check for NULL region */
if
(
rgndata
->
rdh
.
nCount
==
0
)
{
...
...
@@ -97,3 +113,18 @@ end:
if
(
rgndata
)
HeapFree
(
GetProcessHeap
(),
0
,
rgndata
);
DeleteObject
(
hrgn
);
}
/***********************************************************************
* PSDRV_ResetClip
*/
void
PSDRV_ResetClip
(
PSDRV_PDEVICE
*
physDev
)
{
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
BOOL
empty
;
empty
=
!
GetClipRgn
(
physDev
->
hdc
,
hrgn
);
if
(
!
empty
)
PSDRV_WriteGRestore
(
physDev
);
DeleteObject
(
hrgn
);
}
dlls/wineps/graphics.c
View file @
a45df5d9
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
#if defined(HAVE_FLOAT_H)
...
...
@@ -34,6 +35,19 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
/***********************************************************************
* PSDRV_DrawLine
*/
static
void
PSDRV_DrawLine
(
PSDRV_PDEVICE
*
physDev
)
{
if
(
physDev
->
pathdepth
)
return
;
if
(
physDev
->
pen
.
style
==
PS_NULL
)
PSDRV_WriteNewPath
(
physDev
);
else
PSDRV_WriteStroke
(
physDev
);
}
/***********************************************************************
* PSDRV_LineTo
...
...
@@ -50,9 +64,12 @@ BOOL PSDRV_LineTo(PSDRV_PDEVICE *physDev, INT x, INT y)
LPtoDP
(
physDev
->
hdc
,
pt
,
2
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
PSDRV_WriteMoveTo
(
physDev
,
pt
[
0
].
x
,
pt
[
0
].
y
);
PSDRV_WriteLineTo
(
physDev
,
pt
[
1
].
x
,
pt
[
1
].
y
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -73,11 +90,23 @@ BOOL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT
rect
.
bottom
=
bottom
;
LPtoDP
(
physDev
->
hdc
,
(
POINT
*
)
&
rect
,
2
);
/* HACK to get inserted eps files printing from Office 2k */
if
(
GetROP2
(
physDev
->
hdc
)
==
R2_NOP
)
{
char
buf
[
256
];
sprintf
(
buf
,
"%ld %ld %ld %ld B
\n
"
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
rect
.
left
,
rect
.
top
);
PSDRV_WriteSpool
(
physDev
,
buf
,
strlen
(
buf
));
return
TRUE
;
}
PSDRV_WriteSpool
(
physDev
,
"%Rectangle
\n
"
,
11
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
PSDRV_WriteRectangle
(
physDev
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
);
PSDRV_Brush
(
physDev
,
0
);
PSDRV_SetPen
(
physDev
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -112,6 +141,10 @@ BOOL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
if
(
ell_width
>
right
-
left
)
ell_width
=
right
-
left
;
if
(
ell_height
>
bottom
-
top
)
ell_height
=
bottom
-
top
;
PSDRV_WriteSpool
(
physDev
,
"%RoundRect
\n
"
,
11
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
PSDRV_WriteMoveTo
(
physDev
,
left
,
top
+
ell_height
/
2
);
PSDRV_WriteArc
(
physDev
,
left
+
ell_width
/
2
,
top
+
ell_height
/
2
,
ell_width
,
ell_height
,
90
.
0
,
180
.
0
);
...
...
@@ -127,8 +160,8 @@ BOOL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
PSDRV_WriteClosePath
(
physDev
);
PSDRV_Brush
(
physDev
,
0
);
PSDRV_SetPen
(
physDev
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -176,6 +209,10 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
start_angle
*=
180
.
0
/
PI
;
end_angle
*=
180
.
0
/
PI
;
PSDRV_WriteSpool
(
physDev
,
"%DrawArc
\n
"
,
9
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
if
(
lines
==
2
)
/* pie */
PSDRV_WriteMoveTo
(
physDev
,
x
,
y
);
else
...
...
@@ -186,8 +223,9 @@ static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
PSDRV_WriteClosePath
(
physDev
);
PSDRV_Brush
(
physDev
,
0
);
}
PSDRV_SetPen
(
physDev
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -242,12 +280,16 @@ BOOL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bo
w
=
rect
.
right
-
rect
.
left
;
h
=
rect
.
bottom
-
rect
.
top
;
PSDRV_WriteSpool
(
physDev
,
"%Ellipse
\n
"
,
9
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
PSDRV_WriteNewPath
(
physDev
);
PSDRV_WriteArc
(
physDev
,
x
,
y
,
w
,
h
,
0
.
0
,
360
.
0
);
PSDRV_WriteClosePath
(
physDev
);
PSDRV_Brush
(
physDev
,
0
);
PSDRV_SetPen
(
physDev
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -269,6 +311,11 @@ BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD*
LPtoDP
(
physDev
->
hdc
,
dev_pts
,
total
);
pt
=
dev_pts
;
PSDRV_WriteSpool
(
physDev
,
"%PolyPolyline
\n
"
,
14
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
for
(
polyline
=
0
;
polyline
<
polylines
;
polyline
++
)
{
PSDRV_WriteMoveTo
(
physDev
,
pt
->
x
,
pt
->
y
);
pt
++
;
...
...
@@ -276,8 +323,9 @@ BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD*
PSDRV_WriteLineTo
(
physDev
,
pt
->
x
,
pt
->
y
);
}
HeapFree
(
GetProcessHeap
(),
0
,
dev_pts
);
PSDRV_SetPen
(
physDev
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -308,6 +356,11 @@ BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* cou
LPtoDP
(
physDev
->
hdc
,
dev_pts
,
total
);
pt
=
dev_pts
;
PSDRV_WriteSpool
(
physDev
,
"%PolyPolygon
\n
"
,
13
);
PSDRV_SetPen
(
physDev
);
PSDRV_SetClip
(
physDev
);
for
(
polygon
=
0
;
polygon
<
polygons
;
polygon
++
)
{
PSDRV_WriteMoveTo
(
physDev
,
pt
->
x
,
pt
->
y
);
pt
++
;
...
...
@@ -321,8 +374,9 @@ BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* cou
PSDRV_Brush
(
physDev
,
1
);
else
/* WINDING */
PSDRV_Brush
(
physDev
,
0
);
PSDRV_SetPen
(
physDev
);
PSDRV_DrawLine
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
TRUE
;
}
...
...
@@ -348,24 +402,15 @@ COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color )
pt
.
y
=
y
;
LPtoDP
(
physDev
->
hdc
,
&
pt
,
1
);
PSDRV_SetClip
(
physDev
);
/* we bracket the setcolor in gsave/grestore so that we don't trash
the current pen colour */
PSDRV_WriteGSave
(
physDev
);
PSDRV_WriteRectangle
(
physDev
,
pt
.
x
,
pt
.
y
,
0
,
0
);
PSDRV_CreateColor
(
physDev
,
&
pscolor
,
color
);
PSDRV_WriteSetColor
(
physDev
,
&
pscolor
);
PSDRV_WriteFill
(
physDev
);
PSDRV_WriteGRestore
(
physDev
);
PSDRV_ResetClip
(
physDev
);
return
color
;
}
/***********************************************************************
* PSDRV_DrawLine
*/
VOID
PSDRV_DrawLine
(
PSDRV_PDEVICE
*
physDev
)
{
if
(
physDev
->
pathdepth
)
return
;
if
(
physDev
->
pen
.
style
==
PS_NULL
)
PSDRV_WriteNewPath
(
physDev
);
else
PSDRV_WriteStroke
(
physDev
);
}
dlls/wineps/ps.c
View file @
a45df5d9
...
...
@@ -603,7 +603,7 @@ BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number)
BOOL
PSDRV_WriteImageDict
(
PSDRV_PDEVICE
*
physDev
,
WORD
depth
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
widthSrc
,
INT
heightSrc
,
char
*
bits
)
INT
heightSrc
,
char
*
bits
,
BOOL
mask
)
{
char
start
[]
=
"%d %d translate
\n
%d %d scale
\n
<<
\n
"
" /ImageType 1
\n
/Width %d
\n
/Height %d
\n
/BitsPerComponent %d
\n
"
...
...
@@ -613,6 +613,8 @@ BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst
char
decode3
[]
=
" /Decode [0 1 0 1 0 1]
\n
"
;
char
end
[]
=
" /DataSource currentfile /ASCIIHexDecode filter
\n
>> image
\n
"
;
char
endmask
[]
=
" /DataSource currentfile /ASCIIHexDecode filter
\n
>> imagemask
\n
"
;
char
endbits
[]
=
" /DataSource <%s>
\n
>> image
\n
"
;
char
*
buf
=
HeapAlloc
(
PSDRV_Heap
,
0
,
1000
);
...
...
@@ -642,9 +644,12 @@ BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst
PSDRV_WriteSpool
(
physDev
,
buf
,
strlen
(
buf
));
if
(
!
bits
)
PSDRV_WriteSpool
(
physDev
,
end
,
sizeof
(
end
)
-
1
);
else
{
if
(
!
bits
)
{
if
(
!
mask
)
PSDRV_WriteSpool
(
physDev
,
end
,
sizeof
(
end
)
-
1
);
else
PSDRV_WriteSpool
(
physDev
,
endmask
,
sizeof
(
endmask
)
-
1
);
}
else
{
sprintf
(
buf
,
endbits
,
bits
);
PSDRV_WriteSpool
(
physDev
,
buf
,
strlen
(
buf
));
}
...
...
@@ -810,7 +815,7 @@ BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits)
ptr
+=
2
;
}
}
PSDRV_WriteImageDict
(
physDev
,
1
,
0
,
0
,
8
,
8
,
8
,
8
,
buf
);
PSDRV_WriteImageDict
(
physDev
,
1
,
0
,
0
,
8
,
8
,
8
,
8
,
buf
,
FALSE
);
PSDRV_WriteSpool
(
physDev
,
end
,
sizeof
(
end
)
-
1
);
HeapFree
(
PSDRV_Heap
,
0
,
buf
);
return
TRUE
;
...
...
@@ -858,7 +863,7 @@ BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usa
ptr
+=
2
;
}
}
PSDRV_WriteImageDict
(
physDev
,
1
,
0
,
0
,
8
,
8
,
8
,
8
,
buf
);
PSDRV_WriteImageDict
(
physDev
,
1
,
0
,
0
,
8
,
8
,
8
,
8
,
buf
,
FALSE
);
PSDRV_WriteSpool
(
physDev
,
end
,
sizeof
(
end
)
-
1
);
HeapFree
(
PSDRV_Heap
,
0
,
buf
);
return
TRUE
;
...
...
dlls/wineps/psdrv.h
View file @
a45df5d9
...
...
@@ -384,6 +384,9 @@ extern BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO);
extern
BOOL
PSDRV_SetFont
(
PSDRV_PDEVICE
*
physDev
);
extern
BOOL
PSDRV_SetPen
(
PSDRV_PDEVICE
*
physDev
);
extern
void
PSDRV_SetClip
(
PSDRV_PDEVICE
*
phyDev
);
extern
void
PSDRV_ResetClip
(
PSDRV_PDEVICE
*
phyDev
);
extern
BOOL
PSDRV_CmpColor
(
PSCOLOR
*
col1
,
PSCOLOR
*
col2
);
extern
BOOL
PSDRV_CopyColor
(
PSCOLOR
*
col1
,
PSCOLOR
*
col2
);
extern
void
PSDRV_CreateColor
(
PSDRV_PDEVICE
*
physDev
,
PSCOLOR
*
pscolor
,
...
...
@@ -427,7 +430,7 @@ extern BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev);
extern
BOOL
PSDRV_WriteRGB
(
PSDRV_PDEVICE
*
physDev
,
COLORREF
*
map
,
int
number
);
extern
BOOL
PSDRV_WriteImageDict
(
PSDRV_PDEVICE
*
physDev
,
WORD
depth
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
widthSrc
,
INT
heightSrc
,
char
*
bits
);
INT
heightSrc
,
char
*
bits
,
BOOL
mask
);
extern
BOOL
PSDRV_WriteBytes
(
PSDRV_PDEVICE
*
physDev
,
const
BYTE
*
bytes
,
int
number
);
extern
BOOL
PSDRV_WriteDIBits16
(
PSDRV_PDEVICE
*
physDev
,
const
WORD
*
words
,
int
number
);
extern
BOOL
PSDRV_WriteDIBits24
(
PSDRV_PDEVICE
*
physDev
,
const
BYTE
*
bits
,
int
number
);
...
...
@@ -491,8 +494,7 @@ extern INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
extern
DWORD
PSDRV_DeviceCapabilities
(
LPSTR
lpszDriver
,
LPCSTR
lpszDevice
,
LPCSTR
lpszPort
,
WORD
fwCapability
,
LPSTR
lpszOutput
,
LPDEVMODEA
lpDevMode
);
VOID
PSDRV_DrawLine
(
PSDRV_PDEVICE
*
physDev
);
LPDEVMODEA
lpdm
);
INT
PSDRV_GlyphListInit
(
void
);
const
GLYPHNAME
*
PSDRV_GlyphName
(
LPCSTR
szName
);
VOID
PSDRV_IndexGlyphList
(
void
);
...
...
dlls/wineps/text.c
View file @
a45df5d9
...
...
@@ -47,6 +47,8 @@ BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
/* write font if not already written */
PSDRV_SetFont
(
physDev
);
PSDRV_SetClip
(
physDev
);
/* set clipping and/or draw background */
if
((
flags
&
(
ETO_CLIPPED
|
ETO_OPAQUE
))
&&
(
lprect
!=
NULL
))
{
...
...
@@ -79,6 +81,7 @@ BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
bResult
=
PSDRV_Text
(
physDev
,
x
,
y
,
flags
,
str
,
count
,
TRUE
,
lpDx
);
}
PSDRV_ResetClip
(
physDev
);
return
bResult
;
}
...
...
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