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
a110b0c4
Unverified
Commit
a110b0c4
authored
Feb 05, 2018
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/update_fb' into 3.6.x
Attributes GH PR #642:
https://github.com/ArcticaProject/nx-libs/pull/642
parents
b1c42dc9
f7207bcd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
46 deletions
+109
-46
fbblt.c
nx-X11/programs/Xserver/fb/fbblt.c
+24
-0
fbcompose.c
nx-X11/programs/Xserver/fb/fbcompose.c
+67
-43
fbgc.c
nx-X11/programs/Xserver/fb/fbgc.c
+7
-2
fbpict.h
nx-X11/programs/Xserver/fb/fbpict.h
+1
-1
picture.h
nx-X11/programs/Xserver/render/picture.h
+10
-0
No files found.
nx-X11/programs/Xserver/fb/fbblt.c
View file @
a110b0c4
...
...
@@ -26,6 +26,7 @@
#include <dix-config.h>
#endif
#include <string.h>
#include "fb.h"
#define InitializeShifts(sx,dx,ls,rs) { \
...
...
@@ -76,6 +77,29 @@ fbBlt (FbBits *srcLine,
return
;
}
#endif
if
(
alu
==
GXcopy
&&
pm
==
FB_ALLONES
&&
!
reverse
&&
!
(
srcX
&
7
)
&&
!
(
dstX
&
7
)
&&
!
(
width
&
7
))
{
int
i
;
CARD8
*
src
=
(
CARD8
*
)
srcLine
;
CARD8
*
dst
=
(
CARD8
*
)
dstLine
;
srcStride
*=
sizeof
(
FbBits
);
dstStride
*=
sizeof
(
FbBits
);
width
>>=
3
;
src
+=
(
srcX
>>
3
);
dst
+=
(
dstX
>>
3
);
if
(
!
upsidedown
)
for
(
i
=
0
;
i
<
height
;
i
++
)
memcpy
(
dst
+
i
*
dstStride
,
src
+
i
*
srcStride
,
width
);
else
for
(
i
=
height
-
1
;
i
>=
0
;
i
--
)
memcpy
(
dst
+
i
*
dstStride
,
src
+
i
*
srcStride
,
width
);
return
;
}
FbInitializeMergeRop
(
alu
,
pm
);
destInvarient
=
FbDestInvarientMergeRop
();
if
(
upsidedown
)
...
...
nx-X11/programs/Xserver/fb/fbcompose.c
View file @
a110b0c4
...
...
@@ -382,6 +382,17 @@ fbFetch_c8 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr i
}
}
static
FASTCALL
void
fbFetch_x4a4
(
const
FbBits
*
bits
,
int
x
,
int
width
,
CARD32
*
buffer
,
miIndexedPtr
indexed
)
{
const
CARD8
*
pixel
=
(
const
CARD8
*
)
bits
+
x
;
const
CARD8
*
end
=
pixel
+
width
;
while
(
pixel
<
end
)
{
CARD8
p
=
(
*
pixel
++
)
&
0xf
;
*
buffer
++
=
(
p
|
(
p
<<
4
))
<<
24
;
}
}
#define Fetch8(l,o) (((CARD8 *) (l))[(o) >> 2])
#if IMAGE_BYTE_ORDER == MSBFirst
#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
...
...
@@ -545,6 +556,7 @@ static fetchProc fetchProcForPicture (PicturePtr pict)
case
PICT_a2b2g2r2
:
return
fbFetch_a2b2g2r2
;
case
PICT_c8
:
return
fbFetch_c8
;
case
PICT_g8
:
return
fbFetch_c8
;
case
PICT_x4a4
:
return
fbFetch_x4a4
;
/* 4bpp formats */
case
PICT_a4
:
return
fbFetch_a4
;
...
...
@@ -1258,6 +1270,16 @@ fbStore_c8 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr i
}
}
static
FASTCALL
void
fbStore_x4a4
(
FbBits
*
bits
,
const
CARD32
*
values
,
int
x
,
int
width
,
miIndexedPtr
indexed
)
{
int
i
;
CARD8
*
pixel
=
((
CARD8
*
)
bits
)
+
x
;
for
(
i
=
0
;
i
<
width
;
++
i
)
{
*
pixel
++
=
values
[
i
]
>>
28
;
}
}
#define Store8(l,o,v) (((CARD8 *) l)[(o) >> 3] = (v))
#if IMAGE_BYTE_ORDER == MSBFirst
#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \
...
...
@@ -1409,6 +1431,7 @@ static storeProc storeProcForPicture (PicturePtr pict)
case
PICT_a2r2g2b2
:
return
fbStore_a2r2g2b2
;
case
PICT_c8
:
return
fbStore_c8
;
case
PICT_g8
:
return
fbStore_c8
;
case
PICT_x4a4
:
return
fbStore_x4a4
;
/* 4bpp formats */
case
PICT_a4
:
return
fbStore_a4
;
...
...
@@ -2861,7 +2884,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
FbBits
*
bits
;
FbStride
stride
;
int
bpp
;
int
xoff
,
yoff
;
int
xoff
,
yoff
,
dx
,
dy
;
fetchPixelProc
fetch
;
PictVector
v
;
PictVector
unit
;
...
...
@@ -2876,8 +2899,11 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
x
+=
xoff
;
y
+=
yoff
;
v
.
vector
[
0
]
=
IntToxFixed
(
x
);
v
.
vector
[
1
]
=
IntToxFixed
(
y
);
dx
=
pict
->
pDrawable
->
x
;
dy
=
pict
->
pDrawable
->
y
;
v
.
vector
[
0
]
=
IntToxFixed
(
x
-
dx
);
v
.
vector
[
1
]
=
IntToxFixed
(
y
-
dy
);
v
.
vector
[
2
]
=
xFixed1
;
/* when using convolution filters one might get here without a transform */
...
...
@@ -2898,7 +2924,6 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
{
if
(
pict
->
repeatType
==
RepeatNormal
)
{
if
(
RegionNumRects
(
pict
->
pCompositeClip
)
==
1
)
{
box
=
pict
->
pCompositeClip
->
extents
;
for
(
i
=
0
;
i
<
width
;
++
i
)
{
if
(
!
v
.
vector
[
2
])
{
buffer
[
i
]
=
0
;
...
...
@@ -2910,7 +2935,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y
=
MOD
(
v
.
vector
[
1
]
>>
16
,
pict
->
pDrawable
->
height
);
x
=
MOD
(
v
.
vector
[
0
]
>>
16
,
pict
->
pDrawable
->
width
);
}
buffer
[
i
]
=
fetch
(
bits
+
(
y
+
pict
->
pDrawable
->
y
)
*
stride
,
x
+
pict
->
pDrawable
->
x
,
indexed
);
buffer
[
i
]
=
fetch
(
bits
+
(
y
+
dy
)
*
stride
,
x
+
d
x
,
indexed
);
}
v
.
vector
[
0
]
+=
unit
.
vector
[
0
];
v
.
vector
[
1
]
+=
unit
.
vector
[
1
];
...
...
@@ -2928,8 +2953,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y
=
MOD
(
v
.
vector
[
1
]
>>
16
,
pict
->
pDrawable
->
height
);
x
=
MOD
(
v
.
vector
[
0
]
>>
16
,
pict
->
pDrawable
->
width
);
}
if
(
RegionContainsPoint
(
pict
->
pCompositeClip
,
x
,
y
,
&
box
))
buffer
[
i
]
=
fetch
(
bits
+
(
y
+
pict
->
pDrawable
->
y
)
*
stride
,
x
+
pict
->
pDrawable
->
x
,
indexed
);
if
(
RegionContainsPoint
(
pict
->
pCompositeClip
,
x
+
dx
,
y
+
d
y
,
&
box
))
buffer
[
i
]
=
fetch
(
bits
+
(
y
+
dy
)
*
stride
,
x
+
d
x
,
indexed
);
else
buffer
[
i
]
=
0
;
}
...
...
@@ -2952,8 +2977,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y
=
v
.
vector
[
1
]
>>
16
;
x
=
v
.
vector
[
0
]
>>
16
;
}
buffer
[
i
]
=
((
x
<
box
.
x1
)
|
(
x
>=
box
.
x2
)
|
(
y
<
box
.
y1
)
|
(
y
>=
box
.
y2
))
?
0
:
fetch
(
bits
+
(
y
+
pict
->
pDrawable
->
y
)
*
stride
,
x
+
pict
->
pDrawable
->
x
,
indexed
);
buffer
[
i
]
=
((
x
<
box
.
x1
-
dx
)
|
(
x
>=
box
.
x2
-
dx
)
|
(
y
<
box
.
y1
-
dy
)
|
(
y
>=
box
.
y2
-
dy
))
?
0
:
fetch
(
bits
+
(
y
+
dy
)
*
stride
,
x
+
d
x
,
indexed
);
}
v
.
vector
[
0
]
+=
unit
.
vector
[
0
];
v
.
vector
[
1
]
+=
unit
.
vector
[
1
];
...
...
@@ -2971,8 +2996,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y
=
v
.
vector
[
1
]
>>
16
;
x
=
v
.
vector
[
0
]
>>
16
;
}
if
(
RegionContainsPoint
(
pict
->
pCompositeClip
,
x
,
y
,
&
box
))
buffer
[
i
]
=
fetch
(
bits
+
(
y
+
pict
->
pDrawable
->
y
)
*
stride
,
x
+
pict
->
pDrawable
->
x
,
indexed
);
if
(
RegionContainsPoint
(
pict
->
pCompositeClip
,
x
+
dx
,
y
+
d
y
,
&
box
))
buffer
[
i
]
=
fetch
(
bits
+
(
y
+
dy
)
*
stride
,
x
+
d
x
,
indexed
);
else
buffer
[
i
]
=
0
;
}
...
...
@@ -2985,7 +3010,6 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
else
if
(
pict
->
filter
==
PictFilterBilinear
)
{
if
(
pict
->
repeatType
==
RepeatNormal
)
{
if
(
RegionNumRects
(
pict
->
pCompositeClip
)
==
1
)
{
box
=
pict
->
pCompositeClip
->
extents
;
for
(
i
=
0
;
i
<
width
;
++
i
)
{
if
(
!
v
.
vector
[
2
])
{
buffer
[
i
]
=
0
;
...
...
@@ -3020,13 +3044,13 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y1
=
MOD
(
y1
,
pict
->
pDrawable
->
height
);
y2
=
MOD
(
y2
,
pict
->
pDrawable
->
height
);
b
=
bits
+
(
y1
+
pict
->
pDrawable
->
y
)
*
stride
;
b
=
bits
+
(
y1
+
d
y
)
*
stride
;
tl
=
fetch
(
b
,
x1
+
pict
->
pDrawable
->
x
,
indexed
);
tr
=
fetch
(
b
,
x2
+
pict
->
pDrawable
->
x
,
indexed
);
b
=
bits
+
(
y2
+
pict
->
pDrawable
->
y
)
*
stride
;
bl
=
fetch
(
b
,
x1
+
pict
->
pDrawable
->
x
,
indexed
);
br
=
fetch
(
b
,
x2
+
pict
->
pDrawable
->
x
,
indexed
);
tl
=
fetch
(
b
,
x1
+
d
x
,
indexed
);
tr
=
fetch
(
b
,
x2
+
d
x
,
indexed
);
b
=
bits
+
(
y2
+
d
y
)
*
stride
;
bl
=
fetch
(
b
,
x1
+
d
x
,
indexed
);
br
=
fetch
(
b
,
x2
+
d
x
,
indexed
);
ft
=
FbGet8
(
tl
,
0
)
*
idistx
+
FbGet8
(
tr
,
0
)
*
distx
;
fb
=
FbGet8
(
bl
,
0
)
*
idistx
+
FbGet8
(
br
,
0
)
*
distx
;
...
...
@@ -3081,17 +3105,17 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y1
=
MOD
(
y1
,
pict
->
pDrawable
->
height
);
y2
=
MOD
(
y2
,
pict
->
pDrawable
->
height
);
b
=
bits
+
(
y1
+
pict
->
pDrawable
->
y
)
*
stride
;
b
=
bits
+
(
y1
+
d
y
)
*
stride
;
tl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
,
y1
,
&
box
)
?
fetch
(
b
,
x1
+
pict
->
pDrawable
->
x
,
indexed
)
:
0
;
tr
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
,
y1
,
&
box
)
?
fetch
(
b
,
x2
+
pict
->
pDrawable
->
x
,
indexed
)
:
0
;
b
=
bits
+
(
y2
+
pict
->
pDrawable
->
y
)
*
stride
;
bl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
,
y2
,
&
box
)
?
fetch
(
b
,
x1
+
pict
->
pDrawable
->
x
,
indexed
)
:
0
;
br
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
,
y2
,
&
box
)
?
fetch
(
b
,
x2
+
pict
->
pDrawable
->
x
,
indexed
)
:
0
;
tl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
+
dx
,
y1
+
dy
,
&
box
)
?
fetch
(
b
,
x1
+
d
x
,
indexed
)
:
0
;
tr
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
+
dx
,
y1
+
dy
,
&
box
)
?
fetch
(
b
,
x2
+
d
x
,
indexed
)
:
0
;
b
=
bits
+
(
y2
+
d
y
)
*
stride
;
bl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
+
dx
,
y2
+
dy
,
&
box
)
?
fetch
(
b
,
x1
+
d
x
,
indexed
)
:
0
;
br
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
+
dx
,
y2
+
dy
,
&
box
)
?
fetch
(
b
,
x2
+
d
x
,
indexed
)
:
0
;
ft
=
FbGet8
(
tl
,
0
)
*
idistx
+
FbGet8
(
tr
,
0
)
*
distx
;
fb
=
FbGet8
(
bl
,
0
)
*
idistx
+
FbGet8
(
br
,
0
)
*
distx
;
...
...
@@ -3145,13 +3169,13 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
idistx
=
256
-
distx
;
idisty
=
256
-
disty
;
b
=
bits
+
(
y1
+
pict
->
pDrawable
->
y
)
*
stride
;
x_off
=
x1
+
pict
->
pDrawable
->
x
;
b
=
bits
+
(
y1
+
d
y
)
*
stride
;
x_off
=
x1
+
d
x
;
x1_out
=
(
x1
<
box
.
x1
)
|
(
x1
>=
box
.
x2
);
x2_out
=
(
x2
<
box
.
x1
)
|
(
x2
>=
box
.
x2
);
y1_out
=
(
y1
<
box
.
y1
)
|
(
y1
>=
box
.
y2
);
y2_out
=
(
y2
<
box
.
y1
)
|
(
y2
>=
box
.
y2
);
x1_out
=
(
x1
<
box
.
x1
-
dx
)
|
(
x1
>=
box
.
x2
-
dx
);
x2_out
=
(
x2
<
box
.
x1
-
dx
)
|
(
x2
>=
box
.
x2
-
dx
);
y1_out
=
(
y1
<
box
.
y1
-
dy
)
|
(
y1
>=
box
.
y2
-
dy
);
y2_out
=
(
y2
<
box
.
y1
-
dy
)
|
(
y2
>=
box
.
y2
-
dy
);
tl
=
x1_out
|
y1_out
?
0
:
fetch
(
b
,
x_off
,
indexed
);
tr
=
x2_out
|
y1_out
?
0
:
fetch
(
b
,
x_off
+
1
,
indexed
);
...
...
@@ -3207,17 +3231,17 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
idistx
=
256
-
distx
;
idisty
=
256
-
disty
;
b
=
bits
+
(
y1
+
pict
->
pDrawable
->
y
)
*
stride
;
x_off
=
x1
+
pict
->
pDrawable
->
x
;
b
=
bits
+
(
y1
+
d
y
)
*
stride
;
x_off
=
x1
+
d
x
;
tl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
,
y1
,
&
box
)
tl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
+
dx
,
y1
+
dy
,
&
box
)
?
fetch
(
b
,
x_off
,
indexed
)
:
0
;
tr
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
,
y1
,
&
box
)
tr
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
+
dx
,
y1
+
dy
,
&
box
)
?
fetch
(
b
,
x_off
+
1
,
indexed
)
:
0
;
b
+=
stride
;
bl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
,
y2
,
&
box
)
bl
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x1
+
dx
,
y2
+
dy
,
&
box
)
?
fetch
(
b
,
x_off
,
indexed
)
:
0
;
br
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
,
y2
,
&
box
)
br
=
RegionContainsPoint
(
pict
->
pCompositeClip
,
x2
+
dx
,
y2
+
dy
,
&
box
)
?
fetch
(
b
,
x_off
+
1
,
indexed
)
:
0
;
ft
=
FbGet8
(
tl
,
0
)
*
idistx
+
FbGet8
(
tr
,
0
)
*
distx
;
...
...
@@ -3275,9 +3299,9 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
for
(
x
=
x1
;
x
<
x2
;
x
++
)
{
if
(
*
p
)
{
int
tx
=
(
pict
->
repeatType
==
RepeatNormal
)
?
MOD
(
x
,
pict
->
pDrawable
->
width
)
:
x
;
if
(
RegionContainsPoint
(
pict
->
pCompositeClip
,
tx
,
t
y
,
&
box
))
{
FbBits
*
b
=
bits
+
(
ty
+
pict
->
pDrawable
->
y
)
*
stride
;
CARD32
c
=
fetch
(
b
,
tx
+
pict
->
pDrawable
->
x
,
indexed
);
if
(
RegionContainsPoint
(
pict
->
pCompositeClip
,
tx
+
dx
,
ty
+
d
y
,
&
box
))
{
FbBits
*
b
=
bits
+
(
ty
+
d
y
)
*
stride
;
CARD32
c
=
fetch
(
b
,
tx
+
d
x
,
indexed
);
srtot
+=
Red
(
c
)
*
*
p
;
sgtot
+=
Green
(
c
)
*
*
p
;
...
...
nx-X11/programs/Xserver/fb/fbgc.c
View file @
a110b0c4
...
...
@@ -98,9 +98,13 @@ fbPadPixmap (PixmapPtr pPixmap)
FbBits
mask
;
int
height
;
int
w
;
int
stride
;
int
bpp
;
_X_UNUSED
int
xOff
,
yOff
;
fbGetDrawable
(
&
pPixmap
->
drawable
,
bits
,
stride
,
bpp
,
xOff
,
yOff
);
width
=
pPixmap
->
drawable
.
width
*
pPixmap
->
drawable
.
bitsPerPixel
;
bits
=
pPixmap
->
devPrivate
.
ptr
;
height
=
pPixmap
->
drawable
.
height
;
mask
=
FbBitsMask
(
0
,
width
);
while
(
height
--
)
...
...
@@ -112,7 +116,8 @@ fbPadPixmap (PixmapPtr pPixmap)
b
=
b
|
FbScrRight
(
b
,
w
);
w
<<=
1
;
}
*
bits
++
=
b
;
*
bits
=
b
;
bits
+=
stride
;
}
}
...
...
nx-X11/programs/Xserver/fb/fbpict.h
View file @
a110b0c4
...
...
@@ -171,7 +171,7 @@
x = (x + ((x >> 8) & 0xff00ff)) >> 8; \
x &= 0xff00ff; \
x += (y >> 8) & 0xff00ff; \
x |= 0x1000100 - ((
t
>> 8) & 0xff00ff); \
x |= 0x1000100 - ((
x
>> 8) & 0xff00ff); \
x &= 0xff00ff; \
x <<= 8; \
x += t; \
...
...
nx-X11/programs/Xserver/render/picture.h
View file @
a110b0c4
/*
*
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
...
...
@@ -98,6 +99,15 @@ typedef struct _Picture *PicturePtr;
#define PICT_c8 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
#define PICT_g8 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
#define PICT_x4a4 PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0)
#define PICT_x4r1g2b1 PICT_FORMAT(8,PICT_TYPE_ARGB,0,1,2,1)
#define PICT_x4b1g2r1 PICT_FORMAT(8,PICT_TYPE_ABGR,0,1,2,1)
#define PICT_x4a1r1g1b1 PICT_FORMAT(8,PICT_TYPE_ARGB,1,1,1,1)
#define PICT_x4a1b1g1r1 PICT_FORMAT(8,PICT_TYPE_ABGR,1,1,1,1)
#define PICT_x4c4 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
#define PICT_x4g4 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
/* 4bpp formats */
#define PICT_a4 PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0)
#define PICT_r1g2b1 PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1)
...
...
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