diff options
author | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-02 07:01:56 +0000 |
---|---|---|
committer | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-02 07:01:56 +0000 |
commit | f140f18878215d6b4f21a94485cd1d2dbce8e976 (patch) | |
tree | 91fb0824139a71da3d4faa23a17c711c625bc823 /src/gpu | |
parent | 2c00ba3d72a82918dc1e67ffcd04a1a9fd94cfe8 (diff) |
Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@7939 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrAARectRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrDrawState.cpp | 12 | ||||
-rw-r--r-- | src/gpu/GrDrawState.h | 44 | ||||
-rw-r--r-- | src/gpu/gl/GrGLProgram.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL_program.cpp | 2 |
5 files changed, 34 insertions, 34 deletions
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp index c39aaf8036..b4f02ba8cc 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -13,7 +13,7 @@ SK_DEFINE_INST_COUNT(GrAARectRenderer) namespace { -static void aa_rect_attributes(bool useCoverage, GrAttribBindings* bindings, +static void aa_rect_attributes(bool useCoverage, GrAttribBindings* bindings, GrDrawState::AttribIndex* index) { if (useCoverage) { *bindings = GrDrawState::kCoverage_AttribBindingsBit; @@ -211,7 +211,7 @@ void GrAARectRenderer::strokeAARect(GrGpu* gpu, this->fillAARect(gpu, target, r, useVertexCoverage); return; } - + // position + color/coverage static const GrVertexAttrib kVertexAttribs[] = { {kVec2f_GrVertexAttribType, 0}, diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp index 6a793bc84c..e797546118 100644 --- a/src/gpu/GrDrawState.cpp +++ b/src/gpu/GrDrawState.cpp @@ -72,7 +72,7 @@ const size_t GrDrawState::kVertexAttribSizes[kGrVertexAttribTypeCount] = { sizeof(float), // kFloat_GrVertexAttribType 2*sizeof(float), // kVec2_GrVertexAttribType 3*sizeof(float), // kVec3_GrVertexAttribType - 4*sizeof(float), // kVec4_GrVertexAttribType + 4*sizeof(float), // kVec4_GrVertexAttribType 4*sizeof(char) // kCVec4_GrVertexAttribType }; @@ -125,7 +125,7 @@ void GrDrawState::setDefaultVertexAttribs() { static const GrVertexAttrib kPositionAttrib = {kVec2f_GrVertexAttribType, 0}; fVertexAttribs.reset(); fVertexAttribs.push_back(kPositionAttrib); - + fCommon.fAttribBindings = kDefault_AttribBindings; fAttribIndices[kPosition_AttribIndex] = 0; @@ -152,7 +152,7 @@ void GrDrawState::VertexAttributesUnitTest() { GrVertexAttribArray<6> attribs; GrAssert(0 == vertex_size(attribs.begin(), attribs.count())); - + GrVertexAttrib currAttrib = {kFloat_GrVertexAttribType, 0}; attribs.push_back(currAttrib); GrAssert(sizeof(float) == vertex_size(attribs.begin(), attribs.count())); @@ -170,15 +170,15 @@ void GrDrawState::VertexAttributesUnitTest() { GrAssert(4*sizeof(char) + 2*sizeof(float) == vertex_size(attribs.begin(), attribs.count())); currAttrib.set(kVec3f_GrVertexAttribType, attribs[1].fOffset + 2*sizeof(float)); attribs.push_back(currAttrib); - GrAssert(4*sizeof(char) + 2*sizeof(float) + 3*sizeof(float) == + GrAssert(4*sizeof(char) + 2*sizeof(float) + 3*sizeof(float) == vertex_size(attribs.begin(), attribs.count())); currAttrib.set(kFloat_GrVertexAttribType, attribs[2].fOffset + 3*sizeof(float)); attribs.push_back(currAttrib); - GrAssert(4*sizeof(char) + 2*sizeof(float) + 3*sizeof(float) + sizeof(float) == + GrAssert(4*sizeof(char) + 2*sizeof(float) + 3*sizeof(float) + sizeof(float) == vertex_size(attribs.begin(), attribs.count())); currAttrib.set(kVec4f_GrVertexAttribType, attribs[3].fOffset + sizeof(float)); attribs.push_back(currAttrib); - GrAssert(4*sizeof(char) + 2*sizeof(float) + 3*sizeof(float) + sizeof(float) + 4*sizeof(float) == + GrAssert(4*sizeof(char) + 2*sizeof(float) + 3*sizeof(float) + sizeof(float) + 4*sizeof(float) == vertex_size(attribs.begin(), attribs.count())); GrAttribBindings tcMask = 0; diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index fd11d2164e..4ae2c473ce 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -38,7 +38,7 @@ enum GrVertexAttribType { static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; struct GrVertexAttrib { - inline void set(GrVertexAttribType type, size_t offset) { + inline void set(GrVertexAttribType type, size_t offset) { fType = type; fOffset = offset; } bool operator==(const GrVertexAttrib& other) const { @@ -151,21 +151,21 @@ public: }; /** - * The format of vertices is represented as an array of vertex attribute - * pair, with each pair representing the type of the attribute and the - * offset in the vertex structure (see GrVertexAttrib, above). + * The format of vertices is represented as an array of vertex attribute + * pair, with each pair representing the type of the attribute and the + * offset in the vertex structure (see GrVertexAttrib, above). * * This will only set up the vertex geometry. To bind the attributes in - * the shaders, attribute indices and attribute bindings need to be set + * the shaders, attribute indices and attribute bindings need to be set * as well. */ /** - * Sets vertex attributes for next draw. + * Sets vertex attributes for next draw. * - * @param attribs the array of vertex attributes to set. + * @param attribs the array of vertex attributes to set. * @param count the number of attributes being set. - * limited to a count of kVertexAttribCnt. + * limited to a count of kVertexAttribCnt. */ void setVertexAttribs(const GrVertexAttrib attribs[], int count); @@ -175,7 +175,7 @@ public: size_t getVertexSize() const; /** - * Sets default vertex attributes for next draw. + * Sets default vertex attributes for next draw. * * This will also set default vertex attribute indices and bindings */ @@ -253,10 +253,10 @@ public: //// /** - * The vertex data used by the current program is represented as a bitfield - * of flags. Programs always use positions and may also use texture - * coordinates, per-vertex colors, per-vertex coverage and edge data. Each - * stage can use the explicit texture coordinates as its input texture + * The vertex data used by the current program is represented as a bitfield + * of flags. Programs always use positions and may also use texture + * coordinates, per-vertex colors, per-vertex coverage and edge data. Each + * stage can use the explicit texture coordinates as its input texture * coordinates or it may use the positions as texture coordinates. */ @@ -342,10 +342,10 @@ public: /** * Vertex attribute indices map the data set in the vertex attribute array * to the bindings specified in the attribute bindings. Each binding type - * has an associated index in the attribute array. This index is used to - * look up the vertex attribute data from the array, and potentially as the + * has an associated index in the attribute array. This index is used to + * look up the vertex attribute data from the array, and potentially as the * attribute index if we're binding attributes in GL. - * + * * Indices which do not have active attribute bindings will be ignored. */ @@ -367,11 +367,11 @@ public: }; //////////////////////////////////////////////////////////////////////////// - // Helpers to set attribute indices. These should match the index in the - // current attribute index array. + // Helpers to set attribute indices. These should match the index in the + // current attribute index array. /** - * Sets index for next draw. This is used to look up the offset + * Sets index for next draw. This is used to look up the offset * from the current vertex attribute array and to bind the attributes. * * @param index the attribute index we're setting @@ -1198,7 +1198,7 @@ public: } } for (int i = 0; i < kAttribIndexCount; ++i) { - if ((i == kPosition_AttribIndex || + if ((i == kPosition_AttribIndex || s.fCommon.fAttribBindings & kAttribIndexMasks[i]) && fAttribIndices[i] != s.fAttribIndices[i]) { return false; @@ -1329,7 +1329,7 @@ public: return false; } for (int i = 0; i < kAttribIndexCount; ++i) { - if ((i == kPosition_AttribIndex || + if ((i == kPosition_AttribIndex || state.fCommon.fAttribBindings & kAttribIndexMasks[i]) && fAttribIndices[i] != state.fAttribIndices[i]) { return false; @@ -1338,7 +1338,7 @@ public: if (fVertexAttribs.count() != state.fVertexAttribs.count()) { return false; } - for (int i = 0; i < fVertexAttribs.count(); ++i) + for (int i = 0; i < fVertexAttribs.count(); ++i) if (fVertexAttribs[i] != state.fVertexAttribs[i]) { return false; } diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index 781e15fdde..60bae63feb 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -196,7 +196,7 @@ void GrGLProgram::BuildDesc(const GrDrawState& drawState, desc->fColorAttributeIndex = drawState.getAttribIndex(GrDrawState::kColor_AttribIndex); } else { desc->fColorAttributeIndex = GrDrawState::kColorOverrideAttribIndexValue; - } + } if (requiresAttributeCoverage) { desc->fCoverageAttributeIndex = drawState.getAttribIndex(GrDrawState::kCoverage_AttribIndex); } else { @@ -1015,14 +1015,14 @@ bool GrGLProgram::bindOutputsAttribsAndLinkProgram(const GrGLShaderBuilder& buil builder.positionAttribute().c_str())); GL_CALL(BindAttribLocation(fProgramID, fDesc.fColorAttributeIndex, COL_ATTR_NAME)); GL_CALL(BindAttribLocation(fProgramID, fDesc.fCoverageAttributeIndex, COV_ATTR_NAME)); - + if (fDesc.fAttribBindings & GrDrawState::kEdge_AttribBindingsBit) { GL_CALL(BindAttribLocation(fProgramID, fDesc.fEdgeAttributeIndex, EDGE_ATTR_NAME)); } if (GrDrawState::AttributesBindExplicitTexCoords(fDesc.fAttribBindings)) { GL_CALL(BindAttribLocation(fProgramID, fDesc.fTexCoordAttributeIndex, TEX_ATTR_NAME)); } - + GL_CALL(LinkProgram(fProgramID)); GrGLint linked = GR_GL_INIT_ZERO; diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp index e5a71831ec..c65f0b6957 100644 --- a/src/gpu/gl/GrGpuGL_program.cpp +++ b/src/gpu/gl/GrGpuGL_program.cpp @@ -224,7 +224,7 @@ void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { uint32_t usedAttribArraysMask = 0; const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttribs(); int vertexAttribCount = this->getDrawState().getVertexAttribCount(); - for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; + for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; ++vertexAttribIndex, ++vertexAttrib) { usedAttribArraysMask |= (1 << vertexAttribIndex); |