OSDN Git Service

Remove unused return value.
authorNicolas Capens <capn@google.com>
Wed, 13 Jan 2016 05:22:02 +0000 (00:22 -0500)
committerNicolas Capens <capn@google.com>
Fri, 15 Jan 2016 17:04:22 +0000 (17:04 +0000)
Change-Id: I99731b6697a4ae92b1d04c8a8d895a0cf19d580c
Reviewed-on: https://swiftshader-review.googlesource.com/4545
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/libGLESv2/Context.cpp
src/OpenGL/libGLESv2/Context.h

index f5b6256..7bce0a1 100644 (file)
@@ -306,7 +306,7 @@ void Context::makeCurrent(egl::Surface *surface)
     {\r
         depthStencil->release();\r
     }\r
-    \r
+\r
     markAllStateDirty();\r
 }\r
 \r
@@ -767,7 +767,7 @@ GLuint Context::getElementArrayBufferName() const
 GLuint Context::getActiveQuery(GLenum target) const\r
 {\r
     Query *queryObject = NULL;\r
-    \r
+\r
     switch(target)\r
     {\r
     case GL_ANY_SAMPLES_PASSED_EXT:\r
@@ -787,7 +787,7 @@ GLuint Context::getActiveQuery(GLenum target) const
     {\r
         return queryObject->name;\r
     }\r
-    \r
+\r
        return 0;\r
 }\r
 \r
@@ -951,7 +951,7 @@ GLuint Context::createVertexArray()
 {\r
        GLuint handle = mVertexArrayNameSpace.allocate();\r
 \r
-       mVertexArrayMap[handle] = NULL;\r
+       mVertexArrayMap[handle] = nullptr;\r
 \r
        return handle;\r
 }\r
@@ -985,7 +985,7 @@ void Context::deleteBuffer(GLuint buffer)
     {\r
         detachBuffer(buffer);\r
     }\r
-    \r
+\r
     mResourceManager->deleteBuffer(buffer);\r
 }\r
 \r
@@ -1015,7 +1015,7 @@ void Context::deleteRenderbuffer(GLuint renderbuffer)
     {\r
         detachRenderbuffer(renderbuffer);\r
     }\r
-    \r
+\r
     mResourceManager->deleteRenderbuffer(renderbuffer);\r
 }\r
 \r
@@ -1048,16 +1048,16 @@ void Context::deleteFence(GLuint fence)
 void Context::deleteQuery(GLuint query)\r
 {\r
     QueryMap::iterator queryObject = mQueryMap.find(query);\r
-    \r
+\r
        if(queryObject != mQueryMap.end())\r
     {\r
         mQueryNameSpace.release(queryObject->first);\r
-        \r
+\r
                if(queryObject->second)\r
         {\r
             queryObject->second->release();\r
         }\r
-        \r
+\r
                mQueryMap.erase(queryObject);\r
     }\r
 }\r
@@ -1199,7 +1199,7 @@ void Context::bindTransformFeedbackBuffer(GLuint buffer)
        mResourceManager->checkBufferAllocation(buffer);\r
 \r
        TransformFeedback* transformFeedback = getTransformFeedback(mState.transformFeedback);\r
-       \r
+\r
        if(transformFeedback)\r
        {\r
                transformFeedback->setGenericBuffer(getBuffer(buffer));\r
@@ -1268,9 +1268,9 @@ void Context::bindRenderbuffer(GLuint renderbuffer)
     mState.renderbuffer = getRenderbuffer(renderbuffer);\r
 }\r
 \r
-bool Context::bindVertexArray(GLuint array)\r
+void Context::bindVertexArray(GLuint array)\r
 {\r
-       VertexArrayvertexArray = getVertexArray(array);\r
+       VertexArray *vertexArray = getVertexArray(array);\r
 \r
        if(!vertexArray)\r
        {\r
@@ -1279,8 +1279,6 @@ bool Context::bindVertexArray(GLuint array)
        }\r
 \r
        mState.vertexArray = array;\r
-\r
-       return !!vertexArray;\r
 }\r
 \r
 void Context::bindGenericUniformBuffer(GLuint buffer)\r
@@ -1363,7 +1361,7 @@ void Context::useProgram(GLuint program)
         {\r
             newProgram->addRef();\r
         }\r
