Use GLSLCaps for creating processor keys and GLSL-specific programs

Effectively all this does is future-proof any GLSL-specific code, as
GLSLCaps is just a typedef of GLCaps.

BUG=skia:

Review URL: https://codereview.chromium.org/1109863004
This commit is contained in:
jvanverth 2015-04-28 08:48:20 -07:00 committed by Commit bot
parent 77772f3ca3
commit cfc18867d9
68 changed files with 239 additions and 219 deletions

View File

@ -60,7 +60,7 @@ public:
this->initClassID<DCFP>();
}
void getGLProcessorKey(const GrGLCaps& caps,
void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {}
GrGLFragmentProcessor* createGLInstance() const override {

View File

@ -1,3 +1,9 @@
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTableColorFilter_DEFINED
#define SkTableColorFilter_DEFINED

View File

@ -12,6 +12,7 @@
class GrCoordTransform;
class GrGLCaps;
typedef GrGLCaps GrGLSLCaps;
class GrGLFragmentProcessor;
class GrProcessorKeyBuilder;
@ -28,7 +29,7 @@ public:
, fUsesLocalCoords(false) {}
/** Implemented using GLFragmentProcessor::GenKey as described in this class's comment. */
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const = 0;
/** Returns a new instance of the appropriate *GL* implementation class

View File

@ -16,6 +16,7 @@
class GrDrawTargetCaps;
class GrGLCaps;
typedef GrGLCaps GrGLSLCaps;
class GrGLXferProcessor;
class GrProcOptInfo;
@ -66,7 +67,7 @@ public:
* Sets a unique key on the GrProcessorKeyBuilder calls onGetGLProcessorKey(...) to get the
* specific subclass's key.
*/
void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const;
void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const;
/** Returns a new instance of the appropriate *GL* implementation class
for the given GrXferProcessor; caller is responsible for deleting
@ -199,7 +200,7 @@ private:
* Sets a unique key on the GrProcessorKeyBuilder that is directly associated with this xfer
* processor's GL backend implementation.
*/
virtual void onGetGLProcessorKey(const GrGLCaps& caps,
virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const = 0;
/**

View File

@ -36,7 +36,7 @@ public:
const char* name() const override { return "Color"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -76,7 +76,7 @@ public:
float innerThreshold() const { return fInnerThreshold; }
float outerThreshold() const { return fOuterThreshold; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -214,7 +214,7 @@ GrFragmentProcessor* AlphaThresholdEffect::TestCreate(SkRandom* random,
///////////////////////////////////////////////////////////////////////////////
void AlphaThresholdEffect::getGLProcessorKey(const GrGLCaps& caps,
void AlphaThresholdEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLAlphaThresholdEffect::GenKey(*this, caps, b);
}

View File

@ -86,7 +86,7 @@ public:
fEnforcePMColor = arith.enforcePMColor();
}
static void GenKey(const GrProcessor& proc, const GrGLCaps& caps, GrProcessorKeyBuilder* b) {
static void GenKey(const GrProcessor& proc, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) {
const GrArithmeticFP& arith = proc.cast<GrArithmeticFP>();
uint32_t key = arith.enforcePMColor() ? 1 : 0;
b->add32(key);
@ -115,7 +115,7 @@ GrArithmeticFP::GrArithmeticFP(float k1, float k2, float k3, float k4,
this->addTextureAccess(&fBackgroundAccess);
}
void GrArithmeticFP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void GrArithmeticFP::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLArithmeticFP::GenKey(*this, caps, b);
}
@ -191,7 +191,7 @@ private:
ArithmeticXP(float k1, float k2, float k3, float k4, bool enforcePMColor,
const GrDeviceCoordTexture* dstCopy, bool willReadDstColor);
void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
bool onIsEqual(const GrXferProcessor& xpBase) const override {
const ArithmeticXP& xp = xpBase.cast<ArithmeticXP>();
@ -221,7 +221,7 @@ public:
~GLArithmeticXP() override {}
static void GenKey(const GrProcessor& processor, const GrGLCaps& caps,
static void GenKey(const GrProcessor& processor, const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) {
const ArithmeticXP& arith = processor.cast<ArithmeticXP>();
uint32_t key = arith.enforcePMColor() ? 1 : 0;
@ -273,7 +273,7 @@ ArithmeticXP::ArithmeticXP(float k1, float k2, float k3, float k4, bool enforceP
this->initClassID<ArithmeticXP>();
}
void ArithmeticXP::onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void ArithmeticXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLArithmeticXP::GenKey(*this, caps, b);
}

View File

@ -40,7 +40,7 @@ public:
const char* name() const override { return "Arithmetic"; }
void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -609,7 +609,7 @@ public:
const char* name() const override { return "RectBlur"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -798,7 +798,7 @@ GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma,
GrRectBlurEffect::~GrRectBlurEffect() {
}
void GrRectBlurEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrRectBlurEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLRectBlurEffect::GenKey(*this, caps, b);
}
@ -881,7 +881,7 @@ public:
const SkRRect& getRRect() const { return fRRect; }
float getSigma() const { return fSigma; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -1108,7 +1108,7 @@ void GrGLRRectBlurEffect::setData(const GrGLProgramDataManager& pdman,
pdman.set1f(fCornerRadiusUniform, radius);
}
void GrRRectBlurEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void GrRRectBlurEffect::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GrGLRRectBlurEffect::GenKey(*this, caps, b);
}

View File

@ -194,7 +194,7 @@ public:
const char* name() const override { return "ColorCube"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -215,7 +215,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -247,7 +247,7 @@ GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube)
GrColorCubeEffect::~GrColorCubeEffect() {
}
void GrColorCubeEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void GrColorCubeEffect::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLProcessor::GenKey(*this, caps, b);
}
@ -334,7 +334,7 @@ void GrColorCubeEffect::GLProcessor::setData(const GrGLProgramDataManager& pdman
}
void GrColorCubeEffect::GLProcessor::GenKey(const GrProcessor& proc,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
}
bool SkColorCubeFilter::asFragmentProcessors(GrContext* context,

View File

@ -147,7 +147,7 @@ public:
return true;
}
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, caps, b);
}
@ -191,7 +191,7 @@ public:
codeAppendf("\t%s = %s;\n", outputColor, filter.c_str());
}
static void GenKey(const GrProcessor& fp, const GrGLCaps&,
static void GenKey(const GrProcessor& fp, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const ModeColorFilterEffect& colorModeFilter = fp.cast<ModeColorFilterEffect>();
// The SL code does not depend on filter color at the moment, so no need to represent it

View File

@ -408,7 +408,7 @@ public:
const char* name() const override { return "Color Matrix"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, caps, b);
}
@ -423,7 +423,7 @@ public:
class GLProcessor : public GrGLFragmentProcessor {
public:
// this class always generates the same code.
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b) {}
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
GLProcessor(const GrProcessor&) {}

View File

@ -312,7 +312,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
const GrTextureDomain::GLDomain& glDomain() const { return fGLDomain; }
@ -346,7 +346,7 @@ public:
virtual ~GrDisplacementMapEffect();
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLDisplacementMapEffect::GenKey(*this, caps, b);
}
@ -634,7 +634,7 @@ void GrGLDisplacementMapEffect::setData(const GrGLProgramDataManager& pdman,
}
void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMapEffect>();
uint32_t xKey = displacementMap.xChannelSelector();

View File

@ -508,7 +508,7 @@ public:
const char* name() const override { return "DiffuseLighting"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -549,7 +549,7 @@ public:
const char* name() const override { return "SpecularLighting"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -1481,7 +1481,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
/**
* Subclasses of GrGLLightingEffect must call INHERITED::setData();
@ -1576,7 +1576,7 @@ bool GrDiffuseLightingEffect::onIsEqual(const GrFragmentProcessor& sBase) const
this->kd() == s.kd();
}
void GrDiffuseLightingEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrDiffuseLightingEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLDiffuseLightingEffect::GenKey(*this, caps, b);
}
@ -1709,7 +1709,7 @@ void GrGLLightingEffect::emitCode(GrGLFPBuilder* builder,
}
void GrGLLightingEffect::GenKey(const GrProcessor& proc,
const GrGLCaps& caps, GrProcessorKeyBuilder* b) {
const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) {
const GrLightingEffect& lighting = proc.cast<GrLightingEffect>();
b->add32(lighting.boundaryMode() << 2 | lighting.light()->type());
}
@ -1784,7 +1784,7 @@ bool GrSpecularLightingEffect::onIsEqual(const GrFragmentProcessor& sBase) const
this->shininess() == s.shininess();
}
void GrSpecularLightingEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrSpecularLightingEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLSpecularLightingEffect::GenKey(*this, caps, b);
}

View File

@ -65,7 +65,7 @@ public:
const char* name() const override { return "Luminance-to-Alpha"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, caps, b);
}
@ -78,7 +78,7 @@ public:
public:
GLProcessor(const GrProcessor&) {}
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b) {}
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,

View File

@ -46,7 +46,7 @@ public:
const char* name() const override { return "Magnifier"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -197,7 +197,7 @@ void GrGLMagnifierEffect::setData(const GrGLProgramDataManager& pdman,
/////////////////////////////////////////////////////////////////////
void GrMagnifierEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrMagnifierEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLMagnifierEffect::GenKey(*this, caps, b);
}

View File

@ -315,7 +315,7 @@ public:
const char* name() const override { return "Morphology"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -351,7 +351,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -450,7 +450,7 @@ void GrGLMorphologyEffect::emitCode(GrGLFPBuilder* builder,
}
void GrGLMorphologyEffect::GenKey(const GrProcessor& proc,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
const GrMorphologyEffect& m = proc.cast<GrMorphologyEffect>();
uint32_t key = static_cast<uint32_t>(m.radius());
key |= (m.type() << 8);
@ -517,7 +517,7 @@ GrMorphologyEffect::GrMorphologyEffect(GrTexture* texture,
GrMorphologyEffect::~GrMorphologyEffect() {
}
void GrMorphologyEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void GrMorphologyEffect::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GrGLMorphologyEffect::GenKey(*this, caps, b);
}

View File

@ -498,7 +498,7 @@ public:
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
private:
@ -532,7 +532,7 @@ public:
const char* name() const override { return "PerlinNoise"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLPerlinNoise::GenKey(*this, caps, b);
}
@ -897,7 +897,7 @@ void GrGLPerlinNoise::emitCode(GrGLFPBuilder* builder,
outputColor, outputColor, outputColor, outputColor);
}
void GrGLPerlinNoise::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GrGLPerlinNoise::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrPerlinNoiseEffect& turbulence = processor.cast<GrPerlinNoiseEffect>();

View File

@ -1,3 +1,9 @@
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkBitmap.h"
#include "SkTableColorFilter.h"
@ -340,7 +346,7 @@ public:
const char* name() const override { return "ColorTable"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -380,7 +386,7 @@ public:
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b) {}
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
private:
UniformHandle fRGBAYValuesUni;
@ -501,7 +507,7 @@ ColorTableEffect::~ColorTableEffect() {
}
}
void ColorTableEffect::getGLProcessorKey(const GrGLCaps& caps,
void ColorTableEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLColorTableEffect::GenKey(*this, caps, b);
}

View File

@ -474,7 +474,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) {
static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
}
@ -499,7 +499,7 @@ public:
const char* name() const override { return "Linear Gradient"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLLinearGradient::GenKey(*this, caps, b);
}

View File

@ -547,7 +547,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) {
static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
}
@ -572,7 +572,7 @@ public:
const char* name() const override { return "Radial Gradient"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLRadialGradient::GenKey(*this, caps, b);
}

View File

@ -197,7 +197,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) {
static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
}
@ -219,7 +219,7 @@ public:
const char* name() const override { return "Sweep Gradient"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLSweepGradient::GenKey(*this, caps, b);
}

View File

@ -70,7 +70,7 @@ public:
return "Two-Point Conical Gradient Edge Touching";
}
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -149,7 +149,7 @@ public:
const TextureSamplerArray&) override;
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b);
static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b);
protected:
UniformHandle fParamUni;
@ -170,7 +170,7 @@ private:
};
void Edge2PtConicalEffect::getGLProcessorKey(const GrGLCaps& caps,
void Edge2PtConicalEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLEdge2PtConicalEffect::GenKey(*this, caps, b);
}
@ -309,7 +309,7 @@ void GLEdge2PtConicalEffect::setData(const GrGLProgramDataManager& pdman,
}
void GLEdge2PtConicalEffect::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
}
@ -392,7 +392,7 @@ public:
return "Two-Point Conical Gradient Focal Outside";
}
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -437,7 +437,7 @@ public:
const TextureSamplerArray&) override;
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b);
static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b);
protected:
UniformHandle fParamUni;
@ -459,7 +459,7 @@ private:
};
void FocalOutside2PtConicalEffect::getGLProcessorKey(const GrGLCaps& caps,
void FocalOutside2PtConicalEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLFocalOutside2PtConicalEffect::GenKey(*this, caps, b);
}
@ -587,7 +587,7 @@ void GLFocalOutside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman
}
void GLFocalOutside2PtConicalEffect::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
uint32_t* key = b->add32n(2);
key[0] = GenBaseGradientKey(processor);
key[1] = processor.cast<FocalOutside2PtConicalEffect>().isFlipped();
@ -614,7 +614,7 @@ public:
return "Two-Point Conical Gradient Focal Inside";
}
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -658,7 +658,7 @@ public:
const TextureSamplerArray&) override;
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b);
static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b);
protected:
UniformHandle fFocalUni;
@ -678,7 +678,7 @@ private:
};
void FocalInside2PtConicalEffect::getGLProcessorKey(const GrGLCaps& caps,
void FocalInside2PtConicalEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLFocalInside2PtConicalEffect::GenKey(*this, caps, b);
}
@ -776,7 +776,7 @@ void GLFocalInside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman,
}
void GLFocalInside2PtConicalEffect::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
}
@ -859,7 +859,7 @@ public:
const char* name() const override { return "Two-Point Conical Gradient Inside"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -909,7 +909,7 @@ public:
const TextureSamplerArray&) override;
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b);
static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b);
protected:
UniformHandle fCenterUni;
@ -934,7 +934,7 @@ private:
};
void CircleInside2PtConicalEffect::getGLProcessorKey(const GrGLCaps& caps,
void CircleInside2PtConicalEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLCircleInside2PtConicalEffect::GenKey(*this, caps, b);
}
@ -1062,7 +1062,7 @@ void GLCircleInside2PtConicalEffect::setData(const GrGLProgramDataManager& pdman
}
void GLCircleInside2PtConicalEffect::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
}
@ -1083,7 +1083,7 @@ public:
const char* name() const override { return "Two-Point Conical Gradient Outside"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -1146,7 +1146,7 @@ public:
const TextureSamplerArray&) override;
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b);
static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b);
protected:
UniformHandle fCenterUni;
@ -1174,7 +1174,7 @@ private:
};
void CircleOutside2PtConicalEffect::getGLProcessorKey(const GrGLCaps& caps,
void CircleOutside2PtConicalEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLCircleOutside2PtConicalEffect::GenKey(*this, caps, b);
}
@ -1328,7 +1328,7 @@ void GLCircleOutside2PtConicalEffect::setData(const GrGLProgramDataManager& pdma
}
void GLCircleOutside2PtConicalEffect::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
uint32_t* key = b->add32n(2);
key[0] = GenBaseGradientKey(processor);
key[1] = processor.cast<CircleOutside2PtConicalEffect>().isFlipped();

View File

@ -408,7 +408,7 @@ public:
const TextureSamplerArray&) override;
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static void GenKey(const GrProcessor&, const GrGLCaps& caps, GrProcessorKeyBuilder* b);
static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b);
protected:
@ -449,7 +449,7 @@ public:
const char* name() const override { return "Two-Point Radial Gradient"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLRadial2Gradient::GenKey(*this, caps, b);
}
@ -669,7 +669,7 @@ void GrGLRadial2Gradient::setData(const GrGLProgramDataManager& pdman,
}
void GrGLRadial2Gradient::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
uint32_t* key = b->add32n(2);
key[0] = GenBaseGradientKey(processor);
key[1] = processor.cast<GrRadial2Gradient>().isDegenerate();

View File

@ -576,7 +576,7 @@ public:
static inline void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const BatchTracker& local = bt.cast<BatchTracker>();
uint32_t key = local.fInputColorType << 16;
@ -607,13 +607,13 @@ public:
};
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, bt, caps, b);
}
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override {
const GrGLSLCaps&) const override {
return SkNEW_ARGS(GLProcessor, (*this, bt));
}

View File

@ -129,7 +129,7 @@ public:
static inline void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const DefaultGeoProc& def = gp.cast<DefaultGeoProc>();
const BatchTracker& local = bt.cast<BatchTracker>();
@ -168,13 +168,13 @@ public:
};
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, bt, caps, b);
}
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override {
const GrGLSLCaps&) const override {
return SkNEW_ARGS(GLProcessor, (*this, bt));
}

View File

@ -127,7 +127,7 @@ public:
static void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const BatchTracker& local = bt.cast<BatchTracker>();
const CircleEdgeEffect& circleEffect = gp.cast<CircleEdgeEffect>();
@ -158,13 +158,13 @@ public:
};
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, bt, caps, b);
}
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override {
const GrGLSLCaps&) const override {
return SkNEW_ARGS(GLProcessor, (*this, bt));
}
@ -321,7 +321,7 @@ public:
static void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const BatchTracker& local = bt.cast<BatchTracker>();
const EllipseEdgeEffect& ellipseEffect = gp.cast<EllipseEdgeEffect>();
@ -353,13 +353,13 @@ public:
};
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, bt, caps, b);
}
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override {
const GrGLSLCaps&) const override {
return SkNEW_ARGS(GLProcessor, (*this, bt));
}
@ -536,7 +536,7 @@ public:
static void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const BatchTracker& local = bt.cast<BatchTracker>();
const DIEllipseEdgeEffect& ellipseEffect = gp.cast<DIEllipseEdgeEffect>();
@ -568,13 +568,13 @@ public:
};
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, bt, caps, b);
}
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override {
const GrGLSLCaps&) const override {
return SkNEW_ARGS(GLProcessor, (*this, bt));
}

View File

@ -63,13 +63,13 @@ bool GrPathProcessor::canMakeEqual(const GrBatchTracker& m,
}
void GrPathProcessor::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLPathProcessor::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor* GrPathProcessor::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps& caps) const {
const GrGLSLCaps& caps) const {
SkASSERT(caps.pathRenderingSupport());
return SkNEW_ARGS(GrGLPathProcessor, (*this, bt));
}

View File

@ -45,11 +45,11 @@ public:
bool willUseGeoShader() const override { return false; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps& caps) const override;
const GrGLSLCaps& caps) const override;
protected:
GrPathProcessor(GrColor color, const SkMatrix& viewMatrix, const SkMatrix& localMatrix);

View File

@ -68,6 +68,7 @@ private:
class GrIndexBufferAllocPool;
class GrGLCaps;
typedef GrGLCaps GrGLSLCaps;
class GrGLPrimitiveProcessor;
class GrVertexBufferAllocPool;
@ -163,7 +164,7 @@ public:
* processor's GL backend implementation.
*/
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const = 0;
@ -171,7 +172,7 @@ public:
for the given GrProcessor; caller is responsible for deleting
the object. */
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps& caps) const = 0;
const GrGLSLCaps& caps) const = 0;
bool isPathRendering() const { return fIsPathRendering; }

View File

@ -22,7 +22,7 @@ GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willR
}
}
void GrXferProcessor::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
uint32_t key = this->willReadDstColor() ? 0x1 : 0x0;
if (this->getDstCopyTexture() &&
kTopLeft_GrSurfaceOrigin == this->getDstCopyTexture()->origin()) {

View File

@ -28,7 +28,7 @@ public:
static inline void GenKey(const GrGeometryProcessor&,
const GrBatchTracker&,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager& pdman,
@ -162,7 +162,7 @@ void GrGLConicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
void GrGLConicEffect::GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrConicEffect& ce = gp.cast<GrConicEffect>();
const ConicBatchTracker& local = bt.cast<ConicBatchTracker>();
@ -179,13 +179,13 @@ void GrGLConicEffect::GenKey(const GrGeometryProcessor& gp,
GrConicEffect::~GrConicEffect() {}
void GrConicEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLConicEffect::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GrGLConicEffect, (*this, bt));
}
@ -263,7 +263,7 @@ public:
static inline void GenKey(const GrGeometryProcessor&,
const GrBatchTracker&,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager& pdman,
@ -383,7 +383,7 @@ void GrGLQuadEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
void GrGLQuadEffect::GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrQuadEffect& ce = gp.cast<GrQuadEffect>();
const QuadBatchTracker& local = bt.cast<QuadBatchTracker>();
@ -400,13 +400,13 @@ void GrGLQuadEffect::GenKey(const GrGeometryProcessor& gp,
GrQuadEffect::~GrQuadEffect() {}
void GrQuadEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLQuadEffect::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GrGLQuadEffect, (*this, bt));
}
@ -484,7 +484,7 @@ public:
static inline void GenKey(const GrGeometryProcessor&,
const GrBatchTracker&,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager& pdman,
@ -628,7 +628,7 @@ void GrGLCubicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
void GrGLCubicEffect::GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrCubicEffect& ce = gp.cast<GrCubicEffect>();
const CubicBatchTracker& local = bt.cast<CubicBatchTracker>();
@ -644,13 +644,13 @@ void GrGLCubicEffect::GenKey(const GrGeometryProcessor& gp,
GrCubicEffect::~GrCubicEffect() {}
void GrCubicEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLCubicEffect::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor* GrCubicEffect::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GrGLCubicEffect, (*this, bt));
}

View File

@ -99,11 +99,11 @@ public:
inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const override;
bool onCanMakeEqual(const GrBatchTracker&,
@ -184,11 +184,11 @@ public:
inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const override;
bool onCanMakeEqual(const GrBatchTracker&,
@ -265,11 +265,11 @@ public:
inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const override;
bool onCanMakeEqual(const GrBatchTracker&,

View File

@ -32,7 +32,7 @@ public:
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static inline void GenKey(const GrProcessor& effect, const GrGLCaps&,
static inline void GenKey(const GrProcessor& effect, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrTextureDomain& domain = effect.cast<GrBicubicEffect>().domain();
b->add32(GrTextureDomain::GLDomain::DomainKey(domain));
@ -158,7 +158,7 @@ GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
GrBicubicEffect::~GrBicubicEffect() {
}
void GrBicubicEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrBicubicEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLBicubicEffect::GenKey(*this, caps, b);
}

View File

@ -27,7 +27,7 @@ public:
const char* name() const override { return "Bicubic"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -92,7 +92,7 @@ public:
static inline void GenKey(const GrGeometryProcessor& proc,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const BitmapTextBatchTracker& local = bt.cast<BitmapTextBatchTracker>();
// We have to put the optional vertex attribute as part of the key. See the comment
@ -164,14 +164,14 @@ void GrBitmapTextGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOutput* ou
}
void GrBitmapTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLBitmapTextGeoProc::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor*
GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps& caps) const {
const GrGLSLCaps& caps) const {
return SkNEW_ARGS(GrGLBitmapTextGeoProc, (*this, bt));
}

View File

@ -38,11 +38,11 @@ public:
GrMaskFormat maskFormat() const { return fMaskFormat; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps& caps) const override;
const GrGLSLCaps& caps) const override;
void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const override;
bool onCanMakeEqual(const GrBatchTracker&,

View File

@ -82,7 +82,7 @@ public:
fsBuilder->codeAppend(modulate.c_str());
}
static inline void GenKey(const GrProcessor& processor, const GrGLCaps&,
static inline void GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrConfigConversionEffect& conv = processor.cast<GrConfigConversionEffect>();
uint32_t key = (conv.swapsRedAndBlue() ? 0 : 1) | (conv.pmConversion() << 1);
@ -147,7 +147,7 @@ GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random,
///////////////////////////////////////////////////////////////////////////////
void GrConfigConversionEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrConfigConversionEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLConfigConversionEffect::GenKey(*this, caps, b);
}

View File

@ -39,7 +39,7 @@ public:
const char* name() const override { return "Config Conversion"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -88,7 +88,7 @@ void GrConstColorProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) c
}
}
void GrConstColorProcessor::getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder* b) const {
void GrConstColorProcessor::getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder* b) const {
b->add32(fMode);
}

View File

@ -25,7 +25,7 @@ public:
const char* name() const override { return "AARect"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -92,7 +92,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -160,13 +160,13 @@ void GLAARectEffect::setData(const GrGLProgramDataManager& pdman, const GrProces
}
}
void GLAARectEffect::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GLAARectEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const AARectEffect& aare = processor.cast<AARectEffect>();
b->add32(aare.getEdgeType());
}
void AARectEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void AARectEffect::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLAARectEffect::GenKey(*this, caps, b);
}
@ -187,7 +187,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -252,7 +252,7 @@ void GrGLConvexPolyEffect::setData(const GrGLProgramDataManager& pdman, const Gr
}
}
void GrGLConvexPolyEffect::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GrGLConvexPolyEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrConvexPolyEffect& cpe = processor.cast<GrConvexPolyEffect>();
GR_STATIC_ASSERT(kGrProcessorEdgeTypeCnt <= 8);
@ -326,7 +326,7 @@ void GrConvexPolyEffect::onComputeInvariantOutput(GrInvariantOutput* inout) cons
inout->mulByUnknownSingleComponent();
}
void GrConvexPolyEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrConvexPolyEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLConvexPolyEffect::GenKey(*this, caps, b);
}

