Commit fc2521e1 by Jamie Madill

Fix build on Windows 8.1 SDK.

The Windows 8.1 SDK includes a new DLL compiler DLL, and is useful to test against, so we should fix the few deprecated functions and warnings. BUG=angle:649 Change-Id: I28bcf49564f3f7d7403d939d61dd78d3972281ba Reviewed-on: https://chromium-review.googlesource.com/199341Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 2d76e5f6
......@@ -28,7 +28,7 @@ debug.txt
*.orig
*.rej
.gclient_entries
third_party
/third_party
tests/third_party
out
lib/*
......
......@@ -453,6 +453,7 @@ void Win32Window::destroy()
{
eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglTerminate(mDisplay);
mDisplay = EGL_NO_DISPLAY;
}
if (mNativeDisplay)
......
......@@ -36,7 +36,7 @@
'sources':
[
'<!@(python <(angle_path)/enumerate_files.py \
-dirs common libGLESv2 third_party/murmurhash ../include \
-dirs common libGLESv2 third_party/murmurhash ../include third_party/systeminfo \
-types *.cpp *.h *.hlsl *.vs *.ps *.bat *.def *.rc \
-excludes */d3d/* */d3d9/* */d3d11/*)',
],
......
......@@ -19,19 +19,6 @@
#define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL1
#endif
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.
inline int getComparableOSVersion()
{
DWORD version = GetVersion();
int majorVersion = LOBYTE(LOWORD(version));
int minorVersion = HIBYTE(LOWORD(version));
return MAKEWORD(minorVersion, majorVersion);
}
namespace egl
{
class Display;
......
......@@ -161,7 +161,7 @@ D3D11_FILTER ConvertFilter(GLenum minFilter, GLenum magFilter, float maxAnisotro
if (maxAnisotropy > 1.0f)
{
return D3D11_ENCODE_ANISOTROPIC_FILTER(comparison);
return D3D11_ENCODE_ANISOTROPIC_FILTER(static_cast<D3D11_COMPARISON_FUNC>(comparison));
}
else
{
......@@ -186,7 +186,7 @@ D3D11_FILTER ConvertFilter(GLenum minFilter, GLenum magFilter, float maxAnisotro
default: UNREACHABLE();
}
return D3D11_ENCODE_BASIC_FILTER(dxMin, dxMag, dxMip, comparison);
return D3D11_ENCODE_BASIC_FILTER(dxMin, dxMag, dxMip, static_cast<D3D11_COMPARISON_FUNC>(comparison));
}
}
......
......@@ -35,6 +35,7 @@
#include "libEGL/Display.h"
#include "third_party/trace_event/trace_event.h"
#include "third_party/systeminfo/SystemInfo.h"
// Can also be enabled by defining FORCE_REF_RAST in the project's predefined macros
#define REF_RAST 0
......@@ -266,7 +267,7 @@ EGLint Renderer9::initialize()
mSupportsNonPower2Textures = !(mDeviceCaps.TextureCaps & D3DPTEXTURECAPS_POW2) &&
!(mDeviceCaps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2) &&
!(mDeviceCaps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) &&
!(getComparableOSVersion() < versionWindowsVista && mAdapterIdentifier.VendorId == VENDOR_ID_AMD);
!(!isWindowsVistaOrGreater() && mAdapterIdentifier.VendorId == VENDOR_ID_AMD);
// Must support a minimum of 2:1 anisotropy for max anisotropy to be considered supported, per the spec
mSupportsTextureFilterAnisotropy = ((mDeviceCaps.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) && (mDeviceCaps.MaxAnisotropy >= 2));
......
/*
* Copyright (C) 2009 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if _WIN32_WINNT_WINBLUE
#include <versionhelpers.h>
#endif
#include <windows.h>
namespace rx {
#ifndef _WIN32_WINNT_WINBLUE
static bool IsWindowsVistaOrGreater()
{
OSVERSIONINFOEXW osvi = { };
osvi.dwOSVersionInfoSize = sizeof(osvi);
osvi.dwMajorVersion = HIBYTE(_WIN32_WINNT_VISTA);
osvi.dwMinorVersion = LOBYTE(_WIN32_WINNT_VISTA);
DWORDLONG condition = 0;
VER_SET_CONDITION(condition, VER_MAJORVERSION, VER_GREATER_EQUAL);
VER_SET_CONDITION(condition, VER_MINORVERSION, VER_GREATER_EQUAL);
return !!::VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION, condition);
}
#endif
bool isWindowsVistaOrGreater()
{
static bool initialized = false;
static bool cachedIsWindowsVistaOrGreater;
if (!initialized) {
initialized = true;
cachedIsWindowsVistaOrGreater = IsWindowsVistaOrGreater();
}
return cachedIsWindowsVistaOrGreater;
}
} // namespace rx
/*
* Copyright (C) 2009 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SystemInfo_h
#define SystemInfo_h
namespace rx {
bool isWindowsVistaOrGreater();
} // namespace rx
#endif // SystemInfo_h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment