Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Drew DeVault
xserver
Commits
4a51cc04
Commit
4a51cc04
authored
Aug 24, 2009
by
Eric Anholt
Committed by
Zhigang Gong
Sep 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glamor: Add clipping to setspans.
parent
5fadea5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
glamor/glamor_setspans.c
glamor/glamor_setspans.c
+20
-6
No files found.
glamor/glamor_setspans.c
View file @
4a51cc04
...
@@ -40,6 +40,8 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
...
@@ -40,6 +40,8 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
uint8_t
*
temp_src
=
NULL
,
*
drawpixels_src
=
(
uint8_t
*
)
src
;
uint8_t
*
temp_src
=
NULL
,
*
drawpixels_src
=
(
uint8_t
*
)
src
;
int
i
,
j
;
int
i
,
j
;
int
wmax
=
0
;
int
wmax
=
0
;
RegionPtr
clip
=
fbGetCompositeClip
(
gc
);
BoxRec
*
pbox
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
wmax
<
widths
[
i
])
if
(
wmax
<
widths
[
i
])
...
@@ -87,12 +89,23 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
...
@@ -87,12 +89,23 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
}
}
}
}
glRasterPos2i
(
points
[
i
].
x
-
dest_pixmap
->
screen_x
,
n
=
REGION_NUM_RECTS
(
clip
);
points
[
i
].
y
-
dest_pixmap
->
screen_y
);
pbox
=
REGION_RECTS
(
clip
);
glDrawPixels
(
widths
[
i
],
while
(
n
--
)
{
1
,
if
(
pbox
->
y1
>
points
[
i
].
y
)
format
,
type
,
break
;
drawpixels_src
);
glScissor
(
pbox
->
x1
,
points
[
i
].
y
-
dest_pixmap
->
screen_y
,
pbox
->
x2
-
pbox
->
x1
,
1
);
glEnable
(
GL_SCISSOR_TEST
);
glRasterPos2i
(
points
[
i
].
x
-
dest_pixmap
->
screen_x
,
points
[
i
].
y
-
dest_pixmap
->
screen_y
);
glDrawPixels
(
widths
[
i
],
1
,
format
,
type
,
drawpixels_src
);
}
if
(
temp_src
)
{
if
(
temp_src
)
{
src
+=
PixmapBytePad
(
widths
[
i
],
drawable
->
depth
);
src
+=
PixmapBytePad
(
widths
[
i
],
drawable
->
depth
);
}
else
{
}
else
{
...
@@ -100,6 +113,7 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
...
@@ -100,6 +113,7 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
}
}
}
}
fail:
fail:
glDisable
(
GL_SCISSOR_TEST
);
glamor_set_planemask
(
dest_pixmap
,
~
0
);
glamor_set_planemask
(
dest_pixmap
,
~
0
);
glamor_set_alu
(
GXcopy
);
glamor_set_alu
(
GXcopy
);
xfree
(
temp_src
);
xfree
(
temp_src
);
...
...
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