| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "GrGLProgramBuilder.h" | 8 #include "GrGLProgramBuilder.h" |
| 9 | 9 |
| 10 #include "GrAutoLocaleSetter.h" | 10 #include "GrAutoLocaleSetter.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 SkDebugf("%s", (char*)log.get()); | 467 SkDebugf("%s", (char*)log.get()); |
| 468 } | 468 } |
| 469 SkDEBUGFAIL("Error linking program"); | 469 SkDEBUGFAIL("Error linking program"); |
| 470 GL_CALL(DeleteProgram(programID)); | 470 GL_CALL(DeleteProgram(programID)); |
| 471 programID = 0; | 471 programID = 0; |
| 472 } | 472 } |
| 473 return SkToBool(linked); | 473 return SkToBool(linked); |
| 474 } | 474 } |
| 475 | 475 |
| 476 void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) { | 476 void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) { |
| 477 bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation
!= nullptr; | 477 if (!fGpu->glCaps().bindUniformLocationSupport()) { |
| 478 if (!usingBindUniform) { | |
| 479 int count = fUniforms.count(); | 478 int count = fUniforms.count(); |
| 480 for (int i = 0; i < count; ++i) { | 479 for (int i = 0; i < count; ++i) { |
| 481 GrGLint location; | 480 GrGLint location; |
| 482 GL_CALL_RET(location, GetUniformLocation(programID, fUniforms[i].fVa
riable.c_str())); | 481 GL_CALL_RET(location, GetUniformLocation(programID, fUniforms[i].fVa
riable.c_str())); |
| 483 fUniforms[i].fLocation = location; | 482 fUniforms[i].fLocation = location; |
| 484 } | 483 } |
| 485 } | 484 } |
| 486 | 485 |
| 487 // handle NVPR separable varyings | 486 // handle NVPR separable varyings |
| 488 if (!fGpu->glCaps().shaderCaps()->pathRenderingSupport() || | 487 if (!fGpu->glCaps().shaderCaps()->pathRenderingSupport() || |
| (...skipping 29 matching lines...) Expand all Loading... |
| 518 } | 517 } |
| 519 | 518 |
| 520 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 519 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 521 | 520 |
| 522 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 521 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
| 523 int numProcs = fProcs.count(); | 522 int numProcs = fProcs.count(); |
| 524 for (int i = 0; i < numProcs; ++i) { | 523 for (int i = 0; i < numProcs; ++i) { |
| 525 delete fProcs[i]; | 524 delete fProcs[i]; |
| 526 } | 525 } |
| 527 } | 526 } |
| OLD | NEW |