Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0c5e7a6d
Commit
0c5e7a6d
authored
Apr 05, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Apr 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a dib primitive function table.
parent
ea8b32ce
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
0 deletions
+73
-0
Makefile.in
dlls/gdi32/Makefile.in
+1
-0
dc.c
dlls/gdi32/dibdrv/dc.c
+20
-0
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+8
-0
primitives.c
dlls/gdi32/dibdrv/primitives.c
+42
-0
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-0
No files found.
dlls/gdi32/Makefile.in
View file @
0c5e7a6d
...
...
@@ -15,6 +15,7 @@ C_SRCS = \
dc.c
\
dib.c
\
dibdrv/dc.c
\
dibdrv/primitives.c
\
driver.c
\
enhmetafile.c
\
enhmfdrv/bitblt.c
\
...
...
dlls/gdi32/dibdrv/dc.c
View file @
0c5e7a6d
...
...
@@ -36,6 +36,13 @@ static BOOL CDECL dibdrv_DeleteDC( PHYSDEV dev )
return
0
;
}
static
void
init_bit_fields
(
dib_info
*
dib
,
const
DWORD
*
bit_fields
)
{
dib
->
red_mask
=
bit_fields
[
0
];
dib
->
green_mask
=
bit_fields
[
1
];
dib
->
blue_mask
=
bit_fields
[
2
];
}
static
BOOL
init_dib
(
dib_info
*
dib
,
const
BITMAPINFOHEADER
*
bi
,
const
DWORD
*
bit_fields
,
void
*
bits
)
{
dib
->
bit_count
=
bi
->
biBitCount
;
...
...
@@ -55,8 +62,21 @@ static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit
dib
->
stride
=
-
dib
->
stride
;
}
dib
->
funcs
=
&
funcs_null
;
switch
(
dib
->
bit_count
)
{
case
32
:
init_bit_fields
(
dib
,
bit_fields
);
if
(
dib
->
red_mask
==
0xff0000
&&
dib
->
green_mask
==
0x00ff00
&&
dib
->
blue_mask
==
0x0000ff
)
dib
->
funcs
=
&
funcs_8888
;
else
{
TRACE
(
"32 bpp bitmasks not supported, will forward to graphics driver.
\n
"
);
return
FALSE
;
}
break
;
default:
TRACE
(
"bpp %d not supported, will forward to graphics driver.
\n
"
,
dib
->
bit_count
);
return
FALSE
;
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
0c5e7a6d
...
...
@@ -22,3 +22,11 @@ static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev )
{
return
(
dibdrv_physdev
*
)
dev
;
}
typedef
struct
primitive_funcs
{
DWORD
(
*
colorref_to_pixel
)(
const
dib_info
*
dib
,
COLORREF
color
);
}
primitive_funcs
;
extern
const
primitive_funcs
funcs_8888
DECLSPEC_HIDDEN
;
extern
const
primitive_funcs
funcs_null
DECLSPEC_HIDDEN
;
dlls/gdi32/dibdrv/primitives.c
0 → 100644
View file @
0c5e7a6d
/*
* DIB driver primitives.
*
* Copyright 2011 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "gdi_private.h"
#include "dibdrv.h"
static
DWORD
colorref_to_pixel_888
(
const
dib_info
*
dib
,
COLORREF
color
)
{
return
(
((
color
>>
16
)
&
0xff
)
|
(
color
&
0xff00
)
|
((
color
<<
16
)
&
0xff0000
)
);
}
static
DWORD
colorref_to_pixel_null
(
const
dib_info
*
dib
,
COLORREF
color
)
{
return
0
;
}
const
primitive_funcs
funcs_8888
=
{
colorref_to_pixel_888
};
const
primitive_funcs
funcs_null
=
{
colorref_to_pixel_null
};
dlls/gdi32/gdi_private.h
View file @
0c5e7a6d
...
...
@@ -86,6 +86,8 @@ typedef struct
void
*
bits
;
/* points to the top-left corner of the dib. */
DWORD
red_mask
,
green_mask
,
blue_mask
;
const
struct
primitive_funcs
*
funcs
;
}
dib_info
;
typedef
struct
dibdrv_physdev
...
...
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