Remove GrGLSLFragProcs typedef. Use unique_ptr to for GrGLSLFragmentProcessor ownership.
Change-Id: Ifefbde2ec0002e7e41bed2e4bc2cd7bdd04504d0
Reviewed-on: https://skia-review.googlesource.com/132931
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h
index d4d2099..04d169d 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.h
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.h
@@ -24,8 +24,6 @@
class SkString;
class GrShaderCaps;
-typedef SkSTArray<8, GrGLSLFragmentProcessor*, true> GrGLSLFragProcs;
-
class GrGLSLProgramBuilder {
public:
using UniformHandle = GrGLSLUniformHandler::UniformHandle;
@@ -100,7 +98,8 @@
std::unique_ptr<GrGLSLPrimitiveProcessor> fGeometryProcessor;
std::unique_ptr<GrGLSLXferProcessor> fXferProcessor;
- GrGLSLFragProcs fFragmentProcessors;
+ std::unique_ptr<std::unique_ptr<GrGLSLFragmentProcessor>[]> fFragmentProcessors;
+ int fFragmentProcessorCnt;
protected:
explicit GrGLSLProgramBuilder(const GrPipeline&,
@@ -111,8 +110,6 @@
bool emitAndInstallProcs();
- void cleanupFragmentProcessors();
-
void finalizeShaders();
bool fragColorIsInOut() const { return fFS.primaryColorOutputIsInOut(); }
@@ -151,7 +148,8 @@
int index,
int transformedCoordVarsIdx,
const SkString& input,
- SkString output);
+ SkString output,
+ SkTArray<std::unique_ptr<GrGLSLFragmentProcessor>>*);
void emitAndInstallXferProc(const SkString& colorIn, const SkString& coverageIn);
void emitSamplers(const GrResourceIOProcessor& processor,
SkTArray<SamplerHandle>* outTexSamplerHandles,