-        \r
+\r
         if(oldProgram)\r
         {\r
             oldProgram->release();\r
@@ -1373,10 +1371,10 @@ void Context::useProgram(GLuint program)
 \r
 void Context::beginQuery(GLenum target, GLuint query)\r
 {\r
-    // From EXT_occlusion_query_boolean: If BeginQueryEXT is called with an <id>  \r
-    // of zero, if the active query object name for <target> is non-zero (for the  \r
-    // targets ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if  \r
-    // the active query for either target is non-zero), if <id> is the name of an \r
+    // From EXT_occlusion_query_boolean: If BeginQueryEXT is called with an <id>\r
+    // of zero, if the active query object name for <target> is non-zero (for the\r
+    // targets ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if\r
+    // the active query for either target is non-zero), if <id> is the name of an\r
     // existing query object whose type does not match <target>, or if <id> is the\r
     // active query object name for any query type, the error INVALID_OPERATION is\r
     // generated.\r
@@ -1399,16 +1397,16 @@ void Context::beginQuery(GLenum target, GLuint query)
     QueryType qType;\r
     switch(target)\r
     {\r
-    case GL_ANY_SAMPLES_PASSED_EXT: \r
-        qType = QUERY_ANY_SAMPLES_PASSED; \r
+    case GL_ANY_SAMPLES_PASSED_EXT:\r
+        qType = QUERY_ANY_SAMPLES_PASSED;\r
         break;\r
-    case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT: \r
-        qType = QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE; \r
+    case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT:\r
+        qType = QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE;\r
         break;\r
     case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:\r
         qType = QUERY_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;\r
         break;\r
-    default: \r
+    default:\r
         ASSERT(false);\r
     }\r
 \r
@@ -1540,7 +1538,7 @@ VertexArray *Context::getVertexArray(GLuint array) const
 {\r
        VertexArrayMap::const_iterator vertexArray = mVertexArrayMap.find(array);\r
 \r
-       return (vertexArray == mVertexArrayMap.end()) ? NULL : vertexArray->second;\r
+       return (vertexArray == mVertexArrayMap.end()) ? nullptr : vertexArray->second;\r
 }\r
 \r
 VertexArray *Context::getCurrentVertexArray() const\r
@@ -1924,7 +1922,7 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
     // Please note: DEPTH_CLEAR_VALUE is not included in our internal getIntegerv implementation\r
     // because it is stored as a float, despite the fact that the GL ES 2.0 spec names\r
     // GetIntegerv as its native query function. As it would require conversion in any\r
-    // case, this should make no difference to the calling application. You may find it in \r
+    // case, this should make no difference to the calling application. You may find it in\r
     // Context::getFloatv.\r
     switch(pname)\r
     {\r
@@ -1977,7 +1975,7 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
        case GL_MAX_CUBE_MAP_TEXTURE_SIZE:        *params = IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE; break;\r
     case GL_NUM_COMPRESSED_TEXTURE_FORMATS:   *params = NUM_COMPRESSED_TEXTURE_FORMATS;           break;\r
        case GL_MAX_SAMPLES_ANGLE:                *params = IMPLEMENTATION_MAX_SAMPLES;               break;\r
-    case GL_SAMPLE_BUFFERS:                   \r
+    case GL_SAMPLE_BUFFERS:\r
     case GL_SAMPLES:\r
         {\r
             Framebuffer *framebuffer = getDrawFramebuffer();\r
@@ -2454,7 +2452,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
     // Please note: the query type returned for DEPTH_CLEAR_VALUE in this implementation\r
     // is FLOAT rather than INT, as would be suggested by the GL ES 2.0 spec. This is due\r
     // to the fact that it is stored internally as a float, and so would require conversion\r
-    // if returned from Context::getIntegerv. Since this conversion is already implemented \r
+    // if returned from Context::getIntegerv. Since this conversion is already implemented\r
     // in the case that one calls glGetIntegerv to retrieve a float-typed state variable, we\r
     // place DEPTH_CLEAR_VALUE with the floats. This should make no difference to the calling\r
     // application.\r
@@ -2946,7 +2944,7 @@ void Context::applyState(GLenum drawMode)
                     }\r
                 }\r
             }\r
-            \r
+\r
             if(mState.sampleCoverageInvert)\r
             {\r
                 mask = ~mask;\r
@@ -2993,7 +2991,7 @@ GLenum Context::applyVertexBuffer(GLint base, GLint first, GLsizei count, GLsize
 \r
                sw::Resource *resource = attributes[i].vertexBuffer;\r
                const void *buffer = (char*)resource->data() + attributes[i].offset;\r
-                       \r
+\r
                int stride = attributes[i].stride;\r
 \r
                buffer = (char*)buffer + stride * base;\r
@@ -3144,7 +3142,7 @@ void Context::applyTexture(sw::SamplerType type, int index, Texture *baseTexture
        }\r
 \r
        device->setTextureResource(sampler, resource);\r
-                       \r
+\r
        if(baseTexture && textureUsed)\r
        {\r
                int levelCount = baseTexture->getLevelCount();\r
@@ -3272,7 +3270,7 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
        GLsizei outputHeight = (mState.packImageHeight == 0) ? height : mState.packImageHeight;\r
        pixels = getPixelPackBuffer() ? (unsigned char*)getPixelPackBuffer()->data() + (ptrdiff_t)pixels : (unsigned char*)pixels;\r
        pixels = ((char*)pixels) + (mState.packSkipImages * outputHeight + mState.packSkipRows) * outputPitch + mState.packSkipPixels;\r
-    \r
+\r
        // Sized query sanity check\r
     if(bufSize)\r
     {\r
@@ -3317,7 +3315,7 @@ void Context::clear(GLbitfield mask)
     {\r
         return;\r
     }\r
-       \r
+\r
        if(mask & GL_COLOR_BUFFER_BIT)\r
        {\r
                unsigned int rgbaMask = getColorMask();\r
@@ -3816,7 +3814,7 @@ void Context::setVertexAttrib(GLuint index, const GLuint *values)
        mVertexDataManager->dirtyCurrentValue(index);\r
 }\r
 \r
-void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, \r
+void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,\r
                               GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,\r
                               GLbitfield mask)\r
 {\r
@@ -3863,7 +3861,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
                destRect.x0 = dstX1;\r
                destRect.x1 = dstX0;\r
        }\r
-       \r
+\r
     if(srcY0 < srcY1)\r
     {\r
         sourceRect.y0 = srcY0;\r
@@ -3923,7 +3921,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
     sw::Rect sourceTrimmedRect = sourceScissoredRect;\r
     sw::Rect destTrimmedRect = destScissoredRect;\r
 \r
-    // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of \r
+    // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of\r
     // the actual draw and read surfaces.\r
     if(sourceTrimmedRect.x0 < 0)\r
     {\r
@@ -3984,7 +3982,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
     bool partialBufferCopy = false;\r
 \r
     if(sourceTrimmedRect.y1 - sourceTrimmedRect.y0 < readBufferHeight ||\r
-       sourceTrimmedRect.x1 - sourceTrimmedRect.x0 < readBufferWidth || \r
+       sourceTrimmedRect.x1 - sourceTrimmedRect.x0 < readBufferWidth ||\r
        destTrimmedRect.y1 - destTrimmedRect.y0 < drawBufferHeight ||\r
        destTrimmedRect.x1 - destTrimmedRect.x0 < drawBufferWidth ||\r
        sourceTrimmedRect.y0 != 0 || destTrimmedRect.y0 != 0 || sourceTrimmedRect.x0 != 0 || destTrimmedRect.x0 != 0)\r
@@ -4005,7 +4003,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
         {\r
             return error(GL_INVALID_OPERATION);\r
         }\r
-        \r
+\r
         if(partialBufferCopy && readBufferSamples > 1)\r
         {\r
             return error(GL_INVALID_OPERATION);\r
@@ -4058,7 +4056,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
             return error(GL_INVALID_OPERATION);   // Only whole-buffer copies are permitted\r
         }\r
 \r
-        if((drawDSBuffer && drawDSBuffer->getSamples() > 1) || \r
+        if((drawDSBuffer && drawDSBuffer->getSamples() > 1) ||\r
            (readDSBuffer && readDSBuffer->getSamples() > 1))\r
         {\r
             return error(GL_INVALID_OPERATION);\r
@@ -4071,7 +4069,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
         {\r
             egl::Image *readRenderTarget = readFramebuffer->getReadRenderTarget();\r
             egl::Image *drawRenderTarget = drawFramebuffer->getRenderTarget(0);\r
\r
+\r
                        if(flipX)\r
                        {\r
                                swap(destRect.x0, destRect.x1);\r
@@ -4138,7 +4136,7 @@ EGLenum Context::validateSharedImage(EGLenum target, GLuint name, GLuint texture
     default:\r
         return EGL_BAD_PARAMETER;\r
     }\r
-       \r
+\r
     if(textureLevel >= es2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)\r
     {\r
         return EGL_BAD_MATCH;\r
index 9defd50..eb4e810 100644 (file)
@@ -427,7 +427,7 @@ public:
     bool isDepthTestEnabled() const;\r
     void setDepthFunc(GLenum depthFunc);\r
     void setDepthRange(float zNear, float zFar);\r
-    \r
+\r
     void setBlendEnabled(bool enabled);\r
     bool isBlendEnabled() const;\r
     void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha);\r
@@ -518,7 +518,7 @@ public:
        void setPackSkipRows(GLint skipRows);\r
        void setPackSkipImages(GLint skipImages);\r
 \r
-    // These create  and destroy methods are merely pass-throughs to \r
+    // These create and destroy methods are merely pass-throughs to\r
     // ResourceManager, which owns these object types\r
     GLuint createBuffer();\r
     GLuint createShader(GLenum type);\r
@@ -571,7 +571,7 @@ public:
     void bindReadFramebuffer(GLuint framebuffer);\r
     void bindDrawFramebuffer(GLuint framebuffer);\r
     void bindRenderbuffer(GLuint renderbuffer);\r
-       bool bindVertexArray(GLuint array);\r
+       void bindVertexArray(GLuint array);\r
        void bindGenericUniformBuffer(GLuint buffer);\r
        void bindIndexedUniformBuffer(GLuint buffer, GLuint index, GLintptr offset, GLsizeiptr size);\r
        void bindGenericTransformFeedbackBuffer(GLuint buffer);\r
@@ -660,8 +660,8 @@ public:
     GLenum getError();\r
 \r
     static int getSupportedMultisampleCount(int requested);\r
-    \r
-    void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, \r
+\r
+    void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,\r
                          GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,\r
                          GLbitfield mask);\r
 \r
@@ -743,7 +743,7 @@ private:
     bool mHasBeenCurrent;\r
 \r
     unsigned int mAppliedProgramSerial;\r
-    \r
+\r
     // state caching flags\r
     bool mDepthStateDirty;\r
     bool mMaskStateDirty;\r