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 if (this->ctxInfo().caps()->glslCaps()->mustDeclareFragmentShaderOutput()) { | 346 // On any post 1.10 GLSL supporting GPU, we declare custom output |
| 347 if (k110_GrGLSLGeneration != fFS.fProgramBuilder->gpu()->glslGeneration()) { |
347 fFS.enableCustomOutput(); | 348 fFS.enableCustomOutput(); |
348 } | 349 } |
349 | 350 |
350 SkString openBrace; | 351 SkString openBrace; |
351 openBrace.printf("{ // Xfer Processor: %s\n", xp.name()); | 352 openBrace.printf("{ // Xfer Processor: %s\n", xp.name()); |
352 fFS.codeAppend(openBrace.c_str()); | 353 fFS.codeAppend(openBrace.c_str()); |
353 | 354 |
354 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(xp.numTextures()); | 355 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(xp.numTextures()); |
355 this->emitSamplers(xp, &samplers, fXferProcessor); | 356 this->emitSamplers(xp, &samplers, fXferProcessor); |
356 | 357 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 } | 503 } |
503 | 504 |
504 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 505 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
505 | 506 |
506 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 507 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
507 int numProcs = fProcs.count(); | 508 int numProcs = fProcs.count(); |
508 for (int e = 0; e < numProcs; ++e) { | 509 for (int e = 0; e < numProcs; ++e) { |
509 SkDELETE(fProcs[e]); | 510 SkDELETE(fProcs[e]); |
510 } | 511 } |
511 } | 512 } |
OLD | NEW |