| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 SkSTArray<8, GrGLProcessor::TransformedCoordsArray> outCoords; | 200 SkSTArray<8, GrGLProcessor::TransformedCoordsArray> outCoords; |
| 201 for (int i = 0; i < this->pipeline().numFragmentStages(); i++) { | 201 for (int i = 0; i < this->pipeline().numFragmentStages(); i++) { |
| 202 const GrFragmentProcessor* processor = this->pipeline().getFragmentStage
(i).processor(); | 202 const GrFragmentProcessor* processor = this->pipeline().getFragmentStage
(i).processor(); |
| 203 SkSTArray<2, const GrCoordTransform*, true>& procCoords = fCoordTransfor
ms.push_back(); | 203 SkSTArray<2, const GrCoordTransform*, true>& procCoords = fCoordTransfor
ms.push_back(); |
| 204 for (int t = 0; t < processor->numTransforms(); t++) { | 204 for (int t = 0; t < processor->numTransforms(); t++) { |
| 205 procCoords.push_back(&processor->coordTransform(t)); | 205 procCoords.push_back(&processor->coordTransform(t)); |
| 206 } | 206 } |
| 207 | 207 |
| 208 totalTextures += processor->numTextures(); | 208 totalTextures += processor->numTextures(); |
| 209 if (totalTextures >= maxTextureUnits) { | 209 if (totalTextures >= maxTextureUnits) { |
| 210 GrCapsDebugf(fGpu->caps(), "Program would use too many texture units
\n"); | 210 GrContextDebugf(fGpu->getContext(), "Program would use too many text
ure units\n"); |
| 211 return false; | 211 return false; |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 this->emitAndInstallProc(primProc, inputColor, inputCoverage); | 215 this->emitAndInstallProc(primProc, inputColor, inputCoverage); |
| 216 | 216 |
| 217 fFragmentProcessors.reset(SkNEW(GrGLInstalledFragProcs)); | 217 fFragmentProcessors.reset(SkNEW(GrGLInstalledFragProcs)); |
| 218 int numProcs = this->pipeline().numFragmentStages(); | 218 int numProcs = this->pipeline().numFragmentStages(); |
| 219 this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentStages(),
inputColor); | 219 this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentStages(),
inputColor); |
| 220 this->emitAndInstallFragProcs(this->pipeline().numColorFragmentStages(), num
Procs, | 220 this->emitAndInstallFragProcs(this->pipeline().numColorFragmentStages(), num
Procs, |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 } | 503 } |
| 504 | 504 |
| 505 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 505 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 506 | 506 |
| 507 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 507 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
| 508 int numProcs = fProcs.count(); | 508 int numProcs = fProcs.count(); |
| 509 for (int e = 0; e < numProcs; ++e) { | 509 for (int e = 0; e < numProcs; ++e) { |
| 510 SkDELETE(fProcs[e]); | 510 SkDELETE(fProcs[e]); |
| 511 } | 511 } |
| 512 } | 512 } |
| OLD | NEW |