OSDN Git Service

Merge in ANGLE r701 and r688
authorJohn Bauman <jbauman@google.com>
Tue, 6 May 2014 19:09:45 +0000 (15:09 -0400)
committerNicolas Capens <capn@google.com>
Tue, 6 May 2014 19:09:45 +0000 (15:09 -0400)
This wasn't delay-loading dwmapi.dll, causing it to fail on XP.
Review URL: https://chromereviews.googleplex.com/3895016

src/OpenGL ES 2.0/libEGL/Surface.cpp
src/OpenGL ES 2.0/libEGL/libEGL.vcproj

index d340e1b..456bf01 100644 (file)
 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)
 {
@@ -80,7 +96,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);
index adf527d..68b041f 100644 (file)
                                AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"\r
                                LinkIncremental="1"\r
                                ModuleDefinitionFile="libEGL.def"\r
-                               DelayLoadDLLs="dwmapi.lib"\r
+                               DelayLoadDLLs="dwmapi.dll"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r