Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
swiftshader
Commits
296e312a
Commit
296e312a
authored
May 07, 2014
by
Nicolas Capens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid writing any pixels outside of the frame buffer.
crbug.com/336438
parent
a38f746f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
27 deletions
+35
-27
Version.h
src/Common/Version.h
+1
-1
FrameBuffer.cpp
src/Main/FrameBuffer.cpp
+26
-18
FrameBufferX11.cpp
src/Main/FrameBufferX11.cpp
+8
-8
No files found.
src/Common/Version.h
View file @
296e312a
#define MAJOR_VERSION 3
#define MINOR_VERSION 2
#define BUILD_VERSION 6
#define BUILD_REVISION 47
312
#define BUILD_REVISION 47
506
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/Main/FrameBuffer.cpp
View file @
296e312a
...
...
@@ -274,11 +274,13 @@ namespace sw
if
(
state
.
depth
==
32
)
{
if
(
width2
%
4
==
0
&&
!
state
.
HDR
)
Int
x
=
x0
;
if
(
!
state
.
HDR
)
{
For
(
Int
x
=
x0
,
x
<
width2
,
x
+=
4
)
For
(
,
x
<
width
-
3
,
x
+=
4
)
{
*
Pointer
<
Int4
>
(
d
,
1
)
=
*
Pointer
<
Int4
>
(
s
,
16
);
*
Pointer
<
Int4
>
(
d
,
1
)
=
*
Pointer
<
Int4
>
(
s
,
width
%
4
?
1
:
16
);
s
+=
4
*
sBytes
;
d
+=
4
*
dBytes
;
...
...
@@ -286,28 +288,34 @@ namespace sw
}
else
{
For
(
Int
x
=
x0
,
x
<
width2
,
x
+=
2
)
For
(
,
x
<
width
-
1
,
x
+=
2
)
{
Int2
c01
;
if
(
!
state
.
HDR
)
{
c01
=
*
Pointer
<
Int2
>
(
s
);
}
else
{
UShort4
c0
=
As
<
UShort4
>
(
Swizzle
(
*
Pointer
<
Short4
>
(
s
+
0
),
0xC6
))
>>
8
;
UShort4
c1
=
As
<
UShort4
>
(
Swizzle
(
*
Pointer
<
Short4
>
(
s
+
8
),
0xC6
))
>>
8
;
c01
=
As
<
Int2
>
(
Pack
(
c0
,
c1
));
}
UShort4
c0
=
As
<
UShort4
>
(
Swizzle
(
*
Pointer
<
Short4
>
(
s
+
0
),
0xC6
))
>>
8
;
UShort4
c1
=
As
<
UShort4
>
(
Swizzle
(
*
Pointer
<
Short4
>
(
s
+
8
),
0xC6
))
>>
8
;
*
Pointer
<
Int2
>
(
d
)
=
c01
;
*
Pointer
<
Int2
>
(
d
)
=
As
<
Int2
>
(
Pack
(
c0
,
c1
))
;
s
+=
2
*
sBytes
;
d
+=
2
*
dBytes
;
}
}
For
(,
x
<
width
,
x
++
)
{
if
(
!
state
.
HDR
)
{
*
Pointer
<
Int
>
(
d
)
=
*
Pointer
<
Int
>
(
s
);
}
else
{
UShort4
c
=
As
<
UShort4
>
(
Swizzle
(
*
Pointer
<
Short4
>
(
s
),
0xC6
))
>>
8
;
*
Pointer
<
Int
>
(
d
)
=
Int
(
As
<
Int2
>
(
Pack
(
c
,
c
)));
}
s
+=
sBytes
;
d
+=
dBytes
;
}
}
else
if
(
state
.
depth
==
24
)
{
...
...
src/Main/FrameBufferX11.cpp
View file @
296e312a
...
...
@@ -137,11 +137,11 @@ namespace sw
XSync
(
x_display
,
False
);
}
}
extern
"C"
{
sw
::
FrameBuffer
*
createFrameBuffer
(
void
*
display
,
Window
window
,
int
width
,
int
height
)
{
return
new
sw
::
FrameBufferX11
((
Display
*
)
display
,
window
,
width
,
height
);
}
}
extern
"C"
{
sw
::
FrameBuffer
*
createFrameBuffer
(
void
*
display
,
Window
window
,
int
width
,
int
height
)
{
return
new
sw
::
FrameBufferX11
((
Display
*
)
display
,
window
,
width
,
height
);
}
}
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