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 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2475 *externalFormat = GR_GL_RGBA; | 2475 *externalFormat = GR_GL_RGBA; |
2476 if (getSizedInternalFormat) { | 2476 if (getSizedInternalFormat) { |
2477 *internalFormat = GR_GL_RGBA4; | 2477 *internalFormat = GR_GL_RGBA4; |
2478 } else { | 2478 } else { |
2479 *internalFormat = GR_GL_RGBA; | 2479 *internalFormat = GR_GL_RGBA; |
2480 } | 2480 } |
2481 *externalType = GR_GL_UNSIGNED_SHORT_4_4_4_4; | 2481 *externalType = GR_GL_UNSIGNED_SHORT_4_4_4_4; |
2482 break; | 2482 break; |
2483 case kIndex_8_GrPixelConfig: | 2483 case kIndex_8_GrPixelConfig: |
2484 if (this->caps()->eightBitPaletteSupport()) { | 2484 if (this->caps()->eightBitPaletteSupport()) { |
2485 *internalFormat = GR_GL_PALETTE8_RGBA8; | |
2486 // glCompressedTexImage doesn't take external params | 2485 // glCompressedTexImage doesn't take external params |
2487 *externalFormat = GR_GL_PALETTE8_RGBA8; | 2486 *externalFormat = GR_GL_PALETTE8_RGBA8; |
2488 // no sized/unsized internal format distinction here | 2487 // no sized/unsized internal format distinction here |
2489 *internalFormat = GR_GL_PALETTE8_RGBA8; | 2488 *internalFormat = GR_GL_PALETTE8_RGBA8; |
2490 // unused with CompressedTexImage | 2489 // unused with CompressedTexImage |
2491 *externalType = GR_GL_UNSIGNED_BYTE; | 2490 *externalType = GR_GL_UNSIGNED_BYTE; |
2492 } else { | 2491 } else { |
2493 return false; | 2492 return false; |
2494 } | 2493 } |
2495 break; | 2494 break; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2834 this->setVertexArrayID(gpu, 0); | 2833 this->setVertexArrayID(gpu, 0); |
2835 } | 2834 } |
2836 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2835 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2837 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2836 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2838 fDefaultVertexArrayAttribState.resize(attrCount); | 2837 fDefaultVertexArrayAttribState.resize(attrCount); |
2839 } | 2838 } |
2840 attribState = &fDefaultVertexArrayAttribState; | 2839 attribState = &fDefaultVertexArrayAttribState; |
2841 } | 2840 } |
2842 return attribState; | 2841 return attribState; |
2843 } | 2842 } |
OLD | NEW |