| 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 "GrGLNameAllocator.h" | 10 #include "GrGLNameAllocator.h" |
| (...skipping 2680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2691 *internalFormat = GR_GL_COMPRESSED_RED_RGTC1; | 2691 *internalFormat = GR_GL_COMPRESSED_RED_RGTC1; |
| 2692 break; | 2692 break; |
| 2693 case GrGLCaps::k3DC_LATCAlias: | 2693 case GrGLCaps::k3DC_LATCAlias: |
| 2694 *internalFormat = GR_GL_COMPRESSED_3DC_X; | 2694 *internalFormat = GR_GL_COMPRESSED_3DC_X; |
| 2695 break; | 2695 break; |
| 2696 } | 2696 } |
| 2697 break; | 2697 break; |
| 2698 case kR11_EAC_GrPixelConfig: | 2698 case kR11_EAC_GrPixelConfig: |
| 2699 *internalFormat = GR_GL_COMPRESSED_R11; | 2699 *internalFormat = GR_GL_COMPRESSED_R11; |
| 2700 break; | 2700 break; |
| 2701 |
| 2702 case kASTC_12x12_GrPixelConfig: |
| 2703 *internalFormat = GR_GL_COMPRESSED_RGBA_ASTC_12x12; |
| 2704 break; |
| 2705 |
| 2701 case kRGBA_float_GrPixelConfig: | 2706 case kRGBA_float_GrPixelConfig: |
| 2702 *internalFormat = GR_GL_RGBA32F; | 2707 *internalFormat = GR_GL_RGBA32F; |
| 2703 *externalFormat = GR_GL_RGBA; | 2708 *externalFormat = GR_GL_RGBA; |
| 2704 *externalType = GR_GL_FLOAT; | 2709 *externalType = GR_GL_FLOAT; |
| 2705 break; | 2710 break; |
| 2711 |
| 2706 default: | 2712 default: |
| 2707 return false; | 2713 return false; |
| 2708 } | 2714 } |
| 2709 return true; | 2715 return true; |
| 2710 } | 2716 } |
| 2711 | 2717 |
| 2712 void GrGpuGL::setTextureUnit(int unit) { | 2718 void GrGpuGL::setTextureUnit(int unit) { |
| 2713 SkASSERT(unit >= 0 && unit < fHWBoundTextures.count()); | 2719 SkASSERT(unit >= 0 && unit < fHWBoundTextures.count()); |
| 2714 if (unit != fHWActiveTextureUnitIdx) { | 2720 if (unit != fHWActiveTextureUnitIdx) { |
| 2715 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit)); | 2721 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit)); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3024 this->setVertexArrayID(gpu, 0); | 3030 this->setVertexArrayID(gpu, 0); |
| 3025 } | 3031 } |
| 3026 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3032 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 3027 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3033 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 3028 fDefaultVertexArrayAttribState.resize(attrCount); | 3034 fDefaultVertexArrayAttribState.resize(attrCount); |
| 3029 } | 3035 } |
| 3030 attribState = &fDefaultVertexArrayAttribState; | 3036 attribState = &fDefaultVertexArrayAttribState; |
| 3031 } | 3037 } |
| 3032 return attribState; | 3038 return attribState; |
| 3033 } | 3039 } |
| OLD | NEW |