Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
3b07663b
Commit
3b07663b
authored
Aug 31, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Convert the colors to the surface format for colorfill.
parent
29be9013
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
2 deletions
+111
-2
device.c
dlls/wined3d/device.c
+111
-2
No files found.
dlls/wined3d/device.c
View file @
3b07663b
...
...
@@ -5659,6 +5659,113 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS
}
}
static
inline
DWORD
argb_to_fmt
(
DWORD
color
,
WINED3DFORMAT
destfmt
)
{
unsigned
int
r
,
g
,
b
,
a
;
DWORD
ret
;
if
(
destfmt
==
WINED3DFMT_A8R8G8B8
||
destfmt
==
WINED3DFMT_X8R8G8B8
||
destfmt
==
WINED3DFMT_R8G8B8
)
return
color
;
TRACE
(
"Converting color %08x to format %s
\n
"
,
color
,
debug_d3dformat
(
destfmt
));
a
=
(
color
&
0xff000000
)
>>
24
;
r
=
(
color
&
0x00ff0000
)
>>
16
;
g
=
(
color
&
0x0000ff00
)
>>
8
;
b
=
(
color
&
0x000000ff
)
>>
0
;
switch
(
destfmt
)
{
case
WINED3DFMT_R5G6B5
:
if
(
r
==
0xff
&&
g
==
0xff
&&
b
==
0xff
)
return
0xffff
;
r
=
(
r
*
32
)
/
256
;
g
=
(
g
*
64
)
/
256
;
b
=
(
b
*
32
)
/
256
;
ret
=
r
<<
11
;
ret
|=
g
<<
5
;
ret
|=
b
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
case
WINED3DFMT_X1R5G5B5
:
case
WINED3DFMT_A1R5G5B5
:
a
=
(
a
*
2
)
/
256
;
r
=
(
r
*
32
)
/
256
;
g
=
(
g
*
32
)
/
256
;
b
=
(
b
*
32
)
/
256
;
ret
=
a
<<
15
;
ret
|=
r
<<
10
;
ret
|=
g
<<
5
;
ret
|=
b
<<
0
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
case
WINED3DFMT_A8
:
TRACE
(
"Returning %08x
\n
"
,
a
);
return
a
;
case
WINED3DFMT_X4R4G4B4
:
case
WINED3DFMT_A4R4G4B4
:
a
=
(
a
*
16
)
/
256
;
r
=
(
r
*
16
)
/
256
;
g
=
(
g
*
16
)
/
256
;
b
=
(
b
*
16
)
/
256
;
ret
=
a
<<
12
;
ret
|=
r
<<
8
;
ret
|=
g
<<
4
;
ret
|=
b
<<
0
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
case
WINED3DFMT_R3G3B2
:
r
=
(
r
*
8
)
/
256
;
g
=
(
g
*
8
)
/
256
;
b
=
(
b
*
4
)
/
256
;
ret
=
r
<<
5
;
ret
|=
g
<<
2
;
ret
|=
b
<<
0
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
case
WINED3DFMT_X8B8G8R8
:
case
WINED3DFMT_A8B8G8R8
:
ret
=
a
<<
24
;
ret
|=
b
<<
16
;
ret
|=
g
<<
8
;
ret
|=
r
<<
0
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
case
WINED3DFMT_A2R10G10B10
:
a
=
(
a
*
4
)
/
256
;
r
=
(
r
*
1024
)
/
256
;
g
=
(
g
*
1024
)
/
256
;
b
=
(
b
*
1024
)
/
256
;
ret
=
a
<<
30
;
ret
|=
r
<<
20
;
ret
|=
g
<<
10
;
ret
|=
b
<<
0
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
case
WINED3DFMT_A2B10G10R10
:
a
=
(
a
*
4
)
/
256
;
r
=
(
r
*
1024
)
/
256
;
g
=
(
g
*
1024
)
/
256
;
b
=
(
b
*
1024
)
/
256
;
ret
=
a
<<
30
;
ret
|=
b
<<
20
;
ret
|=
g
<<
10
;
ret
|=
r
<<
0
;
TRACE
(
"Returning %08x
\n
"
,
ret
);
return
ret
;
default
:
FIXME
(
"Add a COLORFILL conversion for format %s
\n
"
,
debug_d3dformat
(
destfmt
));
return
0
;
}
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_ColorFill
(
IWineD3DDevice
*
iface
,
IWineD3DSurface
*
pSurface
,
CONST
WINED3DRECT
*
pRect
,
WINED3DCOLOR
color
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
pSurface
;
...
...
@@ -5677,7 +5784,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD
/* Just forward this to the DirectDraw blitting engine */
memset
(
&
BltFx
,
0
,
sizeof
(
BltFx
));
BltFx
.
dwSize
=
sizeof
(
BltFx
);
BltFx
.
u5
.
dwFillColor
=
color
;
BltFx
.
u5
.
dwFillColor
=
argb_to_fmt
(
color
,
surface
->
resource
.
format
)
;
return
IWineD3DSurface_Blt
(
pSurface
,
(
RECT
*
)
pRect
,
NULL
,
NULL
,
WINEDDBLT_COLORFILL
,
&
BltFx
,
WINED3DTEXF_NONE
);
}
}
...
...
@@ -5794,8 +5901,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice
if
(
*
ppZStencilSurface
!=
NULL
)
{
/* Note inc ref on returned surface */
IWineD3DSurface_AddRef
(
*
ppZStencilSurface
);
}
return
WINED3D_OK
;
}
else
{
return
WINED3DERR_NOTFOUND
;
}
}
/* TODO: Handle stencil attachments */
...
...
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