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
f5307025
Commit
f5307025
authored
Sep 26, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Pre-compute the color shifts for the supported XRender formats.
parent
46f1d2a4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-2
xrender.c
dlls/winex11.drv/xrender.c
+24
-13
No files found.
dlls/winex11.drv/x11drv.h
View file @
f5307025
...
@@ -108,8 +108,8 @@ typedef struct {
...
@@ -108,8 +108,8 @@ typedef struct {
typedef
struct
typedef
struct
{
{
ChannelShift
physicalRed
,
physical
Blue
,
physicalGreen
;
ChannelShift
physicalRed
,
physical
Green
,
physicalBlue
;
ChannelShift
logicalRed
,
logical
Blue
,
logicalGreen
;
ChannelShift
logicalRed
,
logical
Green
,
logicalBlue
;
}
ColorShifts
;
}
ColorShifts
;
/* X physical bitmap */
/* X physical bitmap */
...
...
dlls/winex11.drv/xrender.c
View file @
f5307025
...
@@ -104,6 +104,23 @@ static const WineXRenderFormatTemplate wxr_formats_template[WXR_NB_FORMATS] =
...
@@ -104,6 +104,23 @@ static const WineXRenderFormatTemplate wxr_formats_template[WXR_NB_FORMATS] =
/* WXR_FORMAT_B8G8R8X8 */
{
32
,
0
,
0
,
8
,
0xff
,
16
,
0xff
,
24
,
0xff
},
/* WXR_FORMAT_B8G8R8X8 */
{
32
,
0
,
0
,
8
,
0xff
,
16
,
0xff
,
24
,
0xff
},
};
};
static
const
ColorShifts
wxr_color_shifts
[
WXR_NB_FORMATS
]
=
{
/* format phys red phys green phys blue log red log green log blue */
/* WXR_FORMAT_MONO */
{
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
}
},
/* WXR_FORMAT_GRAY */
{
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
}
},
/* WXR_FORMAT_X1R5G5B5 */
{
{
10
,
5
,
31
},
{
5
,
5
,
31
},
{
0
,
5
,
31
},
{
10
,
5
,
31
},
{
5
,
5
,
31
},
{
0
,
5
,
31
}
},
/* WXR_FORMAT_X1B5G5R5 */
{
{
0
,
5
,
31
},
{
5
,
5
,
31
},
{
10
,
5
,
31
},
{
0
,
5
,
31
},
{
5
,
5
,
31
},
{
10
,
5
,
31
}
},
/* WXR_FORMAT_R5G6B5 */
{
{
11
,
5
,
31
},
{
5
,
6
,
63
},
{
0
,
5
,
31
},
{
11
,
5
,
31
},
{
5
,
6
,
63
},
{
0
,
5
,
31
}
},
/* WXR_FORMAT_B5G6R5 */
{
{
0
,
5
,
31
},
{
5
,
6
,
63
},
{
11
,
5
,
31
},
{
0
,
5
,
31
},
{
5
,
6
,
63
},
{
11
,
5
,
31
}
},
/* WXR_FORMAT_R8G8B8 */
{
{
16
,
8
,
255
},
{
8
,
8
,
255
},
{
0
,
8
,
255
},
{
16
,
8
,
255
},
{
8
,
8
,
255
},
{
0
,
8
,
255
}
},
/* WXR_FORMAT_B8G8R8 */
{
{
0
,
8
,
255
},
{
8
,
8
,
255
},
{
16
,
8
,
255
},
{
0
,
8
,
255
},
{
8
,
8
,
255
},
{
16
,
8
,
255
}
},
/* WXR_FORMAT_A8R8G8B8 */
{
{
16
,
8
,
255
},
{
8
,
8
,
255
},
{
0
,
8
,
255
},
{
16
,
8
,
255
},
{
8
,
8
,
255
},
{
0
,
8
,
255
}
},
/* WXR_FORMAT_B8G8R8A8 */
{
{
8
,
8
,
255
},
{
16
,
8
,
255
},
{
24
,
8
,
255
},
{
8
,
8
,
255
},
{
16
,
8
,
255
},
{
24
,
8
,
255
}
},
/* WXR_FORMAT_X8R8G8B8 */
{
{
16
,
8
,
255
},
{
8
,
8
,
255
},
{
0
,
8
,
255
},
{
16
,
8
,
255
},
{
8
,
8
,
255
},
{
0
,
8
,
255
}
},
/* WXR_FORMAT_B8G8R8X8 */
{
{
8
,
8
,
255
},
{
16
,
8
,
255
},
{
24
,
8
,
255
},
{
8
,
8
,
255
},
{
16
,
8
,
255
},
{
24
,
8
,
255
}
},
};
static
enum
wxr_format
default_format
=
WXR_INVALID_FORMAT
;
static
enum
wxr_format
default_format
=
WXR_INVALID_FORMAT
;
static
XRenderPictFormat
*
pict_formats
[
WXR_NB_FORMATS
+
1
/* invalid format */
];
static
XRenderPictFormat
*
pict_formats
[
WXR_NB_FORMATS
+
1
/* invalid format */
];
...
@@ -1230,8 +1247,7 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID
...
@@ -1230,8 +1247,7 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID
*/
*/
static
BOOL
xrenderdrv_CreateBitmap
(
PHYSDEV
dev
,
HBITMAP
hbitmap
)
static
BOOL
xrenderdrv_CreateBitmap
(
PHYSDEV
dev
,
HBITMAP
hbitmap
)
{
{
XRenderPictFormat
*
pict_format
=
NULL
;
enum
wxr_format
format
=
WXR_INVALID_FORMAT
;
ColorShifts
shifts
;
BITMAP
bitmap
;
BITMAP
bitmap
;
if
(
!
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
))
return
FALSE
;
if
(
!
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
))
return
FALSE
;
...
@@ -1240,20 +1256,15 @@ static BOOL xrenderdrv_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap )
...
@@ -1240,20 +1256,15 @@ static BOOL xrenderdrv_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap )
{
{
switch
(
bitmap
.
bmBitsPixel
)
switch
(
bitmap
.
bmBitsPixel
)
{
{
case
16
:
pict_format
=
pict_formats
[
WXR_FORMAT_R5G6B5
]
;
break
;
case
16
:
format
=
WXR_FORMAT_R5G6B5
;
break
;
case
24
:
pict_format
=
pict_formats
[
WXR_FORMAT_R8G8B8
]
;
break
;
case
24
:
format
=
WXR_FORMAT_R8G8B8
;
break
;
case
32
:
pict_format
=
pict_formats
[
WXR_FORMAT_A8R8G8B8
]
;
break
;
case
32
:
format
=
WXR_FORMAT_A8R8G8B8
;
break
;
}
}
}
}
if
(
pict_format
)
if
(
pict_formats
[
format
])
{
return
X11DRV_create_phys_bitmap
(
hbitmap
,
&
bitmap
,
pict_formats
[
format
]
->
depth
,
X11DRV_PALETTE_ComputeColorShifts
(
&
shifts
,
TRUE
,
&
wxr_color_shifts
[
format
]
);
pict_format
->
direct
.
redMask
<<
pict_format
->
direct
.
red
,
pict_format
->
direct
.
greenMask
<<
pict_format
->
direct
.
green
,
pict_format
->
direct
.
blueMask
<<
pict_format
->
direct
.
blue
);
return
X11DRV_create_phys_bitmap
(
hbitmap
,
&
bitmap
,
pict_format
->
depth
,
TRUE
,
&
shifts
);
}
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pCreateBitmap
);
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pCreateBitmap
);
return
dev
->
funcs
->
pCreateBitmap
(
dev
,
hbitmap
);
return
dev
->
funcs
->
pCreateBitmap
(
dev
,
hbitmap
);
...
...
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