Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
d1c32963
Commit
d1c32963
authored
Jun 10, 2011
by
twiz@chromium.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct usage of GetVersion() windows calls. Review:
http://codereview.appspot.com/4579049
git-svn-id:
https://angleproject.googlecode.com/svn/trunk@688
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
5601ea0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Surface.cpp
src/libEGL/Surface.cpp
+19
-2
No files found.
src/libEGL/Surface.cpp
View file @
d1c32963
...
...
@@ -22,6 +22,23 @@
namespace
egl
{
namespace
{
const
int
versionWindowsVista
=
MAKEWORD
(
0x00
,
0x06
);
const
int
versionWindows7
=
MAKEWORD
(
0x01
,
0x06
);
// Return the version of the operating system in a format suitable for ordering
// comparison.
int
getComparableOSVersion
()
{
DWORD
version
=
GetVersion
();
int
majorVersion
=
LOBYTE
(
LOWORD
(
version
));
int
minorVersion
=
HIBYTE
(
LOWORD
(
version
));
return
MAKEWORD
(
minorVersion
,
majorVersion
);
}
}
Surface
::
Surface
(
Display
*
display
,
const
Config
*
config
,
HWND
window
)
:
mDisplay
(
display
),
mConfig
(
config
),
mWindow
(
window
)
{
...
...
@@ -78,7 +95,7 @@ bool Surface::initialize()
// Modify present parameters for this window, if we are composited,
// to minimize the amount of queuing done by DWM between our calls to
// present and the actual screen.
if
(
mWindow
&&
(
LOWORD
(
GetVersion
())
>=
0x60
))
{
if
(
mWindow
&&
(
getComparableOSVersion
()
>=
versionWindowsVista
))
{
BOOL
isComposited
;
HRESULT
result
=
DwmIsCompositionEnabled
(
&
isComposited
);
if
(
SUCCEEDED
(
result
)
&&
isComposited
)
{
...
...
@@ -165,7 +182,7 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
D3DPRESENT_PARAMETERS
presentParameters
=
{
0
};
HRESULT
result
;
bool
useFlipEx
=
(
LOWORD
(
GetVersion
())
>=
0x61
)
&&
mDisplay
->
isD3d9ExDevice
();
bool
useFlipEx
=
(
getComparableOSVersion
()
>=
versionWindows7
)
&&
mDisplay
->
isD3d9ExDevice
();
// FlipEx causes unseemly stretching when resizing windows AND when one
// draws outside of the WM_PAINT callback. While this is seldom a problem in
...
...
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