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 "GrGLStencilAttachment.h" | 10 #include "GrGLStencilAttachment.h" |
(...skipping 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2486 } | 2486 } |
2487 *externalFormat = GR_GL_ALPHA; | 2487 *externalFormat = GR_GL_ALPHA; |
2488 } | 2488 } |
2489 if (kGL_GrGLStandard == this->glStandard() || this->glVersion() >= G
R_GL_VER(3, 0)) { | 2489 if (kGL_GrGLStandard == this->glStandard() || this->glVersion() >= G
R_GL_VER(3, 0)) { |
2490 *externalType = GR_GL_HALF_FLOAT; | 2490 *externalType = GR_GL_HALF_FLOAT; |
2491 } else { | 2491 } else { |
2492 *externalType = GR_GL_HALF_FLOAT_OES; | 2492 *externalType = GR_GL_HALF_FLOAT_OES; |
2493 } | 2493 } |
2494 break; | 2494 break; |
2495 | 2495 |
| 2496 case kRGBA_half_GrPixelConfig: |
| 2497 *internalFormat = GR_GL_RGBA16F; |
| 2498 *externalFormat = GR_GL_RGBA; |
| 2499 if (kGL_GrGLStandard == this->glStandard() || this->glVersion() >= G
R_GL_VER(3, 0)) { |
| 2500 *externalType = GR_GL_HALF_FLOAT; |
| 2501 } else { |
| 2502 *externalType = GR_GL_HALF_FLOAT_OES; |
| 2503 } |
| 2504 break; |
| 2505 |
2496 default: | 2506 default: |
2497 return false; | 2507 return false; |
2498 } | 2508 } |
2499 return true; | 2509 return true; |
2500 } | 2510 } |
2501 | 2511 |
2502 void GrGLGpu::setTextureUnit(int unit) { | 2512 void GrGLGpu::setTextureUnit(int unit) { |
2503 SkASSERT(unit >= 0 && unit < fHWBoundTextureUniqueIDs.count()); | 2513 SkASSERT(unit >= 0 && unit < fHWBoundTextureUniqueIDs.count()); |
2504 if (unit != fHWActiveTextureUnitIdx) { | 2514 if (unit != fHWActiveTextureUnitIdx) { |
2505 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit)); | 2515 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit)); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2856 this->setVertexArrayID(gpu, 0); | 2866 this->setVertexArrayID(gpu, 0); |
2857 } | 2867 } |
2858 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2868 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2859 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2869 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2860 fDefaultVertexArrayAttribState.resize(attrCount); | 2870 fDefaultVertexArrayAttribState.resize(attrCount); |
2861 } | 2871 } |
2862 attribState = &fDefaultVertexArrayAttribState; | 2872 attribState = &fDefaultVertexArrayAttribState; |
2863 } | 2873 } |
2864 return attribState; | 2874 return attribState; |
2865 } | 2875 } |
OLD | NEW |