aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-11-25 14:52:21 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-25 14:52:21 -0800
commit267ce482b54f46097584e0f9350ec74aa6a2cd44 (patch)
treef6e1b86eb0f3a37a81981c774ee8e37cc7b7b514
parent7e225bdb1f00ae4aed524ff8d0a61df3d3abb109 (diff)
remove proc key
-rw-r--r--include/gpu/GrBackendProcessorFactory.h25
-rw-r--r--src/core/SkXfermode.cpp1
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp2
-rw-r--r--src/effects/SkArithmeticMode.cpp2
-rw-r--r--src/effects/SkBlurMaskFilter.cpp4
-rw-r--r--src/effects/SkColorCubeFilter.cpp2
-rw-r--r--src/effects/SkColorFilters.cpp1
-rw-r--r--src/effects/SkColorMatrixFilter.cpp1
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp2
-rw-r--r--src/effects/SkLightingImageFilter.cpp2
-rw-r--r--src/effects/SkLumaColorFilter.cpp1
-rw-r--r--src/effects/SkMagnifierImageFilter.cpp2
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp2
-rw-r--r--src/effects/SkPerlinNoiseShader.cpp2
-rw-r--r--src/effects/SkTableColorFilter.cpp2
-rw-r--r--src/effects/gradients/SkGradientShader.cpp2
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp2
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp2
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp2
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp10
-rw-r--r--src/effects/gradients/SkTwoPointRadialGradient.cpp2
-rw-r--r--src/gpu/GrProgramDesc.h39
-rw-r--r--src/gpu/effects/GrBicubicEffect.cpp2
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp1
-rw-r--r--src/gpu/effects/GrConvexPolyEffect.cpp4
-rw-r--r--src/gpu/effects/GrConvolutionEffect.cpp2
-rw-r--r--src/gpu/effects/GrDitherEffect.cpp2
-rw-r--r--src/gpu/effects/GrMatrixConvolutionEffect.cpp2
-rw-r--r--src/gpu/effects/GrOvalEffect.cpp4
-rw-r--r--src/gpu/effects/GrRRectEffect.cpp14
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.cpp1
-rw-r--r--src/gpu/effects/GrTextureDomain.cpp2
-rw-r--r--src/gpu/effects/GrYUVtoRGBEffect.cpp1
-rw-r--r--src/gpu/gl/GrGLGeometryProcessor.h4
-rw-r--r--src/gpu/gl/GrGLProcessor.h1
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp20
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.h4
-rw-r--r--tests/GLProgramsTest.cpp7
38 files changed, 13 insertions, 168 deletions
diff --git a/include/gpu/GrBackendProcessorFactory.h b/include/gpu/GrBackendProcessorFactory.h
index 3e4f133147..9dda1659d0 100644
--- a/include/gpu/GrBackendProcessorFactory.h
+++ b/include/gpu/GrBackendProcessorFactory.h
@@ -49,31 +49,6 @@ private:
};
/**
- * This class is used to pass the key that was created for a GrGLProcessor back to it
- * when it emits code. It may allow the emit step to skip calculations that were
- * performed when computing the key.
- */
-class GrProcessorKey {
-public:
- GrProcessorKey(const uint32_t* key, int count) : fKey(key), fCount(count) {
- SkASSERT(0 == reinterpret_cast<intptr_t>(key) % sizeof(uint32_t));
- }
-
- /** Gets the uint32_t values that the processor inserted into the key. */
- uint32_t get32(int index) const {
- SkASSERT(index >=0 && index < fCount);
- return fKey[index];
- }
-
- /** Gets the number of uint32_t values that the processor inserted into the key. */
- int count32() const { return fCount; }
-
-private:
- const uint32_t* fKey; // unowned ptr into the larger key.
- int fCount; // number of uint32_ts inserted by the processor into its key.
-};
-
-/**
* Given a GrProcessor of a particular type, creates the corresponding graphics-backend-specific
* processor object. It also tracks equivalence of shaders generated via a key. The factory for an
* processor is accessed via GrProcessor::getFactory(). Each factory instance is assigned an ID at
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 77c668457b..4a3ec39702 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -816,7 +816,6 @@ public:
}
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index c01dd975d0..e181675409 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -123,7 +123,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -146,7 +145,6 @@ GrGLAlphaThresholdEffect::GrGLAlphaThresholdEffect(const GrBackendProcessorFacto
void GrGLAlphaThresholdEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index 13db53295a..6fb5241c82 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -256,7 +256,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -362,7 +361,6 @@ GrGLArithmeticEffect::~GrGLArithmeticEffect() {
void GrGLArithmeticEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 4601ebb787..5b0e60adde 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -673,7 +673,6 @@ public:
const GrProcessor&);
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -714,7 +713,6 @@ void OutputRectBlurProfileLookup(GrGLFPFragmentBuilder* fsBuilder,
void GrGLRectBlurEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
@@ -1035,7 +1033,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -1057,7 +1054,6 @@ GrGLRRectBlurEffect::GrGLRRectBlurEffect(const GrBackendProcessorFactory& factor
void GrGLRRectBlurEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index 751d974ba3..18c5b5603f 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -216,7 +216,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -276,7 +275,6 @@ GrColorCubeEffect::GLProcessor::~GLProcessor() {
void GrColorCubeEffect::GLProcessor::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 0f6018f5d4..e085281aa5 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -223,7 +223,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index f8b9101ae1..20702920de 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -364,7 +364,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index d2d858148d..edae0441f4 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -306,7 +306,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -540,7 +539,6 @@ GrGLDisplacementMapEffect::~GrGLDisplacementMapEffect() {
void GrGLDisplacementMapEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 5baae4aead..bf9877e044 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1230,7 +1230,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -1362,7 +1361,6 @@ GrGLLightingEffect::~GrGLLightingEffect() {
void GrGLLightingEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index f3e6e783a2..2b57cb1cef 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -85,7 +85,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 35f39c3368..e0826efe0d 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -98,7 +98,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -121,7 +120,6 @@ GrGLMagnifierEffect::GrGLMagnifierEffect(const GrBackendProcessorFactory& factor
void GrGLMagnifierEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 6f821bdad2..9c97c35bc2 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -335,7 +335,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -365,7 +364,6 @@ GrGLMorphologyEffect::GrGLMorphologyEffect(const GrBackendProcessorFactory& fact
void GrGLMorphologyEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 5f400b57cf..019258972d 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -518,7 +518,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -663,7 +662,6 @@ GrGLPerlinNoise::GrGLPerlinNoise(const GrBackendProcessorFactory& factory,
void GrGLPerlinNoise::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index ac12327ed6..c3c2ba067b 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -326,7 +326,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -366,7 +365,6 @@ void GLColorTableEffect::setData(const GrGLProgramDataManager& pdm, const GrProc
void GLColorTableEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 48d02381ef..a84c6fda25 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1046,7 +1046,7 @@ uint32_t GrGLGradientEffect::GenBaseGradientKey(const GrProcessor& processor) {
if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()) {
key |= kTwoColorKey;
- } else if (SkGradientShaderBase::kThree_GpuColorType == e.getColorType()){
+ } else if (SkGradientShaderBase::kThree_GpuColorType == e.getColorType()) {
key |= kThreeColorKey;
}
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 5ad998ed95..3ab721950a 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -475,7 +475,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -552,7 +551,6 @@ GrFragmentProcessor* GrLinearGradient::TestCreate(SkRandom* random,
void GrGLLinearGradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index a891e5fb23..99531d93d4 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -482,7 +482,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -561,7 +560,6 @@ GrFragmentProcessor* GrRadialGradient::TestCreate(SkRandom* random,
void GrGLRadialGradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index b135792fdc..d080ec5fde 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -197,7 +197,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -268,7 +267,6 @@ GrFragmentProcessor* GrSweepGradient::TestCreate(SkRandom* random,
void GrGLSweepGradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index b09f3167f8..7bd2409b06 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -142,7 +142,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -225,7 +224,6 @@ GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrBackendProcessorFactory&
void GLEdge2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
@@ -423,7 +421,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -506,7 +503,6 @@ GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrBackendPr
void GLFocalOutside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
@@ -632,7 +628,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -712,7 +707,6 @@ GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrBackendProc
void GLFocalInside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
@@ -877,7 +871,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -965,7 +958,6 @@ GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendPr
void GLCircleInside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
@@ -1109,7 +1101,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -1205,7 +1196,6 @@ GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackend
void GLCircleOutside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index f4bcc2c5a3..3e400445ae 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -413,7 +413,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -569,7 +568,6 @@ GrGLRadial2Gradient::GrGLRadial2Gradient(const GrBackendProcessorFactory& factor
void GrGLRadial2Gradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/GrProgramDesc.h b/src/gpu/GrProgramDesc.h
index cc8a38aa2d..788842d7be 100644
--- a/src/gpu/GrProgramDesc.h
+++ b/src/gpu/GrProgramDesc.h
@@ -139,45 +139,6 @@ public:
// This should really only be used internally, base classes should return their own headers
const KeyHeader& header() const { return *this->atOffset<KeyHeader, kHeaderOffset>(); }
- /** Used to provide effects' keys to their emitCode() function. */
- class ProcKeyProvider {
- public:
- enum ProcessorType {
- kGeometry_ProcessorType,
- kFragment_ProcessorType,
- };
-
- ProcKeyProvider(const GrProgramDesc* desc, ProcessorType type, int effectOffset)
- : fDesc(desc), fBaseIndex(0), fEffectOffset(effectOffset) {
- switch (type) {
- case kGeometry_ProcessorType:
- // there can be only one
- fBaseIndex = 0;
- break;
- case kFragment_ProcessorType:
- fBaseIndex = desc->hasGeometryProcessor() ? 1 : 0;
- break;
- }
- }
-
- GrProcessorKey get(int index) const {
- const uint16_t* offsetsAndLengths = reinterpret_cast<const uint16_t*>(
- fDesc->fKey.begin() + fEffectOffset);
- // We store two uint16_ts per effect, one for the offset to the effect's key and one for
- // its length. Here we just need the offset.
- uint16_t offset = offsetsAndLengths[2 * (fBaseIndex + index) + 0];
- uint16_t length = offsetsAndLengths[2 * (fBaseIndex + index) + 1];
- // Currently effects must add to the key in units of uint32_t.
- SkASSERT(0 == (length % sizeof(uint32_t)));
- return GrProcessorKey(reinterpret_cast<const uint32_t*>(fDesc->fKey.begin() + offset),
- length / sizeof(uint32_t));
- }
- private:
- const GrProgramDesc* fDesc;
- int fBaseIndex;
- int fEffectOffset;
- };
-
// A struct to communicate descriptor information to the program descriptor builder
struct DescInfo {
int positionAttributeIndex() const {
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index ce7810dc5a..51ba58efd5 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -26,7 +26,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -56,7 +55,6 @@ GrGLBicubicEffect::GrGLBicubicEffect(const GrBackendProcessorFactory& factory, c
void GrGLBicubicEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 6f02f3073f..d487841789 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -27,7 +27,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index ff08eae2d0..c2874e0045 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -89,7 +89,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -113,7 +112,6 @@ GLAARectEffect::GLAARectEffect(const GrBackendProcessorFactory& factory,
void GLAARectEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -183,7 +181,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -207,7 +204,6 @@ GrGLConvexPolyEffect::GrGLConvexPolyEffect(const GrBackendProcessorFactory& fact
void GrGLConvexPolyEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 310e531aff..6e1f3c4ce7 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -21,7 +21,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -57,7 +56,6 @@ GrGLConvolutionEffect::GrGLConvolutionEffect(const GrBackendProcessorFactory& fa
void GrGLConvolutionEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index 37655a7116..438fe2c60a 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -72,7 +72,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -89,7 +88,6 @@ GLDitherEffect::GLDitherEffect(const GrBackendProcessorFactory& factory,
void GLDitherEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 07a24a3477..698b7050ef 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -17,7 +17,6 @@ public:
const GrProcessor&);
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -53,7 +52,6 @@ GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrBackendProcesso
void GrGLMatrixConvolutionEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index 26b96ad8ec..37555eac51 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -103,7 +103,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -129,7 +128,6 @@ GLCircleEffect::GLCircleEffect(const GrBackendProcessorFactory& factory,
void GLCircleEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -278,7 +276,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -304,7 +301,6 @@ GLEllipseEffect::GLEllipseEffect(const GrBackendProcessorFactory& factory,
void GLEllipseEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index b378b1025b..7e58c1fe28 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -139,7 +139,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -163,12 +162,11 @@ GLCircularRRectEffect::GLCircularRRectEffect(const GrBackendProcessorFactory& fa
}
void GLCircularRRectEffect::emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray&,
- const TextureSamplerArray& samplers) {
+ const GrFragmentProcessor& fp,
+ const char* outputColor,
+ const char* inputColor,
+ const TransformedCoordsArray&,
+ const TextureSamplerArray& samplers) {
const CircularRRectEffect& crre = fp.cast<CircularRRectEffect>();
const char *rectName;
const char *radiusPlusHalfName;
@@ -494,7 +492,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -519,7 +516,6 @@ GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrBackendProcessorFactory
void GLEllipticalRRectEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 9c0ff354ce..a8eab3a771 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -22,7 +22,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index de552c0ac9..1de518c170 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -172,7 +172,6 @@ public:
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
@@ -194,7 +193,6 @@ GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendProcessorFactory
void GrGLTextureDomainEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index f668dbae17..87432d4668 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -48,7 +48,6 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
- const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLGeometryProcessor.h
index b61535e098..06b4aa9d47 100644
--- a/src/gpu/gl/GrGLGeometryProcessor.h
+++ b/src/gpu/gl/GrGLGeometryProcessor.h
@@ -25,14 +25,12 @@ public:
struct EmitArgs {
EmitArgs(GrGLGPBuilder* pb,
const GrGeometryProcessor& gp,
- const GrProcessorKey& key,
const char* output,
const char* input,
const TextureSamplerArray& samplers)
- : fPB(pb), fGP(gp), fKey(key), fOutput(output), fInput(input), fSamplers(samplers) {}
+ : fPB(pb), fGP(gp), fOutput(output), fInput(input), fSamplers(samplers) {}
GrGLGPBuilder* fPB;
const GrGeometryProcessor& fGP;
- const GrProcessorKey& fKey;
const char* fOutput;
const char* fInput;
const TextureSamplerArray& fSamplers;
diff --git a/src/gpu/gl/GrGLProcessor.h b/src/gpu/gl/GrGLProcessor.h
index f5ebf51b08..4bc3dd019b 100644
--- a/src/gpu/gl/GrGLProcessor.h
+++ b/src/gpu/gl/GrGLProcessor.h
@@ -116,7 +116,6 @@ public:
*/
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index e56a83d2f1..16cc5d4964 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -250,24 +250,18 @@ void GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor,
if (fOptState.hasGeometryProcessor()) {
const GrGeometryProcessor& gp = *fOptState.getGeometryProcessor();
fVS.emitAttributes(gp);
- ProcKeyProvider keyProvider(&fDesc,
- ProcKeyProvider::kGeometry_ProcessorType,
- GrGLProgramDescBuilder::kProcessorKeyOffsetsAndLengthOffset);
GrGLSLExpr4 output;
- this->emitAndInstallProc<GrGeometryProcessor>(gp, 0, keyProvider, *inputCoverage, &output);
+ this->emitAndInstallProc<GrGeometryProcessor>(gp, 0, *inputCoverage, &output);
*inputCoverage = output;
}
this->emitAndInstallFragProcs(fOptState.numColorStages(), numProcs, inputCoverage);
}
void GrGLProgramBuilder::emitAndInstallFragProcs(int procOffset, int numProcs, GrGLSLExpr4* inOut) {
- ProcKeyProvider keyProvider(&fDesc,
- ProcKeyProvider::kFragment_ProcessorType,
- GrGLProgramDescBuilder::kProcessorKeyOffsetsAndLengthOffset);
for (int e = procOffset; e < numProcs; ++e) {
GrGLSLExpr4 output;
const GrPendingFragmentStage& stage = fOptState.getFragmentStage(e);
- this->emitAndInstallProc<GrPendingFragmentStage>(stage, e, keyProvider, *inOut, &output);
+ this->emitAndInstallProc<GrPendingFragmentStage>(stage, e, *inOut, &output);
*inOut = output;
}
}
@@ -277,7 +271,6 @@ void GrGLProgramBuilder::emitAndInstallFragProcs(int procOffset, int numProcs, G
template <class Proc>
void GrGLProgramBuilder::emitAndInstallProc(const Proc& proc,
int index,
- const ProcKeyProvider& keyProvider,
const GrGLSLExpr4& input,
GrGLSLExpr4* output) {
// Program builders have a bit of state we need to clear with each effect
@@ -299,14 +292,12 @@ void GrGLProgramBuilder::emitAndInstallProc(const Proc& proc,
openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name());
fFS.codeAppend(openBrace.c_str());
- this->emitAndInstallProc(proc, keyProvider.get(index), output->c_str(),
- input.isOnes() ? NULL : input.c_str());
+ this->emitAndInstallProc(proc, output->c_str(), input.isOnes() ? NULL : input.c_str());
fFS.codeAppend("}");
}
void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs,
- const GrProcessorKey& key,
const char* outColor,
const char* inColor) {
GrGLInstalledFragProc* ifp = SkNEW_ARGS(GrGLInstalledFragProc, (fVS.hasLocalCoords()));
@@ -321,7 +312,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs,
SkSTArray<2, GrGLProcessor::TransformedCoords> coords(fp.numTransforms());
this->emitTransforms(fs, &coords, ifp);
- ifp->fGLProc->emitCode(this, fp, key, outColor, inColor, coords, samplers);
+ ifp->fGLProc->emitCode(this, fp, outColor, inColor, coords, samplers);
// We have to check that effects and the code they emit are consistent, ie if an effect
// asks for dst color, then the emit code needs to follow suit
@@ -330,7 +321,6 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs,
}
void GrGLProgramBuilder::emitAndInstallProc(const GrGeometryProcessor& gp,
- const GrProcessorKey& key,
const char* outCoverage,
const char* inCoverage) {
SkASSERT(!fGeometryProcessor);
@@ -341,7 +331,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrGeometryProcessor& gp,
SkSTArray<4, GrGLProcessor::TextureSampler> samplers(gp.numTextures());
this->emitSamplers(gp, &samplers, fGeometryProcessor);
- GrGLGeometryProcessor::EmitArgs args(this, gp, key, outCoverage, inCoverage, samplers);
+ GrGLGeometryProcessor::EmitArgs args(this, gp, outCoverage, inCoverage, samplers);
fGeometryProcessor->fGLProc->emitCode(args);
// We have to check that effects and the code they emit are consistent, ie if an effect
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index e6180cc36d..7a4646d03f 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -223,7 +223,6 @@ public:
};
protected:
- typedef GrProgramDesc::ProcKeyProvider ProcKeyProvider;
typedef GrGLProgramDataManager::UniformInfo UniformInfo;
typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray;
@@ -249,17 +248,14 @@ protected:
template <class Proc>
void emitAndInstallProc(const Proc&,
int index,
- const ProcKeyProvider&,
const GrGLSLExpr4& input,
GrGLSLExpr4* output);
// these emit functions help to keep the createAndEmitProcessors template general
void emitAndInstallProc(const GrPendingFragmentStage&,
- const GrProcessorKey&,
const char* outColor,
const char* inColor);
void emitAndInstallProc(const GrGeometryProcessor&,
- const GrProcessorKey&,
const char* outCoverage,
const char* inCoverage);
void verify(const GrGeometryProcessor&);
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index a6b2ee397d..f03f3014aa 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -74,15 +74,10 @@ public:
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
- const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
- const TextureSamplerArray&) {
- for (uint32_t i = 0; i < kMaxKeySize; i++) {
- SkASSERT(key.get32(i) == i);
- }
- }
+ const TextureSamplerArray&) {}
static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) {
for (uint32_t i = 0; i < kMaxKeySize; i++) {