View File

@ -69,7 +69,7 @@ public:
const SkScalar* getEdges() const { return fEdges; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -27,7 +27,7 @@ public:
void setData(const GrGLProgramDataManager& pdman, const GrProcessor&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
private:
int width() const { return Gr1DKernelEffect::WidthFromRadius(fRadius); }
@ -134,7 +134,7 @@ void GrGLConvolutionEffect::setData(const GrGLProgramDataManager& pdman,
pdman.set1fv(fKernelUni, this->width(), conv.kernel());
}
void GrGLConvolutionEffect::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GrGLConvolutionEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrConvolutionEffect& conv = processor.cast<GrConvolutionEffect>();
uint32_t key = conv.radius();
@ -196,7 +196,7 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
GrConvolutionEffect::~GrConvolutionEffect() {
}
void GrConvolutionEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrConvolutionEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLConvolutionEffect::GenKey(*this, caps, b);
}

View File

@ -59,7 +59,7 @@ public:
const char* name() const override { return "Convolution"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -40,7 +40,7 @@ public:
private:
CoverageSetOpXP(SkRegion::Op regionOp, bool fInvertCoverage);
void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override;
@ -64,7 +64,7 @@ public:
~GLCoverageSetOpXP() override {}
static void GenKey(const GrProcessor& processor, const GrGLCaps& caps,
static void GenKey(const GrProcessor& processor, const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) {
const CoverageSetOpXP& xp = processor.cast<CoverageSetOpXP>();
uint32_t key = xp.invertCoverage() ? 0x0 : 0x1;
@ -99,7 +99,7 @@ CoverageSetOpXP::CoverageSetOpXP(SkRegion::Op regionOp, bool invertCoverage)
CoverageSetOpXP::~CoverageSetOpXP() {
}
void CoverageSetOpXP::onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void CoverageSetOpXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLCoverageSetOpXP::GenKey(*this, caps, b);
}

View File

@ -427,7 +427,7 @@ public:
void setData(const GrGLProgramDataManager&, const GrProcessor&) override {}
static void GenKey(const GrFragmentProcessor& proc, const GrGLCaps&, GrProcessorKeyBuilder* b) {
static void GenKey(const GrFragmentProcessor& proc, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
// The background may come from the dst or from a texture.
uint32_t key = proc.numTextures();
SkASSERT(key <= 1);
@ -453,7 +453,7 @@ GrCustomXferFP::GrCustomXferFP(SkXfermode::Mode mode, GrTexture* background)
this->addTextureAccess(&fBackgroundAccess);
}
void GrCustomXferFP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void GrCustomXferFP::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLCustomXferFP::GenKey(*this, caps, b);
}
@ -514,7 +514,7 @@ public:
private:
CustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy, bool willReadDstColor);
void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
bool onIsEqual(const GrXferProcessor& xpBase) const override;
@ -540,7 +540,7 @@ public:
GLCustomXP(const GrXferProcessor&) {}
~GLCustomXP() override {}
static void GenKey(const GrXferProcessor& proc, const GrGLCaps&, GrProcessorKeyBuilder* b) {
static void GenKey(const GrXferProcessor& proc, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
uint32_t key = proc.numTextures();
SkASSERT(key <= 1);
key |= proc.cast<CustomXP>().mode() << 1;
@ -573,7 +573,7 @@ CustomXP::CustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy,
this->initClassID<CustomXP>();
}
void CustomXP::onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void CustomXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLCustomXP::GenKey(*this, caps, b);
}

View File

@ -29,7 +29,7 @@ class GrCustomXferFP : public GrFragmentProcessor {
public:
GrCustomXferFP(SkXfermode::Mode mode, GrTexture* background);
void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -797,11 +797,11 @@ public:
DashAAMode aaMode() const { return fAAMode; }
virtual void getGLProcessorKey(const GrBatchTracker&,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker&,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
@ -836,7 +836,7 @@ public:
static inline void GenKey(const GrGeometryProcessor&,
const GrBatchTracker&,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager&,
@ -925,7 +925,7 @@ void GLDashingCircleEffect::setData(const GrGLProgramDataManager& pdman,
void GLDashingCircleEffect::GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const DashingCircleBatchTracker& local = bt.cast<DashingCircleBatchTracker>();
const DashingCircleEffect& dce = gp.cast<DashingCircleEffect>();
@ -951,13 +951,13 @@ void DashingCircleEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* ou
}
void DashingCircleEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLDashingCircleEffect::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor* DashingCircleEffect::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GLDashingCircleEffect, (*this, bt));
}
@ -1045,11 +1045,11 @@ public:
DashAAMode aaMode() const { return fAAMode; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
@ -1084,7 +1084,7 @@ public:
static inline void GenKey(const GrGeometryProcessor&,
const GrBatchTracker&,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder*);
virtual void setData(const GrGLProgramDataManager&,
@ -1185,7 +1185,7 @@ void GLDashingLineEffect::setData(const GrGLProgramDataManager& pdman,
void GLDashingLineEffect::GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const DashingLineBatchTracker& local = bt.cast<DashingLineBatchTracker>();
const DashingLineEffect& de = gp.cast<DashingLineEffect>();
@ -1211,13 +1211,13 @@ void DashingLineEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out)
}
void DashingLineEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLDashingLineEffect::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor* DashingLineEffect::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GLDashingLineEffect, (*this, bt));
}

View File

@ -40,7 +40,7 @@ public:
private:
DisableColorXP();
void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override;
@ -59,7 +59,7 @@ public:
~GLDisableColorXP() override {}
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*) {}
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
private:
void onEmitCode(const EmitArgs& args) override {
@ -81,7 +81,7 @@ DisableColorXP::DisableColorXP() {
this->initClassID<DisableColorXP>();
}
void DisableColorXP::onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
void DisableColorXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
GLDisableColorXP::GenKey(*this, caps, b);
}

View File

@ -165,7 +165,7 @@ public:
static inline void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrDistanceFieldA8TextGeoProc& dfTexEffect = gp.cast<GrDistanceFieldA8TextGeoProc>();
const DistanceFieldBatchTracker& local = bt.cast<DistanceFieldBatchTracker>();
@ -230,14 +230,14 @@ void GrDistanceFieldA8TextGeoProc::onGetInvariantOutputCoverage(GrInitInvariantO
}
void GrDistanceFieldA8TextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLDistanceFieldA8TextGeoProc::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor*
GrDistanceFieldA8TextGeoProc::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GrGLDistanceFieldA8TextGeoProc, (*this, bt));
}
@ -420,7 +420,7 @@ public:
static inline void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrDistanceFieldPathGeoProc& dfTexEffect = gp.cast<GrDistanceFieldPathGeoProc>();
@ -476,13 +476,13 @@ void GrDistanceFieldPathGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOut
}
void GrDistanceFieldPathGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLDistanceFieldPathGeoProc::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor*
GrDistanceFieldPathGeoProc::createGLInstance(const GrBatchTracker& bt, const GrGLCaps&) const {
GrDistanceFieldPathGeoProc::createGLInstance(const GrBatchTracker& bt, const GrGLSLCaps&) const {
return SkNEW_ARGS(GrGLDistanceFieldPathGeoProc, (*this, bt));
}
@ -711,7 +711,7 @@ public:
static inline void GenKey(const GrGeometryProcessor& gp,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrDistanceFieldLCDTextGeoProc& dfTexEffect = gp.cast<GrDistanceFieldLCDTextGeoProc>();
@ -763,14 +763,14 @@ void GrDistanceFieldLCDTextGeoProc::onGetInvariantOutputCoverage(GrInitInvariant
}
void GrDistanceFieldLCDTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLDistanceFieldLCDTextGeoProc::GenKey(*this, bt, caps, b);
}
GrGLPrimitiveProcessor*
GrDistanceFieldLCDTextGeoProc::createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const {
const GrGLSLCaps&) const {
return SkNEW_ARGS(GrGLDistanceFieldLCDTextGeoProc, (*this, bt));
}

View File

@ -75,11 +75,11 @@ public:
uint32_t getFlags() const { return fFlags; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
@ -139,11 +139,11 @@ public:
uint32_t getFlags() const { return fFlags; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
@ -211,11 +211,11 @@ public:
uint32_t getFlags() const { return fFlags; }
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLCaps& caps,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
const GrGLCaps&) const override;
const GrGLSLCaps&) const override;
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;

View File

@ -26,7 +26,7 @@ public:
const char* name() const override { return "Dither"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -106,7 +106,7 @@ void GLDitherEffect::emitCode(GrGLFPBuilder* builder,
//////////////////////////////////////////////////////////////////////////////
void DitherEffect::getGLProcessorKey(const GrGLCaps& caps,
void DitherEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLDitherEffect::GenKey(*this, caps, b);
}

View File

@ -20,7 +20,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -112,7 +112,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLFPBuilder* builder,
}
void GrGLMatrixConvolutionEffect::GenKey(const GrProcessor& processor,
const GrGLCaps&, GrProcessorKeyBuilder* b) {
const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
const GrMatrixConvolutionEffect& m = processor.cast<GrMatrixConvolutionEffect>();
SkASSERT(m.kernelSize().width() <= 0x7FFF && m.kernelSize().height() <= 0xFFFF);
uint32_t key = m.kernelSize().width() << 16 | m.kernelSize().height();
@ -165,7 +165,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() {
}
void GrMatrixConvolutionEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrMatrixConvolutionEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLMatrixConvolutionEffect::GenKey(*this, caps, b);
}

View File

@ -62,7 +62,7 @@ public:
const char* name() const override { return "MatrixConvolution"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -24,7 +24,7 @@ public:
const char* name() const override { return "Circle"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -104,7 +104,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -156,7 +156,7 @@ void GLCircleEffect::emitCode(GrGLFPBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("d")).c_str());
}
void GLCircleEffect::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GLCircleEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const CircleEffect& ce = processor.cast<CircleEffect>();
b->add32(ce.getEdgeType());
@ -179,7 +179,7 @@ void GLCircleEffect::setData(const GrGLProgramDataManager& pdman, const GrProces
///////////////////////////////////////////////////////////////////////////////////////////////////
void CircleEffect::getGLProcessorKey(const GrGLCaps& caps,
void CircleEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLCircleEffect::GenKey(*this, caps, b);
}
@ -199,7 +199,7 @@ public:
const char* name() const override { return "Ellipse"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -282,7 +282,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -347,7 +347,7 @@ void GLEllipseEffect::emitCode(GrGLFPBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str());
}
void GLEllipseEffect::GenKey(const GrProcessor& effect, const GrGLCaps&,
void GLEllipseEffect::GenKey(const GrProcessor& effect, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const EllipseEffect& ee = effect.cast<EllipseEffect>();
b->add32(ee.getEdgeType());
@ -366,7 +366,7 @@ void GLEllipseEffect::setData(const GrGLProgramDataManager& pdman, const GrProce
///////////////////////////////////////////////////////////////////////////////////////////////////
void EllipseEffect::getGLProcessorKey(const GrGLCaps& caps,
void EllipseEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLEllipseEffect::GenKey(*this, caps, b);
}

View File

@ -97,7 +97,7 @@ private:
PorterDuffXferProcessor(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend, GrColor constant,
const GrDeviceCoordTexture* dstCopy, bool willReadDstColor);
void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override {
if (!this->willReadDstColor()) {
@ -190,7 +190,7 @@ public:
virtual ~GLPorterDuffXferProcessor() {}
static void GenKey(const GrProcessor& processor, const GrGLCaps& caps,
static void GenKey(const GrProcessor& processor, const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) {
const PorterDuffXferProcessor& xp = processor.cast<PorterDuffXferProcessor>();
b->add32(xp.primaryOutputType());
@ -291,7 +291,7 @@ PorterDuffXferProcessor::PorterDuffXferProcessor(GrBlendCoeff srcBlend,
PorterDuffXferProcessor::~PorterDuffXferProcessor() {
}
void PorterDuffXferProcessor::onGetGLProcessorKey(const GrGLCaps& caps,
void PorterDuffXferProcessor::onGetGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLPorterDuffXferProcessor::GenKey(*this, caps, b);
}

View File

@ -50,7 +50,7 @@ public:
const char* name() const override { return "CircularRRect"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -139,7 +139,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -287,7 +287,7 @@ void GLCircularRRectEffect::emitCode(GrGLFPBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str());
}
void GLCircularRRectEffect::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GLCircularRRectEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const CircularRRectEffect& crre = processor.cast<CircularRRectEffect>();
GR_STATIC_ASSERT(kGrProcessorEdgeTypeCnt <= 8);
@ -375,7 +375,7 @@ void GLCircularRRectEffect::setData(const GrGLProgramDataManager& pdman,
////////////////////////////////////////////////////////////////////////////////////////////////////
void CircularRRectEffect::getGLProcessorKey(const GrGLCaps& caps,
void CircularRRectEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLCircularRRectEffect::GenKey(*this, caps, b);
}
@ -394,7 +394,7 @@ public:
const char* name() const override { return "EllipticalRRect"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;
@ -496,7 +496,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
@ -587,7 +587,7 @@ void GLEllipticalRRectEffect::emitCode(GrGLFPBuilder* builder,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str());
}
void GLEllipticalRRectEffect::GenKey(const GrProcessor& effect, const GrGLCaps&,
void GLEllipticalRRectEffect::GenKey(const GrProcessor& effect, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>();
GR_STATIC_ASSERT(kLast_GrProcessorEdgeType < (1 << 3));
@ -633,7 +633,7 @@ void GLEllipticalRRectEffect::setData(const GrGLProgramDataManager& pdman,
////////////////////////////////////////////////////////////////////////////////////////////////////
void EllipticalRRectEffect::getGLProcessorKey(const GrGLCaps& caps,
void EllipticalRRectEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GLEllipticalRRectEffect::GenKey(*this, caps, b);
}

View File

@ -43,7 +43,7 @@ void GrSimpleTextureEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c
this->updateInvariantOutputForModulation(inout);
}
void GrSimpleTextureEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrSimpleTextureEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLSimpleTextureEffect::GenKey(*this, caps, b);
}

View File

@ -49,7 +49,7 @@ public:
const char* name() const override { return "SimpleTexture"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -178,7 +178,7 @@ public:
void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*);
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
private:
GrTextureDomain::GLDomain fGLDomain;
@ -209,7 +209,7 @@ void GrGLTextureDomainEffect::setData(const GrGLProgramDataManager& pdman,
fGLDomain.setData(pdman, domain, processor.texture(0)->origin());
}
void GrGLTextureDomainEffect::GenKey(const GrProcessor& processor, const GrGLCaps&,
void GrGLTextureDomainEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const GrTextureDomain& domain = processor.cast<GrTextureDomainEffect>().textureDomain();
b->add32(GrTextureDomain::GLDomain::DomainKey(domain));
@ -256,7 +256,7 @@ GrTextureDomainEffect::~GrTextureDomainEffect() {
}
void GrTextureDomainEffect::getGLProcessorKey(const GrGLCaps& caps,
void GrTextureDomainEffect::getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
GrGLTextureDomainEffect::GenKey(*this, caps, b);
}

View File

@ -168,7 +168,7 @@ public:
const char* name() const override { return "TextureDomain"; }
void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const override;
void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
GrGLFragmentProcessor* createGLInstance() const override;

View File

@ -56,7 +56,7 @@ public:
static const GrGLfloat kRec601ConversionMatrix[16];
// this class always generates the same code.
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*) {}
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
GLProcessor(const GrProcessor&) {}
@ -100,7 +100,7 @@ public:
typedef GrGLFragmentProcessor INHERITED;
};
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLProcessor::GenKey(*this, caps, b);
}

View File

@ -395,4 +395,6 @@ private:
typedef GrDrawTargetCaps INHERITED;
};
typedef GrGLCaps GrGLSLCaps;
#endif

View File

@ -41,7 +41,7 @@ void GrGLPathProcessor::emitCode(EmitArgs& args) {
void GrGLPathProcessor::GenKey(const GrPathProcessor&,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
const PathBatchTracker& local = bt.cast<PathBatchTracker>();
b->add32(local.fInputColorType | local.fInputCoverageType << 16);

View File

@ -20,7 +20,7 @@ public:
static void GenKey(const GrPathProcessor&,
const GrBatchTracker& bt,
const GrGLCaps&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b);
void emitCode(EmitArgs&) override;

View File

@ -17,7 +17,7 @@
include/gpu/GrProcessor.h. Objects of type GrGLProcessor are responsible for emitting the
GLSL code that implements a GrProcessor and for uploading uniforms at draw time. If they don't
always emit the same GLSL code, they must have a function:
static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*)
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*)
that is used to implement a program cache. When two GrProcessors produce the same key this means
that their GrGLProcessors would emit the same GLSL code.
@ -111,7 +111,7 @@ public:
// TODO update this to pass in GrFragmentProcessor
virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {}
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder*) {}
static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
private:
typedef GrGLProcessor INHERITED;

View File

@ -106,6 +106,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
GrProcessorKeyBuilder b(&glDesc->key());
primProc.getGLProcessorKey(batchTracker, gpu->glCaps(), &b);
//**** use glslCaps here?
if (!get_meta_key(primProc, gpu->glCaps(), 0, &b)) {
glDesc->key().reset();
return false;
@ -115,6 +116,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
const GrPendingFragmentStage& fps = pipeline.getFragmentStage(s);
const GrFragmentProcessor& fp = *fps.processor();
fp.getGLProcessorKey(gpu->glCaps(), &b);
//**** use glslCaps here?
if (!get_meta_key(fp, gpu->glCaps(), primProc.getTransformKey(fp.coordTransforms()), &b)) {
glDesc->key().reset();
return false;
@ -123,6 +125,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
const GrXferProcessor& xp = *pipeline.getXferProcessor();
xp.getGLProcessorKey(gpu->glCaps(), &b);
//**** use glslCaps here?
if (!get_meta_key(xp, gpu->glCaps(), 0, &b)) {
glDesc->key().reset();
return false;

View File

@ -44,7 +44,7 @@ public:
const TransformedCoordsArray&,
const TextureSamplerArray&) {}
static void GenKey(const GrProcessor& processor, const GrGLCaps&, GrProcessorKeyBuilder* b) {
static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
for (uint32_t i = 0; i < kMaxKeySize; i++) {
b->add32(i);
}
@ -63,7 +63,7 @@ public:
const char* name() const override { return "Big Ole Key"; }
virtual void getGLProcessorKey(const GrGLCaps& caps,
virtual void getGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GLBigKeyProcessor::GenKey(*this, caps, b);
}