| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 const int GrGLProgramBuilder::kVarsPerBlock = 8; | 50 const int GrGLProgramBuilder::kVarsPerBlock = 8; |
| 51 | 51 |
| 52 GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp
u) { | 52 GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp
u) { |
| 53 // create a builder. This will be handed off to effects so they can use it
to add | 53 // create a builder. This will be handed off to effects so they can use it
to add |
| 54 // uniforms, varyings, textures, etc | 54 // uniforms, varyings, textures, etc |
| 55 SkAutoTDelete<GrGLProgramBuilder> builder(CreateProgramBuilder(args, gpu)); | 55 SkAutoTDelete<GrGLProgramBuilder> builder(CreateProgramBuilder(args, gpu)); |
| 56 | 56 |
| 57 GrGLProgramBuilder* pb = builder.get(); | 57 GrGLProgramBuilder* pb = builder.get(); |
| 58 | 58 |
| 59 // emit code to read the dst copy texture, if necessary | |
| 60 if (GrGLFragmentShaderBuilder::kNoDstRead_DstReadKey != pb->header().fDstRea
dKey && | |
| 61 !gpu->glCaps().fbFetchSupport()) { | |
| 62 pb->fFS.emitCodeToReadDstTexture(); | |
| 63 } | |
| 64 | |
| 65 // TODO: Once all stages can handle taking a float or vec4 and correctly han
dling them we can | 59 // TODO: Once all stages can handle taking a float or vec4 and correctly han
dling them we can |
| 66 // seed correctly here | 60 // seed correctly here |
| 67 GrGLSLExpr4 inputColor; | 61 GrGLSLExpr4 inputColor; |
| 68 GrGLSLExpr4 inputCoverage; | 62 GrGLSLExpr4 inputCoverage; |
| 69 | 63 |
| 70 pb->emitAndInstallProcs(&inputColor, &inputCoverage); | 64 pb->emitAndInstallProcs(&inputColor, &inputCoverage); |
| 71 | 65 |
| 72 return pb->finalize(); | 66 return pb->finalize(); |
| 73 } | 67 } |
| 74 | 68 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 489 } |
| 496 | 490 |
| 497 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 491 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 498 | 492 |
| 499 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 493 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
| 500 int numProcs = fProcs.count(); | 494 int numProcs = fProcs.count(); |
| 501 for (int e = 0; e < numProcs; ++e) { | 495 for (int e = 0; e < numProcs; ++e) { |
| 502 SkDELETE(fProcs[e]); | 496 SkDELETE(fProcs[e]); |
| 503 } | 497 } |
| 504 } | 498 } |
| OLD | NEW |