| 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 "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
| (...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2415 *externalFormat = GR_GL_ALPHA; | 2415 *externalFormat = GR_GL_ALPHA; |
| 2416 if (getSizedInternalFormat) { | 2416 if (getSizedInternalFormat) { |
| 2417 *internalFormat = GR_GL_ALPHA8; | 2417 *internalFormat = GR_GL_ALPHA8; |
| 2418 } else { | 2418 } else { |
| 2419 *internalFormat = GR_GL_ALPHA; | 2419 *internalFormat = GR_GL_ALPHA; |
| 2420 } | 2420 } |
| 2421 *externalType = GR_GL_UNSIGNED_BYTE; | 2421 *externalType = GR_GL_UNSIGNED_BYTE; |
| 2422 } | 2422 } |
| 2423 break; | 2423 break; |
| 2424 case kETC1_GrPixelConfig: | 2424 case kETC1_GrPixelConfig: |
| 2425 *internalFormat = GR_GL_COMPRESSED_RGB8_ETC1; | 2425 *internalFormat = GR_GL_COMPRESSED_ETC1_RGB8; |
| 2426 break; | 2426 break; |
| 2427 case kLATC_GrPixelConfig: | 2427 case kLATC_GrPixelConfig: |
| 2428 switch(this->glCaps().latcAlias()) { | 2428 switch(this->glCaps().latcAlias()) { |
| 2429 case GrGLCaps::kLATC_LATCAlias: | 2429 case GrGLCaps::kLATC_LATCAlias: |
| 2430 *internalFormat = GR_GL_COMPRESSED_LUMINANCE_LATC1; | 2430 *internalFormat = GR_GL_COMPRESSED_LUMINANCE_LATC1; |
| 2431 break; | 2431 break; |
| 2432 case GrGLCaps::kRGTC_LATCAlias: | 2432 case GrGLCaps::kRGTC_LATCAlias: |
| 2433 *internalFormat = GR_GL_COMPRESSED_RED_RGTC1; | 2433 *internalFormat = GR_GL_COMPRESSED_RED_RGTC1; |
| 2434 break; | 2434 break; |
| 2435 case GrGLCaps::k3DC_LATCAlias: | 2435 case GrGLCaps::k3DC_LATCAlias: |
| 2436 *internalFormat = GR_GL_COMPRESSED_3DC_X; | 2436 *internalFormat = GR_GL_COMPRESSED_3DC_X; |
| 2437 break; | 2437 break; |
| 2438 } | 2438 } |
| 2439 break; | 2439 break; |
| 2440 case kR11_EAC_GrPixelConfig: | 2440 case kR11_EAC_GrPixelConfig: |
| 2441 *internalFormat = GR_GL_COMPRESSED_R11; | 2441 *internalFormat = GR_GL_COMPRESSED_R11_EAC; |
| 2442 break; | 2442 break; |
| 2443 | 2443 |
| 2444 case kASTC_12x12_GrPixelConfig: | 2444 case kASTC_12x12_GrPixelConfig: |
| 2445 *internalFormat = GR_GL_COMPRESSED_RGBA_ASTC_12x12; | 2445 *internalFormat = GR_GL_COMPRESSED_RGBA_ASTC_12x12_KHR; |
| 2446 break; | 2446 break; |
| 2447 | 2447 |
| 2448 case kRGBA_float_GrPixelConfig: | 2448 case kRGBA_float_GrPixelConfig: |
| 2449 *internalFormat = GR_GL_RGBA32F; | 2449 *internalFormat = GR_GL_RGBA32F; |
| 2450 *externalFormat = GR_GL_RGBA; | 2450 *externalFormat = GR_GL_RGBA; |
| 2451 *externalType = GR_GL_FLOAT; | 2451 *externalType = GR_GL_FLOAT; |
| 2452 break; | 2452 break; |
| 2453 | 2453 |
| 2454 case kAlpha_half_GrPixelConfig: | 2454 case kAlpha_half_GrPixelConfig: |
| 2455 if (this->glCaps().textureRedSupport()) { | 2455 if (this->glCaps().textureRedSupport()) { |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 this->setVertexArrayID(gpu, 0); | 2816 this->setVertexArrayID(gpu, 0); |
| 2817 } | 2817 } |
| 2818 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2818 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2819 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2819 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2820 fDefaultVertexArrayAttribState.resize(attrCount); | 2820 fDefaultVertexArrayAttribState.resize(attrCount); |
| 2821 } | 2821 } |
| 2822 attribState = &fDefaultVertexArrayAttribState; | 2822 attribState = &fDefaultVertexArrayAttribState; |
| 2823 } | 2823 } |
| 2824 return attribState; | 2824 return attribState; |
| 2825 } | 2825 } |
| OLD | NEW |