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 "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, | 1199 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
1200 GR_GL_TEXTURE_WRAP_S, | 1200 GR_GL_TEXTURE_WRAP_S, |
1201 GR_GL_CLAMP_TO_EDGE)); | 1201 GR_GL_CLAMP_TO_EDGE)); |
1202 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, | 1202 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
1203 GR_GL_TEXTURE_WRAP_T, | 1203 GR_GL_TEXTURE_WRAP_T, |
1204 GR_GL_CLAMP_TO_EDGE)); | 1204 GR_GL_CLAMP_TO_EDGE)); |
1205 | 1205 |
1206 GrGLenum internalFormat = 0x0; // suppress warning | 1206 GrGLenum internalFormat = 0x0; // suppress warning |
1207 GrGLenum externalFormat = 0x0; // suppress warning | 1207 GrGLenum externalFormat = 0x0; // suppress warning |
1208 GrGLenum externalType = 0x0; // suppress warning | 1208 GrGLenum externalType = 0x0; // suppress warning |
1209 if (!this->configToGLFormats(config, false, &internalFormat, | 1209 bool useSizedFormat = false; |
| 1210 if (kGL_GrGLStandard == this->glStandard() || |
| 1211 (this->glVersion() >= GR_GL_VER(3, 0) && |
| 1212 // ES3 only works with sized BGRA8 format if "GL_APPLE_texture_form
at_BGRA8888" enabled |
| 1213 (kBGRA_8888_GrPixelConfig != config || !this->glCaps().bgraIsIntern
alFormat()))) { |
| 1214 useSizedFormat = true; |
| 1215 } |
| 1216 if (!this->configToGLFormats(config, useSizedFormat, &internalFormat, |
1210 &externalFormat, &externalType)) { | 1217 &externalFormat, &externalType)) { |
1211 GL_CALL(DeleteTextures(1, &colorID)); | 1218 GL_CALL(DeleteTextures(1, &colorID)); |
1212 fPixelConfigToStencilIndex[config] = kUnsupportedStencilIndex; | 1219 fPixelConfigToStencilIndex[config] = kUnsupportedStencilIndex; |
1213 return kUnsupportedStencilIndex; | 1220 return kUnsupportedStencilIndex; |
1214 } | 1221 } |
1215 | 1222 |
1216 CLEAR_ERROR_BEFORE_ALLOC(this->glInterface()); | 1223 CLEAR_ERROR_BEFORE_ALLOC(this->glInterface()); |
1217 GL_ALLOC_CALL(this->glInterface(), TexImage2D(GR_GL_TEXTURE_2D, | 1224 GL_ALLOC_CALL(this->glInterface(), TexImage2D(GR_GL_TEXTURE_2D, |
1218 0, internalFormat, | 1225 0, internalFormat, |
1219 size, | 1226 size, |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3265 this->setVertexArrayID(gpu, 0); | 3272 this->setVertexArrayID(gpu, 0); |
3266 } | 3273 } |
3267 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3274 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3268 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3275 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3269 fDefaultVertexArrayAttribState.resize(attrCount); | 3276 fDefaultVertexArrayAttribState.resize(attrCount); |
3270 } | 3277 } |
3271 attribState = &fDefaultVertexArrayAttribState; | 3278 attribState = &fDefaultVertexArrayAttribState; |
3272 } | 3279 } |
3273 return attribState; | 3280 return attribState; |
3274 } | 3281 } |
OLD | NEW |