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 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
10 #include "gl/GrGLSLPrettyPrint.h" | 10 #include "gl/GrGLSLPrettyPrint.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 if (0 != t) { | 406 if (0 != t) { |
407 suffixedVaryingName.append(varyingName); | 407 suffixedVaryingName.append(varyingName); |
408 suffixedVaryingName.appendf("_%i", t); | 408 suffixedVaryingName.appendf("_%i", t); |
409 varyingName = suffixedVaryingName.c_str(); | 409 varyingName = suffixedVaryingName.c_str(); |
410 } | 410 } |
411 | 411 |
412 bool useLocalCoords = kLocal_GrCoordSet == processor->coordTransform(t).
sourceCoords(); | 412 bool useLocalCoords = kLocal_GrCoordSet == processor->coordTransform(t).
sourceCoords(); |
413 const char* coords = useLocalCoords ? fVS.localCoords() : fVS.positionCo
ords(); | 413 const char* coords = useLocalCoords ? fVS.localCoords() : fVS.positionCo
ords(); |
414 | 414 |
415 GrGLVertToFrag v(varyingType); | 415 GrGLVertToFrag v(varyingType); |
416 this->addCoordVarying(varyingName, &v, uniName, coords); | 416 this->addVarying(varyingName, &v, processor->coordTransform(t).precision
()); |
| 417 fCoordVaryings.push_back(TransformVarying(v, uniName, coords)); |
417 | 418 |
418 SkASSERT(kVec2f_GrSLType == varyingType || kVec3f_GrSLType == varyingTyp
e); | 419 SkASSERT(kVec2f_GrSLType == varyingType || kVec3f_GrSLType == varyingTyp
e); |
419 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, | 420 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, |
420 (SkString(v.fsIn()), varyingType)); | 421 (SkString(v.fsIn()), varyingType)); |
421 } | 422 } |
422 } | 423 } |
423 | 424 |
424 void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor, | 425 void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor, |
425 GrGLProcessor::TextureSamplerArray* outSam
plers, | 426 GrGLProcessor::TextureSamplerArray* outSam
plers, |
426 GrGLInstalledProc* ip) { | 427 GrGLInstalledProc* ip) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 } | 547 } |
547 | 548 |
548 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 549 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
549 | 550 |
550 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 551 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
551 int numProcs = fProcs.count(); | 552 int numProcs = fProcs.count(); |
552 for (int e = 0; e < numProcs; ++e) { | 553 for (int e = 0; e < numProcs; ++e) { |
553 SkDELETE(fProcs[e]); | 554 SkDELETE(fProcs[e]); |
554 } | 555 } |
555 } | 556 } |
OLD | NEW |