Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
0535c49c
Commit
0535c49c
authored
Jun 11, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pixmap.c: call miModifyPixmapHeader twice instead of duplicating code
parent
db74c07e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
83 deletions
+11
-83
Pixmap.c
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+11
-83
No files found.
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
View file @
0535c49c
...
...
@@ -555,89 +555,18 @@ Bool nxagentModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int dep
bitsPerPixel
,
devKind
,
(
void
*
)
pPixData
);
#endif
if
((
width
>
0
)
&&
(
height
>
0
)
&&
(
depth
>
0
)
&&
(
bitsPerPixel
>
0
)
&&
(
devKind
>
0
)
&&
pPixData
)
{
pPixmap
->
drawable
.
depth
=
depth
;
pPixmap
->
drawable
.
bitsPerPixel
=
bitsPerPixel
;
pPixmap
->
drawable
.
id
=
0
;
pPixmap
->
drawable
.
serialNumber
=
NEXT_SERIAL_NUMBER
;
pPixmap
->
drawable
.
x
=
0
;
pPixmap
->
drawable
.
y
=
0
;
pPixmap
->
drawable
.
width
=
width
;
pPixmap
->
drawable
.
height
=
height
;
pPixmap
->
devKind
=
devKind
;
pPixmap
->
refcnt
=
1
;
pPixmap
->
devPrivate
.
ptr
=
pPixData
;
pVirtualPixmap
->
drawable
.
depth
=
depth
;
pVirtualPixmap
->
drawable
.
bitsPerPixel
=
bitsPerPixel
;
pVirtualPixmap
->
drawable
.
id
=
0
;
pVirtualPixmap
->
drawable
.
serialNumber
=
NEXT_SERIAL_NUMBER
;
pVirtualPixmap
->
drawable
.
x
=
0
;
pVirtualPixmap
->
drawable
.
y
=
0
;
pVirtualPixmap
->
drawable
.
width
=
width
;
pVirtualPixmap
->
drawable
.
height
=
height
;
pVirtualPixmap
->
devKind
=
devKind
;
pVirtualPixmap
->
refcnt
=
1
;
pVirtualPixmap
->
devPrivate
.
ptr
=
pPixData
;
}
else
{
if
(
width
>
0
)
pPixmap
->
drawable
.
width
=
width
;
if
(
height
>
0
)
pPixmap
->
drawable
.
height
=
height
;
if
(
depth
>
0
)
pPixmap
->
drawable
.
depth
=
depth
;
if
(
bitsPerPixel
>
0
)
pPixmap
->
drawable
.
bitsPerPixel
=
bitsPerPixel
;
else
if
((
bitsPerPixel
<
0
)
&&
(
depth
>
0
))
pPixmap
->
drawable
.
bitsPerPixel
=
BitsPerPixel
(
depth
);
if
(
devKind
>
0
)
pPixmap
->
devKind
=
devKind
;
else
if
((
devKind
<
0
)
&&
((
width
>
0
)
||
(
depth
>
0
)))
pPixmap
->
devKind
=
PixmapBytePad
(
pPixmap
->
drawable
.
width
,
pPixmap
->
drawable
.
depth
);
if
(
pPixData
)
pPixmap
->
devPrivate
.
ptr
=
pPixData
;
/*
* XXX This was the previous assignment:
*
* pVirtualPixmap->devPrivate.ptr = pPixData;
*/
if
(
width
>
0
)
pVirtualPixmap
->
drawable
.
width
=
width
;
if
(
height
>
0
)
pVirtualPixmap
->
drawable
.
height
=
height
;
if
(
depth
>
0
)
pVirtualPixmap
->
drawable
.
depth
=
depth
;
if
(
bitsPerPixel
>
0
)
pVirtualPixmap
->
drawable
.
bitsPerPixel
=
bitsPerPixel
;
else
if
((
bitsPerPixel
<
0
)
&&
(
depth
>
0
))
pVirtualPixmap
->
drawable
.
bitsPerPixel
=
BitsPerPixel
(
depth
);
if
(
devKind
>
0
)
pVirtualPixmap
->
devKind
=
devKind
;
else
if
((
devKind
<
0
)
&&
((
width
>
0
)
||
(
depth
>
0
)))
pVirtualPixmap
->
devKind
=
PixmapBytePad
(
pVirtualPixmap
->
drawable
.
width
,
pVirtualPixmap
->
drawable
.
depth
);
/*
* ignore return code, because the only case where this will return
* FALSE is pPixmap == NULL, which we have already caught above.
*/
miModifyPixmapHeader
(
pPixmap
,
width
,
height
,
depth
,
bitsPerPixel
,
devKind
,
pPixData
);
miModifyPixmapHeader
(
pVirtualPixmap
,
width
,
height
,
depth
,
bitsPerPixel
,
devKind
,
pPixData
);
if
(
pPixData
)
pVirtualPixmap
->
devPrivate
.
ptr
=
pPixData
;
#ifdef PANIC
#ifdef PANIC
if
(
!
((
width
>
0
)
&&
(
height
>
0
)
&&
(
depth
>
0
)
&&
(
bitsPerPixel
>
0
)
&&
(
devKind
>
0
)
&&
pPixData
))
{
if
(
pPixmap
->
drawable
.
x
!=
0
||
pPixmap
->
drawable
.
y
!=
0
)
{
fprintf
(
stderr
,
"nxagentModifyPixmapHeader: PANIC! Pixmap at [%p] has x [%d] and y [%d].
\n
"
,
...
...
@@ -645,9 +574,8 @@ Bool nxagentModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int dep
FatalError
(
"nxagentModifyPixmapHeader: PANIC! Pixmap has x or y greater than zero."
);
}
#endif
}
#endif
return
True
;
}
...
...
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