| 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 "gl/GrGLGeometryProcessor.h" | 10 #include "gl/GrGLGeometryProcessor.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 SkASSERT(!fXferProcessor); | 336 SkASSERT(!fXferProcessor); |
| 337 fXferProcessor = SkNEW(GrGLInstalledXferProc); | 337 fXferProcessor = SkNEW(GrGLInstalledXferProc); |
| 338 | 338 |
| 339 fXferProcessor->fGLProc.reset(xp.createGLInstance()); | 339 fXferProcessor->fGLProc.reset(xp.createGLInstance()); |
| 340 | 340 |
| 341 // Enable dual source secondary output if we have one | 341 // Enable dual source secondary output if we have one |
| 342 if (xp.hasSecondaryOutput()) { | 342 if (xp.hasSecondaryOutput()) { |
| 343 fFS.enableSecondaryOutput(); | 343 fFS.enableSecondaryOutput(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 // On any post 1.10 GLSL supporting GPU, we declare custom output | 346 if (this->ctxInfo().caps()->glslCaps()->mustDeclareFragmentShaderOutput()) { |
| 347 if (k110_GrGLSLGeneration != fFS.fProgramBuilder->gpu()->glslGeneration()) { | |
| 348 fFS.enableCustomOutput(); | 347 fFS.enableCustomOutput(); |
| 349 } | 348 } |
| 350 | 349 |
| 351 SkString openBrace; | 350 SkString openBrace; |
| 352 openBrace.printf("{ // Xfer Processor: %s\n", xp.name()); | 351 openBrace.printf("{ // Xfer Processor: %s\n", xp.name()); |
| 353 fFS.codeAppend(openBrace.c_str()); | 352 fFS.codeAppend(openBrace.c_str()); |
| 354 | 353 |
| 355 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(xp.numTextures()); | 354 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(xp.numTextures()); |
| 356 this->emitSamplers(xp, &samplers, fXferProcessor); | 355 this->emitSamplers(xp, &samplers, fXferProcessor); |
| 357 | 356 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 } | 502 } |
| 504 | 503 |
| 505 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 504 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 506 | 505 |
| 507 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 506 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
| 508 int numProcs = fProcs.count(); | 507 int numProcs = fProcs.count(); |
| 509 for (int e = 0; e < numProcs; ++e) { | 508 for (int e = 0; e < numProcs; ++e) { |
| 510 SkDELETE(fProcs[e]); | 509 SkDELETE(fProcs[e]); |
| 511 } | 510 } |
| 512 } | 511 } |
| OLD | NEW |