Remove unnecessary "#if def"s and type conversion in windows compilation.

Remove unnecessary "#if def"s.
Forward declare IUnknown in Surface.h.
Change Surface.GetCoreWindow's return type to IUnknown*.
Remove unnecessary type conversion in SwapChainD3D12.cpp.

Bug: dawn:766
Change-Id: Id9f4ae20a5ed52fe8338d4e1673588c828c4c5df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50080
Commit-Queue: 陈俊嘉 <cjj19970505@live.cn>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
陈俊嘉
2021-05-06 08:28:44 +00:00
committed by Commit Bot service account
parent 26f4383c6a
commit e7a5fabf48
3 changed files with 12 additions and 11 deletions

View File

@@ -124,11 +124,9 @@ namespace dawn_native {
mType = Type::MetalLayer;
mMetalLayer = metalDesc->layer;
} else if (hwndDesc) {
#if defined(DAWN_PLATFORM_WIN32)
mType = Type::WindowsHWND;
mHInstance = hwndDesc->hinstance;
mHWND = hwndDesc->hwnd;
#endif // defined(DAWN_PLATFORM_WIN32)
} else if (coreWindowDesc) {
#if defined(DAWN_PLATFORM_WINDOWS)
mType = Type::WindowsCoreWindow;
@@ -180,7 +178,7 @@ namespace dawn_native {
return mHWND;
}
void* Surface::GetCoreWindow() const {
IUnknown* Surface::GetCoreWindow() const {
ASSERT(mType == Type::WindowsCoreWindow);
#if defined(DAWN_PLATFORM_WINDOWS)
return mCoreWindow.Get();