Commit 2e5dd41c by Geoff Lang

Fix warnings from shadowed variables in DXGISwapChainWindowSurfaceWGL.

BUG=540829 Change-Id: I3595f316afa1897224ad95d6f9a3da3685aa0831 Reviewed-on: https://chromium-review.googlesource.com/324032 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 3e1b4f80
...@@ -223,9 +223,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::bindTexImage(gl::Texture *texture, EGL ...@@ -223,9 +223,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::bindTexImage(gl::Texture *texture, EGL
SafeRelease(colorBuffer); SafeRelease(colorBuffer);
if (mTextureHandle == nullptr) if (mTextureHandle == nullptr)
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%08x.", return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%08x.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
if (!mFunctionsWGL->dxLockObjectsNV(mDeviceHandle, 1, &mTextureHandle)) if (!mFunctionsWGL->dxLockObjectsNV(mDeviceHandle, 1, &mTextureHandle))
...@@ -233,9 +232,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::bindTexImage(gl::Texture *texture, EGL ...@@ -233,9 +232,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::bindTexImage(gl::Texture *texture, EGL
mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mTextureHandle); mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mTextureHandle);
mTextureHandle = nullptr; mTextureHandle = nullptr;
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to lock D3D object, error: 0x%08x.", return egl::Error(EGL_BAD_ALLOC, "Failed to lock D3D object, error: 0x%08x.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
mTextureID = textureID; mTextureID = textureID;
...@@ -249,16 +247,14 @@ egl::Error DXGISwapChainWindowSurfaceWGL::releaseTexImage(EGLint buffer) ...@@ -249,16 +247,14 @@ egl::Error DXGISwapChainWindowSurfaceWGL::releaseTexImage(EGLint buffer)
if (!mFunctionsWGL->dxUnlockObjectsNV(mDeviceHandle, 1, &mTextureHandle)) if (!mFunctionsWGL->dxUnlockObjectsNV(mDeviceHandle, 1, &mTextureHandle))
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to unlock D3D object, error: 0x%08x.", return egl::Error(EGL_BAD_ALLOC, "Failed to unlock D3D object, error: 0x%08x.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
if (!mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mTextureHandle)) if (!mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mTextureHandle))
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to unregister D3D object, error: 0x%08x.", return egl::Error(EGL_BAD_ALLOC, "Failed to unregister D3D object, error: 0x%08x.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
mTextureID = 0; mTextureID = 0;
...@@ -315,18 +311,16 @@ egl::Error DXGISwapChainWindowSurfaceWGL::setObjectsLocked(bool locked) ...@@ -315,18 +311,16 @@ egl::Error DXGISwapChainWindowSurfaceWGL::setObjectsLocked(bool locked)
{ {
if (!mFunctionsWGL->dxLockObjectsNV(mDeviceHandle, count, resources)) if (!mFunctionsWGL->dxLockObjectsNV(mDeviceHandle, count, resources))
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to lock object, error: 0x%08x.", return egl::Error(EGL_BAD_ALLOC, "Failed to lock object, error: 0x%08x.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
} }
else else
{ {
if (!mFunctionsWGL->dxUnlockObjectsNV(mDeviceHandle, count, resources)) if (!mFunctionsWGL->dxUnlockObjectsNV(mDeviceHandle, count, resources))
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to lock object, error: 0x%08x.", return egl::Error(EGL_BAD_ALLOC, "Failed to lock object, error: 0x%08x.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
} }
...@@ -500,9 +494,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::createSwapChain() ...@@ -500,9 +494,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::createSwapChain()
SafeRelease(colorBuffer); SafeRelease(colorBuffer);
if (mRenderbufferBufferHandle == nullptr) if (mRenderbufferBufferHandle == nullptr)
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%X.", return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%X.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
// Rebind the surface to the texture if needed. // Rebind the surface to the texture if needed.
...@@ -512,9 +505,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::createSwapChain() ...@@ -512,9 +505,8 @@ egl::Error DXGISwapChainWindowSurfaceWGL::createSwapChain()
GL_TEXTURE_2D, WGL_ACCESS_READ_WRITE_NV); GL_TEXTURE_2D, WGL_ACCESS_READ_WRITE_NV);
if (mTextureHandle == nullptr) if (mTextureHandle == nullptr)
{ {
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%X.", return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%X.",
HRESULT_CODE(error)); HRESULT_CODE(GetLastError()));
} }
} }
......
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