OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 GR_GL_TEXTURE_SWIZZLE_RGBA, | 1959 GR_GL_TEXTURE_SWIZZLE_RGBA, |
1960 reinterpret_cast<const GrGLint*>(swizzle))); | 1960 reinterpret_cast<const GrGLint*>(swizzle))); |
1961 } | 1961 } |
1962 | 1962 |
1963 inline GrGLenum tile_to_gl_wrap(SkShader::TileMode tm) { | 1963 inline GrGLenum tile_to_gl_wrap(SkShader::TileMode tm) { |
1964 static const GrGLenum gWrapModes[] = { | 1964 static const GrGLenum gWrapModes[] = { |
1965 GR_GL_CLAMP_TO_EDGE, | 1965 GR_GL_CLAMP_TO_EDGE, |
1966 GR_GL_REPEAT, | 1966 GR_GL_REPEAT, |
1967 GR_GL_MIRRORED_REPEAT | 1967 GR_GL_MIRRORED_REPEAT |
1968 }; | 1968 }; |
1969 GrAssert((unsigned) tm <= SK_ARRAY_COUNT(gWrapModes)); | 1969 GR_STATIC_ASSERT(SkShader::kTileModeCount == SK_ARRAY_COUNT(gWrapModes)); |
1970 GR_STATIC_ASSERT(0 == SkShader::kClamp_TileMode); | 1970 GR_STATIC_ASSERT(0 == SkShader::kClamp_TileMode); |
1971 GR_STATIC_ASSERT(1 == SkShader::kRepeat_TileMode); | 1971 GR_STATIC_ASSERT(1 == SkShader::kRepeat_TileMode); |
1972 GR_STATIC_ASSERT(2 == SkShader::kMirror_TileMode); | 1972 GR_STATIC_ASSERT(2 == SkShader::kMirror_TileMode); |
1973 return gWrapModes[tm]; | 1973 return gWrapModes[tm]; |
1974 } | 1974 } |
1975 | 1975 |
1976 } | 1976 } |
1977 | 1977 |
1978 void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur
e* texture) { | 1978 void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur
e* texture) { |
1979 GrAssert(NULL != texture); | 1979 GrAssert(NULL != texture); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 this->setVertexArrayID(gpu, 0); | 2501 this->setVertexArrayID(gpu, 0); |
2502 } | 2502 } |
2503 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2503 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2504 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2504 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2505 fDefaultVertexArrayAttribState.resize(attrCount); | 2505 fDefaultVertexArrayAttribState.resize(attrCount); |
2506 } | 2506 } |
2507 attribState = &fDefaultVertexArrayAttribState; | 2507 attribState = &fDefaultVertexArrayAttribState; |
2508 } | 2508 } |
2509 return attribState; | 2509 return attribState; |
2510 } | 2510 } |
OLD | NEW |