| 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 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2299 } else { | 2299 } else { |
| 2300 if (getSizedInternalFormat) { | 2300 if (getSizedInternalFormat) { |
| 2301 *internalFormat = GR_GL_RGBA8; | 2301 *internalFormat = GR_GL_RGBA8; |
| 2302 } else { | 2302 } else { |
| 2303 *internalFormat = GR_GL_RGBA; | 2303 *internalFormat = GR_GL_RGBA; |
| 2304 } | 2304 } |
| 2305 } | 2305 } |
| 2306 *externalFormat = GR_GL_BGRA; | 2306 *externalFormat = GR_GL_BGRA; |
| 2307 *externalType = GR_GL_UNSIGNED_BYTE; | 2307 *externalType = GR_GL_UNSIGNED_BYTE; |
| 2308 break; | 2308 break; |
| 2309 case kSRGBA_8888_GrPixelConfig: |
| 2310 *internalFormat = GR_GL_SRGB_ALPHA; |
| 2311 *externalFormat = GR_GL_SRGB_ALPHA; |
| 2312 if (getSizedInternalFormat) { |
| 2313 *internalFormat = GR_GL_SRGB8_ALPHA8; |
| 2314 } else { |
| 2315 *internalFormat = GR_GL_SRGB_ALPHA; |
| 2316 } |
| 2317 *externalType = GR_GL_UNSIGNED_BYTE; |
| 2318 break; |
| 2309 case kRGB_565_GrPixelConfig: | 2319 case kRGB_565_GrPixelConfig: |
| 2310 *internalFormat = GR_GL_RGB; | 2320 *internalFormat = GR_GL_RGB; |
| 2311 *externalFormat = GR_GL_RGB; | 2321 *externalFormat = GR_GL_RGB; |
| 2312 if (getSizedInternalFormat) { | 2322 if (getSizedInternalFormat) { |
| 2313 if (!this->glCaps().ES2CompatibilitySupport()) { | 2323 if (!this->glCaps().ES2CompatibilitySupport()) { |
| 2314 *internalFormat = GR_GL_RGB5; | 2324 *internalFormat = GR_GL_RGB5; |
| 2315 } else { | 2325 } else { |
| 2316 *internalFormat = GR_GL_RGB565; | 2326 *internalFormat = GR_GL_RGB565; |
| 2317 } | 2327 } |
| 2318 } else { | 2328 } else { |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 this->setVertexArrayID(gpu, 0); | 2746 this->setVertexArrayID(gpu, 0); |
| 2737 } | 2747 } |
| 2738 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2748 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2739 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2749 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2740 fDefaultVertexArrayAttribState.resize(attrCount); | 2750 fDefaultVertexArrayAttribState.resize(attrCount); |
| 2741 } | 2751 } |
| 2742 attribState = &fDefaultVertexArrayAttribState; | 2752 attribState = &fDefaultVertexArrayAttribState; |
| 2743 } | 2753 } |
| 2744 return attribState; | 2754 return attribState; |
| 2745 } | 2755 } |
| OLD | NEW |