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 |
59 // TODO: Once all stages can handle taking a float or vec4 and correctly han
dling them we can | 65 // TODO: Once all stages can handle taking a float or vec4 and correctly han
dling them we can |
60 // seed correctly here | 66 // seed correctly here |
61 GrGLSLExpr4 inputColor; | 67 GrGLSLExpr4 inputColor; |
62 GrGLSLExpr4 inputCoverage; | 68 GrGLSLExpr4 inputCoverage; |
63 | 69 |
64 pb->emitAndInstallProcs(&inputColor, &inputCoverage); | 70 pb->emitAndInstallProcs(&inputColor, &inputCoverage); |
65 | 71 |
66 return pb->finalize(); | 72 return pb->finalize(); |
67 } | 73 } |
68 | 74 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 495 } |
490 | 496 |
491 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 497 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
492 | 498 |
493 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 499 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
494 int numProcs = fProcs.count(); | 500 int numProcs = fProcs.count(); |
495 for (int e = 0; e < numProcs; ++e) { | 501 for (int e = 0; e < numProcs; ++e) { |
496 SkDELETE(fProcs[e]); | 502 SkDELETE(fProcs[e]); |
497 } | 503 } |
498 } | 504 } |
OLD | NEW |