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
2dfa0023
Commit
2dfa0023
authored
Oct 17, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Get rid of the StretchDIBits entry point.
parent
472a8f7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
161 deletions
+3
-161
bitmap.c
dlls/wineps.drv/bitmap.c
+2
-156
init.c
dlls/wineps.drv/init.c
+1
-1
psdrv.h
dlls/wineps.drv/psdrv.h
+0
-4
No files found.
dlls/wineps.drv/bitmap.c
View file @
2dfa0023
...
...
@@ -38,7 +38,7 @@ static inline int get_dib_width_bytes( int width, int depth )
/***************************************************************************
* PSDRV_WriteImageHeader
*
* Helper for PSDRV_
StretchDIBits
* Helper for PSDRV_
PutImage
*
* BUGS
* Uses level 2 PostScript
...
...
@@ -79,7 +79,7 @@ static BOOL PSDRV_WriteImageHeader(PHYSDEV dev, const BITMAPINFO *info, INT xDst
/***************************************************************************
* PSDRV_WriteImageMaskHeader
*
* Helper for PSDRV_
StretchDIBits
* Helper for PSDRV_
PutImage
*
* We use the imagemask operator for 1bpp bitmaps since the output
* takes much less time for the printer to render.
...
...
@@ -276,157 +276,3 @@ update_format:
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
return
ERROR_BAD_FORMAT
;
}
/***************************************************************************
*
* PSDRV_StretchDIBits
*
* BUGS
* Doesn't work correctly if xSrc isn't byte aligned - this affects 1 and 4
* bit depths.
* Compression not implemented.
*/
INT
PSDRV_StretchDIBits
(
PHYSDEV
dev
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
xSrc
,
INT
ySrc
,
INT
widthSrc
,
INT
heightSrc
,
const
void
*
bits
,
BITMAPINFO
*
info
,
UINT
wUsage
,
DWORD
dwRop
)
{
INT
stride
;
INT
line
;
POINT
pt
[
2
];
const
BYTE
*
src_ptr
;
BYTE
*
dst_ptr
,
*
bitmap
;
DWORD
bitmap_size
;
TRACE
(
"%p (%d,%d %dx%d) -> (%d,%d %dx%d)
\n
"
,
dev
->
hdc
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
xDst
,
yDst
,
widthDst
,
heightDst
);
stride
=
get_dib_width_bytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
);
TRACE
(
"full size=%dx%d bpp=%d compression=%d rop=%08x
\n
"
,
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
,
info
->
bmiHeader
.
biCompression
,
dwRop
);
if
(
info
->
bmiHeader
.
biCompression
!=
BI_RGB
)
{
FIXME
(
"Compression not supported
\n
"
);
return
FALSE
;
}
pt
[
0
].
x
=
xDst
;
pt
[
0
].
y
=
yDst
;
pt
[
1
].
x
=
xDst
+
widthDst
;
pt
[
1
].
y
=
yDst
+
heightDst
;
LPtoDP
(
dev
->
hdc
,
pt
,
2
);
xDst
=
pt
[
0
].
x
;
yDst
=
pt
[
0
].
y
;
widthDst
=
pt
[
1
].
x
-
pt
[
0
].
x
;
heightDst
=
pt
[
1
].
y
-
pt
[
0
].
y
;
switch
(
info
->
bmiHeader
.
biBitCount
)
{
case
1
:
src_ptr
=
bits
;
src_ptr
+=
(
ySrc
*
stride
);
if
(
xSrc
&
7
)
FIXME
(
"This won't work...
\n
"
);
bitmap_size
=
heightSrc
*
((
widthSrc
+
7
)
/
8
);
dst_ptr
=
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitmap_size
);
for
(
line
=
0
;
line
<
heightSrc
;
line
++
,
src_ptr
+=
stride
,
dst_ptr
+=
((
widthSrc
+
7
)
/
8
))
memcpy
(
dst_ptr
,
src_ptr
+
xSrc
/
8
,
(
widthSrc
+
7
)
/
8
);
break
;
case
4
:
src_ptr
=
bits
;
src_ptr
+=
(
ySrc
*
stride
);
if
(
xSrc
&
1
)
FIXME
(
"This won't work...
\n
"
);
bitmap_size
=
heightSrc
*
((
widthSrc
+
1
)
/
2
);
dst_ptr
=
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitmap_size
);
for
(
line
=
0
;
line
<
heightSrc
;
line
++
,
src_ptr
+=
stride
,
dst_ptr
+=
((
widthSrc
+
1
)
/
2
))
memcpy
(
dst_ptr
,
src_ptr
+
xSrc
/
2
,
(
widthSrc
+
1
)
/
2
);
break
;
case
8
:
src_ptr
=
bits
;
src_ptr
+=
(
ySrc
*
stride
);
bitmap_size
=
heightSrc
*
widthSrc
;
dst_ptr
=
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitmap_size
);
for
(
line
=
0
;
line
<
heightSrc
;
line
++
,
src_ptr
+=
stride
,
dst_ptr
+=
widthSrc
)
memcpy
(
dst_ptr
,
src_ptr
+
xSrc
,
widthSrc
);
break
;
case
16
:
src_ptr
=
bits
;
src_ptr
+=
(
ySrc
*
stride
);
bitmap_size
=
heightSrc
*
widthSrc
*
3
;
dst_ptr
=
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitmap_size
);
for
(
line
=
0
;
line
<
heightSrc
;
line
++
,
src_ptr
+=
stride
)
{
const
WORD
*
words
=
(
const
WORD
*
)
src_ptr
+
xSrc
;
int
i
;
for
(
i
=
0
;
i
<
widthSrc
;
i
++
)
{
BYTE
r
,
g
,
b
;
/* We want 0x0 -- 0x1f to map to 0x0 -- 0xff */
r
=
words
[
i
]
>>
10
&
0x1f
;
r
=
r
<<
3
|
r
>>
2
;
g
=
words
[
i
]
>>
5
&
0x1f
;
g
=
g
<<
3
|
g
>>
2
;
b
=
words
[
i
]
&
0x1f
;
b
=
b
<<
3
|
b
>>
2
;
dst_ptr
[
0
]
=
r
;
dst_ptr
[
1
]
=
g
;
dst_ptr
[
2
]
=
b
;
dst_ptr
+=
3
;
}
}
break
;
case
24
:
src_ptr
=
bits
;
src_ptr
+=
(
ySrc
*
stride
);
bitmap_size
=
heightSrc
*
widthSrc
*
3
;
dst_ptr
=
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitmap_size
);
for
(
line
=
0
;
line
<
heightSrc
;
line
++
,
src_ptr
+=
stride
)
{
const
BYTE
*
byte
=
src_ptr
+
xSrc
*
3
;
int
i
;
for
(
i
=
0
;
i
<
widthSrc
;
i
++
)
{
dst_ptr
[
0
]
=
byte
[
i
*
3
+
2
];
dst_ptr
[
1
]
=
byte
[
i
*
3
+
1
];
dst_ptr
[
2
]
=
byte
[
i
*
3
];
dst_ptr
+=
3
;
}
}
break
;
case
32
:
src_ptr
=
bits
;
src_ptr
+=
(
ySrc
*
stride
);
bitmap_size
=
heightSrc
*
widthSrc
*
3
;
dst_ptr
=
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitmap_size
);
for
(
line
=
0
;
line
<
heightSrc
;
line
++
,
src_ptr
+=
stride
)
{
const
BYTE
*
byte
=
src_ptr
+
xSrc
*
4
;
int
i
;
for
(
i
=
0
;
i
<
widthSrc
;
i
++
)
{
dst_ptr
[
0
]
=
byte
[
i
*
4
+
2
];
dst_ptr
[
1
]
=
byte
[
i
*
4
+
1
];
dst_ptr
[
2
]
=
byte
[
i
*
4
];
dst_ptr
+=
3
;
}
}
break
;
default:
FIXME
(
"Unsupported depth
\n
"
);
return
FALSE
;
}
PSDRV_SetClip
(
dev
);
PSDRV_WriteGSave
(
dev
);
PSDRV_WriteImageBits
(
dev
,
info
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
,
bitmap
,
bitmap_size
);
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
);
PSDRV_WriteGRestore
(
dev
);
PSDRV_ResetClip
(
dev
);
return
abs
(
heightSrc
);
}
dlls/wineps.drv/init.c
View file @
2dfa0023
...
...
@@ -931,7 +931,7 @@ static const struct gdi_dc_funcs psdrv_funcs =
PSDRV_StartDoc
,
/* pStartDoc */
PSDRV_StartPage
,
/* pStartPage */
NULL
,
/* pStretchBlt */
PSDRV_StretchDIBits
,
/* pStretchDIBits */
NULL
,
/* pStretchDIBits */
NULL
,
/* pStrokeAndFillPath */
NULL
,
/* pStrokePath */
NULL
,
/* pSwapBuffers */
...
...
dlls/wineps.drv/psdrv.h
View file @
2dfa0023
...
...
@@ -459,10 +459,6 @@ extern COLORREF PSDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDD
extern
COLORREF
PSDRV_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
COLORREF
PSDRV_SetTextColor
(
PHYSDEV
dev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
INT
PSDRV_StartDoc
(
PHYSDEV
dev
,
const
DOCINFOW
*
doc
)
DECLSPEC_HIDDEN
;
extern
INT
PSDRV_StretchDIBits
(
PHYSDEV
dev
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
xSrc
,
INT
ySrc
,
INT
widthSrc
,
INT
heightSrc
,
const
void
*
bits
,
BITMAPINFO
*
info
,
UINT
wUsage
,
DWORD
dwRop
)
DECLSPEC_HIDDEN
;
extern
void
PSDRV_MergeDevmodes
(
PSDRV_DEVMODEA
*
dm1
,
PSDRV_DEVMODEA
*
dm2
,
PRINTERINFO
*
pi
)
DECLSPEC_HIDDEN
;
...
...
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