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
dc743d82
Commit
dc743d82
authored
Jul 28, 2006
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Jul 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Optimize d3dfmt_convert_surface.
parent
98179f06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
surface.c
dlls/wined3d/surface.c
+16
-18
No files found.
dlls/wined3d/surface.c
View file @
dc743d82
...
...
@@ -936,7 +936,7 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
case
WINED3DFMT_P8
:
{
UINT
pitch
=
IWineD3DSurface_GetPitch
((
IWineD3DSurface
*
)
This
);
/* target is argb, 4 byte */
int
row
;
int
height
=
This
->
glRect
.
bottom
-
This
->
glRect
.
top
;
type
=
GL_UNSIGNED_BYTE
;
fmt
=
GL_RGBA
;
...
...
@@ -945,12 +945,11 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
ERR
(
"Out of memory
\n
"
);
return
;
}
for
(
row
=
This
->
dirtyRect
.
top
;
row
<
This
->
dirtyRect
.
bottom
;
row
++
)
{
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
+
row
*
pitch
+
This
->
lockedRect
.
left
,
(
BYTE
*
)
mem
+
row
*
pitch
*
4
+
This
->
lockedRect
.
left
*
4
,
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
CONVERT_PALETTED
,
This
);
}
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
*
height
,
CONVERT_PALETTED
,
This
);
}
break
;
...
...
@@ -1813,11 +1812,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
else
This
->
Flags
&=
~
SFLAG_GLCKEY
;
d3dfmt_get_conv
(
This
,
TRUE
/* We need color keying */
,
&
format
,
&
internal
,
&
type
,
&
convert
,
&
bpp
);
if
((
convert
!=
NO_CONVERSION
)
&&
This
->
resource
.
allocatedMemory
)
{
if
((
convert
!=
NO_CONVERSION
)
&&
This
->
resource
.
allocatedMemory
)
{
int
width
=
This
->
glRect
.
right
-
This
->
glRect
.
left
;
int
height
=
This
->
glRect
.
bottom
-
This
->
glRect
.
top
;
int
row
;
int
pitch
=
IWineD3DSurface_GetPitch
(
iface
)
;
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
width
*
height
*
bpp
);
if
(
!
mem
)
{
...
...
@@ -1825,14 +1823,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
for
(
row
=
This
->
glRect
.
top
;
row
<
This
->
glRect
.
bottom
;
row
++
)
{
BYTE
*
cur
=
This
->
resource
.
allocatedMemory
+
row
*
This
->
pow2Width
*
This
->
bytesPerPixel
;
d3dfmt_convert_surface
(
cur
+
This
->
glRect
.
left
*
This
->
bytesPerPixel
,
mem
+
row
*
width
*
bpp
,
width
,
convert
,
This
);
}
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
*
height
,
convert
,
This
);
/* Make sure the correct pitch is used */
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
pitch
);
This
->
Flags
|=
SFLAG_CONVERTED
;
}
else
{
This
->
Flags
&=
~
SFLAG_CONVERTED
;
...
...
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