Remove trailing whitespace.

TRAC #11024 Signed-off-by: Daniel Koch Author: Andrew Lewycky <andrew.lewycky@transgaming.com> git-svn-id: https://angleproject.googlecode.com/svn/trunk@11 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 1697302a
......@@ -74,7 +74,7 @@ class Config
class SortConfig
{
public:
explicit SortConfig(const EGLint *attribList);
explicit SortConfig(const EGLint *attribList);
bool operator()(const Config *x, const Config *y) const;
bool operator()(const Config &x, const Config &y) const;
......
......@@ -139,7 +139,7 @@ struct State
bool colorMaskBlue;
bool colorMaskAlpha;
bool depthMask;
int activeSampler; // Active texture unit selector - GL_TEXTURE0
GLuint arrayBuffer;
GLuint elementArrayBuffer;
......
......@@ -114,7 +114,7 @@ bool Display::initialize()
if (SUCCEEDED(result))
{
HRESULT result = mD3d9->CheckDepthStencilMatch(mAdapter, mDeviceType, currentDisplayMode.Format, renderTargetFormat, depthStencilFormat); // FIXME: Only accept color formats available both in fullscreen and windowed?
if (SUCCEEDED(result))
{
// FIXME: Enumerate multi-sampling
......@@ -273,7 +273,7 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config)
swapChain->Release();
}
return surface;
}
......
......@@ -99,12 +99,12 @@ void Surface::swap()
}
ASSERT(SUCCEEDED(result));
IDirect3DSurface9 *textureSurface;
texture->GetSurfaceLevel(0, &textureSurface);
device->StretchRect(mRenderTarget, NULL, textureSurface, NULL, D3DTEXF_POINT);
// Disable all pipeline operations
device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
......@@ -145,7 +145,7 @@ void Surface::swap()
{
return error(EGL_BAD_ALLOC);
}
textureSurface->Release();
texture->Release();
device->Release();
......
......@@ -39,43 +39,43 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
// Fall throught to initialize index
case DLL_THREAD_ATTACH:
{
egl::Current *current = (egl::Current*)LocalAlloc(LPTR, sizeof(egl::Current));
egl::Current *current = (egl::Current*)LocalAlloc(LPTR, sizeof(egl::Current));
if (current)
{
TlsSetValue(currentTLS, current);
current->error = EGL_SUCCESS;
current->API = EGL_OPENGL_ES_API;
}
}
break;
break;
case DLL_THREAD_DETACH:
{
void *current = TlsGetValue(currentTLS);
if (current)
{
LocalFree((HLOCAL)current);
}
}
break;
break;
case DLL_PROCESS_DETACH:
{
void *current = TlsGetValue(currentTLS);
if (current)
{
LocalFree((HLOCAL)current);
}
TlsFree(currentTLS);
}
break;
default:
break;
}
break;
default:
break;
}
return TRUE;
}
......
......@@ -27,7 +27,7 @@ class Buffer
~Buffer();
void storeData(GLsizeiptr size, const void *data);
IDirect3DVertexBuffer9 *getVertexBuffer();
IDirect3DIndexBuffer9 *getIndexBuffer();
......
......@@ -7,7 +7,7 @@
// Context.cpp: Implements the gl::Context class, managing all GL state and performing
// rendering operations. It is the GLES2 specific implementation of EGLContext.
#include "Context.h"
#include "Context.h"
#include <algorithm>
......@@ -537,7 +537,7 @@ void Context::setRenderbuffer(Renderbuffer *buffer)
Buffer *Context::getBuffer(unsigned int handle)
{
BufferMap::iterator buffer = mBufferMap.find(handle);
if (buffer == mBufferMap.end())
{
return NULL;
......@@ -551,7 +551,7 @@ Buffer *Context::getBuffer(unsigned int handle)
Shader *Context::getShader(unsigned int handle)
{
ShaderMap::iterator shader = mShaderMap.find(handle);
if (shader == mShaderMap.end())
{
return NULL;
......@@ -565,7 +565,7 @@ Shader *Context::getShader(unsigned int handle)
Program *Context::getProgram(unsigned int handle)
{
ProgramMap::iterator program = mProgramMap.find(handle);
if (program == mProgramMap.end())
{
return NULL;
......@@ -579,7 +579,7 @@ Program *Context::getProgram(unsigned int handle)
Texture *Context::getTexture(unsigned int handle)
{
TextureMap::iterator texture = mTextureMap.find(handle);
if (texture == mTextureMap.end())
{
return NULL;
......@@ -593,7 +593,7 @@ Texture *Context::getTexture(unsigned int handle)
Framebuffer *Context::getFramebuffer(unsigned int handle)
{
FramebufferMap::iterator framebuffer = mFramebufferMap.find(handle);
if (framebuffer == mFramebufferMap.end())
{
return NULL;
......@@ -607,7 +607,7 @@ Framebuffer *Context::getFramebuffer(unsigned int handle)
Renderbuffer *Context::getRenderbuffer(unsigned int handle)
{
RenderbufferMap::iterator renderbuffer = mRenderbufferMap.find(handle);
if (renderbuffer == mRenderbufferMap.end())
{
return NULL;
......@@ -929,7 +929,7 @@ void Context::applyVertexBuffer(int count)
{
if (vertexAttribute[attributeIndex].enabled && programObject->isActiveAttribute(attributeIndex))
{
GLuint boundBuffer = vertexAttribute[attributeIndex].boundBuffer;
GLuint boundBuffer = vertexAttribute[attributeIndex].boundBuffer;
UINT stride = vertexAttribute[attributeIndex].stride;
GLint size = vertexAttribute[attributeIndex].size;
GLenum type = vertexAttribute[attributeIndex].type;
......@@ -1402,7 +1402,7 @@ void Context::clear(GLbitfield mask)
const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) &&
(stencilWritemask & stencilUnmasked) != stencilUnmasked;
const bool needMaskedColorClear = (flags & D3DCLEAR_TARGET) &&
!(colorMaskRed && colorMaskGreen &&
!(colorMaskRed && colorMaskGreen &&
colorMaskBlue && alphaUnmasked);
if (needMaskedColorClear || needMaskedStencilClear)
......@@ -1435,7 +1435,7 @@ void Context::clear(GLbitfield mask)
device->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS);
device->SetRenderState(D3DRS_STENCILREF, stencil);
device->SetRenderState(D3DRS_STENCILWRITEMASK, stencilWritemask);
device->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE);
device->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE);
device->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE);
device->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE);
}
......@@ -1448,7 +1448,7 @@ void Context::clear(GLbitfield mask)
device->SetVertexShader(NULL);
device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
struct Vertex
struct Vertex
{
float x, y, z, w;
D3DCOLOR diffuse;
......
......@@ -82,7 +82,7 @@ void Framebuffer::detachRenderbuffer(GLuint renderbuffer)
IDirect3DSurface9 *Framebuffer::getRenderTarget()
{
Renderbuffer *colorbuffer = getColorbuffer();
if (colorbuffer)
{
return colorbuffer->getRenderTarget();
......@@ -95,7 +95,7 @@ IDirect3DSurface9 *Framebuffer::getDepthStencil()
{
gl::Context *context = gl::getContext();
Depthbuffer *depthbuffer = context->getDepthbuffer(mDepthbufferHandle);
if (depthbuffer)
{
return depthbuffer->getDepthStencil();
......@@ -131,7 +131,7 @@ Depthbuffer *Framebuffer::getDepthbuffer()
{
gl::Context *context = gl::getContext();
Depthbuffer *depthbuffer = context->getDepthbuffer(mDepthbufferHandle);
if (depthbuffer && depthbuffer->isDepthbuffer())
{
return depthbuffer;
......@@ -144,7 +144,7 @@ Stencilbuffer *Framebuffer::getStencilbuffer()
{
gl::Context *context = gl::getContext();
Stencilbuffer *stencilbuffer = context->getStencilbuffer(mStencilbufferHandle);
if (stencilbuffer && stencilbuffer->isStencilbuffer())
{
return stencilbuffer;
......
......@@ -419,7 +419,7 @@ void Program::link()
}
ASSERT(SUCCEEDED(vertexResult) && SUCCEEDED(pixelResult));
vertexBinary->Release();
pixelBinary->Release();
vertexBinary = NULL;
......@@ -435,14 +435,14 @@ void Program::link()
D3DXCONSTANTTABLE_DESC constantTableDescription;
D3DXCONSTANT_DESC constantDescription;
UINT descriptionCount = 1;
mConstantTablePS->GetDesc(&constantTableDescription);
for (unsigned int constantIndex = 0; constantIndex < constantTableDescription.Constants; constantIndex++)
{
D3DXHANDLE constantHandle = mConstantTablePS->GetConstant(0, constantIndex);
mConstantTablePS->GetConstantDesc(constantHandle, &constantDescription, &descriptionCount);
UniformArray::iterator uniform = mUniforms.begin();
while (uniform != mUniforms.end())
......@@ -831,7 +831,7 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
for (unsigned int samplerIndex = firstIndex; samplerIndex < firstIndex + count; samplerIndex++)
{
GLint mappedSampler = v[0];
if (mappedSampler >= 0 && mappedSampler < MAX_TEXTURE_IMAGE_UNITS)
{
if (samplerIndex >= 0 && samplerIndex < MAX_TEXTURE_IMAGE_UNITS)
......@@ -840,7 +840,7 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
}
}
}
return true;
}
}
......
......@@ -81,7 +81,7 @@ class Program
bool setUniform1iv(GLint location, GLsizei count, const GLint *v);
void applyUniforms();
void link();
bool isLinked();
......
......@@ -235,7 +235,7 @@ const char *VertexShader::linkHLSL(const char *pixelHLSL)
char varyingName[100];
int semanticIndex;
int matches = sscanf(input, "%s : TEXCOORD%d;", varyingName, &semanticIndex);
if (matches == 2)
{
ASSERT(semanticIndex < 10 && semanticIndex < MAX_VARYING_VECTORS);
......
......@@ -45,7 +45,7 @@ bool Texture::setMinFilter(GLenum filter)
return true;
default:
return false;
}
}
}
// Returns true on successful filter state update (valid enum parameter)
......@@ -442,7 +442,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget()
{
if (!mRenderTarget && getTexture())
{
mTexture->GetSurfaceLevel(0, &mRenderTarget);
mTexture->GetSurfaceLevel(0, &mRenderTarget);
}
return mRenderTarget;
......
......@@ -23,7 +23,7 @@ enum
{
MAX_TEXTURE_SIZE = 2048,
MAX_CUBE_MAP_TEXTURE_SIZE = 2048,
MAX_TEXTURE_LEVELS = 11 // log2 of MAX_TEXTURE_SIZE
};
......
......@@ -62,7 +62,7 @@ void __stdcall glAttachShader(GLuint program, GLuint shader)
{
gl::Program *programObject = context->getProgram(program);
gl::Shader *shaderObject = context->getShader(shader);
if (!programObject || !shaderObject)
{
return error(GL_INVALID_VALUE);
......@@ -96,7 +96,7 @@ void __stdcall glBindAttribLocation(GLuint program, GLuint index, const char* na
if (context)
{
gl::Program *programObject = context->getProgram(program);
if (!programObject)
{
return error(GL_INVALID_VALUE);
......@@ -436,7 +436,7 @@ void __stdcall glBufferData(GLenum target, GLsizeiptr size, const void* data, GL
if (context)
{
gl::Buffer *buffer;
switch (target)
{
case GL_ARRAY_BUFFER:
......@@ -619,7 +619,7 @@ void __stdcall glCompileShader(GLuint shader)
if (context)
{
gl::Shader *shaderObject = context->getShader(shader);
if (!shaderObject)
{
return error(GL_INVALID_VALUE);
......@@ -696,7 +696,7 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{
TRACE("GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d",
TRACE("GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d",
target, level, xoffset, yoffset, x, y, width, height);
try
......@@ -748,7 +748,7 @@ GLuint __stdcall glCreateShader(GLenum type)
switch (type)
{
case GL_FRAGMENT_SHADER:
case GL_VERTEX_SHADER:
case GL_VERTEX_SHADER:
return context->createShader(type);
default:
return error(GL_INVALID_ENUM, 0);
......@@ -1030,7 +1030,7 @@ void __stdcall glDetachShader(GLuint program, GLuint shader)
{
gl::Program *programObject = context->getProgram(program);
gl::Shader *shaderObject = context->getShader(shader);
if (!programObject || !shaderObject)
{
return error(GL_INVALID_VALUE);
......@@ -1906,7 +1906,7 @@ void __stdcall glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
if (context)
{
gl::Shader *shaderObject = context->getShader(shader);
if (!shaderObject)
{
return error(GL_INVALID_VALUE);
......@@ -2603,7 +2603,7 @@ void __stdcall glSampleCoverage(GLclampf value, GLboolean invert)
try
{
gl::Context* context = gl::getContext();
if (context)
{
context->sampleCoverageValue = gl::clamp01(value);
......@@ -2628,7 +2628,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
}
gl::Context* context = gl::getContext();
if (context)
{
context->scissorX = x;
......@@ -2645,7 +2645,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
void __stdcall glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
{
TRACE("GLsizei n = %d, const GLuint* shaders = 0x%0.8p, GLenum binaryformat = 0x%X, const void* binary = 0x%0.8p, GLsizei length = %d",
TRACE("GLsizei n = %d, const GLuint* shaders = 0x%0.8p, GLenum binaryformat = 0x%X, const void* binary = 0x%0.8p, GLsizei length = %d",
n, shaders, binaryformat, binary, length);
try
......@@ -2679,7 +2679,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const char** string,
if (context)
{
gl::Shader *shaderObject = context->getShader(shader);
if (!shaderObject)
{
return error(GL_INVALID_VALUE);
......@@ -2696,7 +2696,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const char** string,
void __stdcall glStencilFunc(GLenum func, GLint ref, GLuint mask)
{
glStencilFuncSeparate(GL_FRONT_AND_BACK, func, ref, mask);
glStencilFuncSeparate(GL_FRONT_AND_BACK, func, ref, mask);
}
void __stdcall glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
......@@ -2827,7 +2827,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
case GL_DECR:
case GL_INVERT:
case GL_INCR_WRAP:
case GL_DECR_WRAP:
case GL_DECR_WRAP:
break;
default:
return error(GL_INVALID_ENUM);
......@@ -2842,7 +2842,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
case GL_DECR:
case GL_INVERT:
case GL_INCR_WRAP:
case GL_DECR_WRAP:
case GL_DECR_WRAP:
break;
default:
return error(GL_INVALID_ENUM);
......@@ -2857,7 +2857,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
case GL_DECR:
case GL_INVERT:
case GL_INCR_WRAP:
case GL_DECR_WRAP:
case GL_DECR_WRAP:
break;
default:
return error(GL_INVALID_ENUM);
......@@ -2903,7 +2903,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
{
return error(GL_INVALID_VALUE);
}
switch (target)
{
case GL_TEXTURE_2D:
......
......@@ -28,10 +28,10 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
}
}
// Fall throught to initialize index
case DLL_THREAD_ATTACH:
case DLL_THREAD_ATTACH:
{
gl::Current *current = (gl::Current*)LocalAlloc(LPTR, sizeof(gl::Current));
gl::Current *current = (gl::Current*)LocalAlloc(LPTR, sizeof(gl::Current));
if (current)
{
TlsSetValue(currentTLS, current);
......@@ -40,17 +40,17 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
current->display = NULL;
}
}
break;
break;
case DLL_THREAD_DETACH:
{
void *current = TlsGetValue(currentTLS);
if (current)
{
LocalFree((HLOCAL)current);
}
}
break;
break;
case DLL_PROCESS_DETACH:
{
void *current = TlsGetValue(currentTLS);
......@@ -59,14 +59,14 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
LocalFree((HLOCAL)current);
}
TlsFree(currentTLS);
}
break;
default:
break;
}
break;
default:
break;
}
return TRUE;
}
......
......@@ -15,7 +15,7 @@
namespace es2dx
{
D3DCMPFUNC ConvertComparison(GLenum comparison)
D3DCMPFUNC ConvertComparison(GLenum comparison)
{
D3DCMPFUNC d3dComp = D3DCMP_ALWAYS;
switch (comparison)
......@@ -188,7 +188,7 @@ void ConvertMinFilter(GLenum minFilter, D3DTEXTUREFILTERTYPE *d3dMinFilter, D3DT
*d3dMinFilter = D3DTEXF_LINEAR;
*d3dMipFilter = D3DTEXF_LINEAR;
break;
default:
default:
*d3dMinFilter = D3DTEXF_POINT;
*d3dMipFilter = D3DTEXF_NONE;
UNREACHABLE();
......@@ -223,7 +223,7 @@ unsigned int GetAlphaSize(D3DFORMAT colorFormat)
{
switch (colorFormat)
{
case D3DFMT_A2R10G10B10:
case D3DFMT_A2R10G10B10:
return 2;
case D3DFMT_A8R8G8B8:
return 8;
......@@ -242,7 +242,7 @@ unsigned int GetRedSize(D3DFORMAT colorFormat)
{
switch (colorFormat)
{
case D3DFMT_A2R10G10B10:
case D3DFMT_A2R10G10B10:
return 10;
case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8:
......@@ -260,7 +260,7 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat)
{
switch (colorFormat)
{
case D3DFMT_A2R10G10B10:
case D3DFMT_A2R10G10B10:
return 10;
case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8:
......@@ -279,7 +279,7 @@ unsigned int GetBlueSize(D3DFORMAT colorFormat)
{
switch (colorFormat)
{
case D3DFMT_A2R10G10B10:
case D3DFMT_A2R10G10B10:
return 10;
case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8:
......@@ -314,7 +314,7 @@ unsigned int GetDepthSize(D3DFORMAT depthFormat)
return 0;
}
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount,
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount,
D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount)
{
switch (primitiveType)
......
......@@ -37,7 +37,7 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat);
unsigned int GetBlueSize(D3DFORMAT colorFormat);
unsigned int GetDepthSize(D3DFORMAT depthFormat);
unsigned int GetStencilSize(D3DFORMAT stencilFormat);
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount,
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount,
D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount);
}
......
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