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
f3aa4812
Commit
f3aa4812
authored
Mar 23, 2014
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Track if a context's private hdc has had its pixel format set, so we…
wined3d: Track if a context's private hdc has had its pixel format set, so we don't need to check it.
parent
27287382
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
context.c
dlls/wined3d/context.c
+17
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/context.c
View file @
f3aa4812
...
...
@@ -753,9 +753,13 @@ static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
static
BOOL
context_set_pixel_format
(
struct
wined3d_context
*
context
,
HDC
dc
,
BOOL
private
,
int
format
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
int
current
=
GetPixelFormat
(
dc
)
;
int
current
;
if
(
current
==
format
)
return
TRUE
;
if
(
dc
==
context
->
hdc
&&
context
->
hdc_is_private
&&
context
->
hdc_has_format
)
return
TRUE
;
current
=
GetPixelFormat
(
dc
);
if
(
current
==
format
)
goto
success
;
if
(
!
current
)
{
...
...
@@ -769,7 +773,7 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
context
->
restore_pf
=
0
;
context
->
restore_pf_win
=
private
?
NULL
:
WindowFromDC
(
dc
);
return
TRUE
;
goto
success
;
}
/* By default WGL doesn't allow pixel format adjustments but we need it
...
...
@@ -796,7 +800,7 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
context
->
restore_pf_win
=
win
;
}
return
TRUE
;
goto
success
;
}
/* OpenGL doesn't allow pixel format adjustments. Print an error and
...
...
@@ -806,6 +810,11 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
ERR
(
"Unable to set pixel format %d on device context %p. Already using format %d.
\n
"
,
format
,
dc
,
current
);
return
TRUE
;
success:
if
(
dc
==
context
->
hdc
&&
context
->
hdc_is_private
)
context
->
hdc_has_format
=
TRUE
;
return
TRUE
;
}
static
BOOL
context_set_gl_context
(
struct
wined3d_context
*
ctx
)
...
...
@@ -891,6 +900,7 @@ static void context_update_window(struct wined3d_context *context)
context
->
win_handle
=
context
->
swapchain
->
win_handle
;
context
->
hdc_is_private
=
FALSE
;
context
->
hdc_has_format
=
FALSE
;
context
->
needs_set
=
1
;
context
->
valid
=
1
;
...
...
@@ -1120,7 +1130,8 @@ static void context_enter(struct wined3d_context *context)
context
->
restore_dc
=
wglGetCurrentDC
();
context
->
needs_set
=
1
;
}
else
if
(
!
context
->
needs_set
&&
context
->
pixel_format
!=
GetPixelFormat
(
context
->
hdc
))
else
if
(
!
context
->
needs_set
&&
!
(
context
->
hdc_is_private
&&
context
->
hdc_has_format
)
&&
context
->
pixel_format
!=
GetPixelFormat
(
context
->
hdc
))
context
->
needs_set
=
1
;
}
}
...
...
@@ -1521,6 +1532,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
ret
->
win_handle
=
swapchain
->
win_handle
;
ret
->
hdc
=
hdc
;
ret
->
hdc_is_private
=
hdc_is_private
;
ret
->
hdc_has_format
=
TRUE
;
ret
->
pixel_format
=
pixel_format
;
ret
->
needs_set
=
1
;
...
...
dlls/wined3d/wined3d_private.h
View file @
f3aa4812
...
...
@@ -1087,7 +1087,8 @@ struct wined3d_context
DWORD
rebind_fbo
:
1
;
DWORD
needs_set
:
1
;
DWORD
hdc_is_private
:
1
;
DWORD
padding
:
17
;
DWORD
hdc_has_format
:
1
;
/* only meaningful if hdc_is_private */
DWORD
padding
:
16
;
DWORD
shader_update_mask
;
DWORD
constant_update_mask
;
DWORD
numbered_array_mask
;
...
...
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