зеркало из https://github.com/mozilla/moz-skia.git
Allow gradient optimization with perspective
Before, gradients would only interpolate the linear portion of the quadratic equation if there was no perspective. This updates them to do so even in the case that there is perspective. The rearrangement of math causes noise differences in the following gm tests: gradients_no_texture_gpu gradients_view_perspective_gpu gradients_local_perspective_gpu gradients_gpu R=bsalomon@google.com Author: cdalton@nvidia.com Review URL: https://codereview.chromium.org/25645006 git-svn-id: http://skia.googlecode.com/svn/trunk@11595 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
57a3b763ca
Коммит
5fd7d5c20a
|
@ -21,3 +21,8 @@
|
|||
## Added by edisonn as part of https://codereview.chromium.org/23851037/
|
||||
#gradients
|
||||
|
||||
# Added by cdalton as part of https://codereview.chromium.org/25645006/
|
||||
gradients_no_texture
|
||||
gradients_view_perspective
|
||||
gradients_local_perspective
|
||||
gradients
|
||||
|
|
|
@ -41,12 +41,13 @@ enum GrCoordSet {
|
|||
*/
|
||||
class GrCoordTransform : public SkNoncopyable {
|
||||
public:
|
||||
GrCoordTransform() {}
|
||||
GrCoordTransform() { SkDEBUGCODE(fInEffect = false); }
|
||||
|
||||
/**
|
||||
* Create a transformation that maps [0, 1] to a texture's boundaries.
|
||||
*/
|
||||
GrCoordTransform(GrCoordSet sourceCoords, const GrTexture* texture) {
|
||||
SkDEBUGCODE(fInEffect = false);
|
||||
this->reset(sourceCoords, texture);
|
||||
}
|
||||
|
||||
|
@ -56,20 +57,40 @@ public:
|
|||
* coord convention.
|
||||
*/
|
||||
GrCoordTransform(GrCoordSet sourceCoords, const SkMatrix& m, const GrTexture* texture = NULL) {
|
||||
SkDEBUGCODE(fInEffect = false);
|
||||
this->reset(sourceCoords, m, texture);
|
||||
}
|
||||
|
||||
void reset(GrCoordSet sourceCoords, const GrTexture* texture) {
|
||||
SkASSERT(!fInEffect);
|
||||
SkASSERT(NULL != texture);
|
||||
this->reset(sourceCoords, GrEffect::MakeDivByTextureWHMatrix(texture), texture);
|
||||
}
|
||||
|
||||
void reset(GrCoordSet sourceCoords, const SkMatrix& m, const GrTexture* texture = NULL) {
|
||||
SkASSERT(!fInEffect);
|
||||
fSourceCoords = sourceCoords;
|
||||
fMatrix = m;
|
||||
fReverseY = NULL != texture && kBottomLeft_GrSurfaceOrigin == texture->origin();
|
||||
}
|
||||
|
||||
GrCoordTransform& operator= (const GrCoordTransform& other) {
|
||||
SkASSERT(!fInEffect);
|
||||
fSourceCoords = other.fSourceCoords;
|
||||
fMatrix = other.fMatrix;
|
||||
fReverseY = other.fReverseY;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the matrix for editing. Note, this must be done before adding the transform to an
|
||||
* effect, since effects are immutable.
|
||||
*/
|
||||
SkMatrix* accessMatrix() {
|
||||
SkASSERT(!fInEffect);
|
||||
return &fMatrix;
|
||||
}
|
||||
|
||||
bool operator== (const GrCoordTransform& other) const {
|
||||
return fSourceCoords == other.fSourceCoords &&
|
||||
fMatrix.cheapEqualTo(other.fMatrix) &&
|
||||
|
@ -86,6 +107,13 @@ private:
|
|||
bool fReverseY;
|
||||
|
||||
typedef SkNoncopyable INHERITED;
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
public:
|
||||
void setInEffect() const { fInEffect = true; }
|
||||
private:
|
||||
mutable bool fInEffect;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -288,6 +288,8 @@ protected:
|
|||
|
||||
virtual bool onIsEqual(const GrEffect& effect) const SK_OVERRIDE;
|
||||
|
||||
const GrCoordTransform& getCoordTransform() const { return fCoordTransform; }
|
||||
|
||||
private:
|
||||
static const GrCoordSet kCoordSet = kLocal_GrCoordSet;
|
||||
|
||||
|
|
|
@ -355,8 +355,7 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
UniformHandle fVSParamUni;
|
||||
UniformHandle fFSParamUni;
|
||||
UniformHandle fParamUni;
|
||||
|
||||
const char* fVSVaryingName;
|
||||
const char* fFSVaryingName;
|
||||
|
@ -422,7 +421,20 @@ private:
|
|||
: INHERITED(ctx, shader, matrix, tm)
|
||||
, fCenterX1(shader.getCenterX1())
|
||||
, fRadius0(shader.getStartRadius())
|
||||
, fDiffRadius(shader.getDiffRadius()) { }
|
||||
, fDiffRadius(shader.getDiffRadius()) {
|
||||
// We pass the linear part of the quadratic as a varying.
|
||||
// float b = -2.0 * (fCenterX1 * x + fRadius0 * fDiffRadius * z)
|
||||
fBTransform = this->getCoordTransform();
|
||||
SkMatrix& bMatrix = *fBTransform.accessMatrix();
|
||||
SkScalar r0dr = SkScalarMul(fRadius0, fDiffRadius);
|
||||
bMatrix[SkMatrix::kMScaleX] = -2 * (SkScalarMul(fCenterX1, bMatrix[SkMatrix::kMScaleX]) +
|
||||
SkScalarMul(r0dr, bMatrix[SkMatrix::kMPersp0]));
|
||||
bMatrix[SkMatrix::kMSkewX] = -2 * (SkScalarMul(fCenterX1, bMatrix[SkMatrix::kMSkewX]) +
|
||||
SkScalarMul(r0dr, bMatrix[SkMatrix::kMPersp1]));
|
||||
bMatrix[SkMatrix::kMTransX] = -2 * (SkScalarMul(fCenterX1, bMatrix[SkMatrix::kMTransX]) +
|
||||
SkScalarMul(r0dr, bMatrix[SkMatrix::kMPersp2]));
|
||||
this->addCoordTransform(&fBTransform);
|
||||
}
|
||||
|
||||
GR_DECLARE_EFFECT_TEST;
|
||||
|
||||
|
@ -430,6 +442,7 @@ private:
|
|||
// Cache of values - these can change arbitrarily, EXCEPT
|
||||
// we shouldn't change between degenerate and non-degenerate?!
|
||||
|
||||
GrCoordTransform fBTransform;
|
||||
SkScalar fCenterX1;
|
||||
SkScalar fRadius0;
|
||||
SkScalar fDiffRadius;
|
||||
|
@ -492,45 +505,9 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
const TransformedCoordsArray& coords,
|
||||
const TextureSamplerArray& samplers) {
|
||||
this->emitUniforms(builder, key);
|
||||
// 2 copies of uniform array, 1 for each of vertex & fragment shader,
|
||||
// to work around Xoom bug. Doesn't seem to cause performance decrease
|
||||
// in test apps, but need to keep an eye on it.
|
||||
fVSParamUni = builder->addUniformArray(GrGLShaderBuilder::kVertex_Visibility,
|
||||
kFloat_GrSLType, "Conical2VSParams", 6);
|
||||
fFSParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility,
|
||||
fParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility,
|
||||
kFloat_GrSLType, "Conical2FSParams", 6);
|
||||
|
||||
// For radial gradients without perspective we can pass the linear
|
||||
// part of the quadratic as a varying.
|
||||
GrGLShaderBuilder::VertexBuilder* vertexBuilder =
|
||||
(kVec2f_GrSLType == coords[0].type()) ? builder->getVertexBuilder() : NULL;
|
||||
if (NULL != vertexBuilder) {
|
||||
vertexBuilder->addVarying(kFloat_GrSLType, "Conical2BCoeff",
|
||||
&fVSVaryingName, &fFSVaryingName);
|
||||
}
|
||||
|
||||
// VS
|
||||
{
|
||||
SkString p2; // distance between centers
|
||||
SkString p3; // start radius
|
||||
SkString p5; // difference in radii (r1 - r0)
|
||||
builder->getUniformVariable(fVSParamUni).appendArrayAccess(2, &p2);
|
||||
builder->getUniformVariable(fVSParamUni).appendArrayAccess(3, &p3);
|
||||
builder->getUniformVariable(fVSParamUni).appendArrayAccess(5, &p5);
|
||||
|
||||
// For radial gradients without perspective we can pass the linear
|
||||
// part of the quadratic as a varying.
|
||||
if (NULL != vertexBuilder) {
|
||||
// r2Var = -2 * (r2Parm[2] * varCoord.x - r2Param[3] * r2Param[5])
|
||||
vertexBuilder->vsCodeAppendf("\t%s = -2.0 * (%s * %s.x + %s * %s);\n",
|
||||
fVSVaryingName, p2.c_str(),
|
||||
coords[0].getVSName().c_str(), p3.c_str(), p5.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// FS
|
||||
{
|
||||
SkString coords2D = builder->ensureFSCoords2D(coords, 0);
|
||||
SkString cName("c");
|
||||
SkString ac4Name("ac4");
|
||||
SkString dName("d");
|
||||
|
@ -545,23 +522,25 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
SkString p4; // start radius squared
|
||||
SkString p5; // difference in radii (r1 - r0)
|
||||
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(0, &p0);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(1, &p1);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(2, &p2);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(3, &p3);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(4, &p4);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(5, &p5);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(0, &p0);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(2, &p2);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(3, &p3);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5);
|
||||
|
||||
// If we we're able to interpolate the linear component,
|
||||
// bVar is the varying; otherwise compute it
|
||||
// We interpolate the linear component in coords[1].
|
||||
SkASSERT(coords[0].type() == coords[1].type());
|
||||
const char* coords2D;
|
||||
SkString bVar;
|
||||
if (NULL != vertexBuilder) {
|
||||
bVar = fFSVaryingName;
|
||||
if (kVec3f_GrSLType == coords[0].type()) {
|
||||
builder->fsCodeAppendf("\tvec3 interpolants = vec3(%s.xy, %s.x) / %s.z;\n",
|
||||
coords[0].c_str(), coords[1].c_str(), coords[0].c_str());
|
||||
coords2D = "interpolants.xy";
|
||||
bVar = "interpolants.z";
|
||||
} else {
|
||||
bVar = "b";
|
||||
builder->fsCodeAppendf("\tfloat %s = -2.0 * (%s * %s.x + %s * %s);\n",
|
||||
bVar.c_str(), p2.c_str(), coords2D.c_str(),
|
||||
p3.c_str(), p5.c_str());
|
||||
coords2D = coords[0].c_str();
|
||||
bVar.printf("%s.x", coords[1].c_str());
|
||||
}
|
||||
|
||||
// output will default to transparent black (we simply won't write anything
|
||||
|
@ -569,9 +548,8 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
builder->fsCodeAppendf("\t%s = vec4(0.0,0.0,0.0,0.0);\n", outputColor);
|
||||
|
||||
// c = (x^2)+(y^2) - params[4]
|
||||
builder->fsCodeAppendf("\tfloat %s = dot(%s, %s) - %s;\n", cName.c_str(),
|
||||
coords2D.c_str(), coords2D.c_str(),
|
||||
p4.c_str());
|
||||
builder->fsCodeAppendf("\tfloat %s = dot(%s, %s) - %s;\n",
|
||||
cName.c_str(), coords2D, coords2D, p4.c_str());
|
||||
|
||||
// Non-degenerate case (quadratic)
|
||||
if (!fIsDegenerate) {
|
||||
|
@ -646,7 +624,6 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
this->emitColor(builder, tName.c_str(), key, outputColor, inputColor, samplers);
|
||||
builder->fsCodeAppend("\t}\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GrGLConical2Gradient::setData(const GrGLUniformManager& uman,
|
||||
|
@ -678,8 +655,7 @@ void GrGLConical2Gradient::setData(const GrGLUniformManager& uman,
|
|||
SkScalarToFloat(diffRadius)
|
||||
};
|
||||
|
||||
uman.set1fv(fVSParamUni, 0, 6, values);
|
||||
uman.set1fv(fFSParamUni, 0, 6, values);
|
||||
uman.set1fv(fParamUni, 0, 6, values);
|
||||
fCachedCenter = centerX1;
|
||||
fCachedRadius = radius0;
|
||||
fCachedDiffRadius = diffRadius;
|
||||
|
|
|
@ -397,8 +397,7 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
UniformHandle fVSParamUni;
|
||||
UniformHandle fFSParamUni;
|
||||
UniformHandle fParamUni;
|
||||
|
||||
const char* fVSVaryingName;
|
||||
const char* fFSVaryingName;
|
||||
|
@ -463,7 +462,19 @@ private:
|
|||
: INHERITED(ctx, shader, matrix, tm)
|
||||
, fCenterX1(shader.getCenterX1())
|
||||
, fRadius0(shader.getStartRadius())
|
||||
, fPosRoot(shader.getDiffRadius() < 0) { }
|
||||
, fPosRoot(shader.getDiffRadius() < 0) {
|
||||
// We pass the linear part of the quadratic as a varying.
|
||||
// float b = 2.0 * (fCenterX1 * x - fRadius0 * z)
|
||||
fBTransform = this->getCoordTransform();
|
||||
SkMatrix& bMatrix = *fBTransform.accessMatrix();
|
||||
bMatrix[SkMatrix::kMScaleX] = 2 * (SkScalarMul(fCenterX1, bMatrix[SkMatrix::kMScaleX]) -
|
||||
SkScalarMul(fRadius0, bMatrix[SkMatrix::kMPersp0]));
|
||||
bMatrix[SkMatrix::kMSkewX] = 2 * (SkScalarMul(fCenterX1, bMatrix[SkMatrix::kMSkewX]) -
|
||||
SkScalarMul(fRadius0, bMatrix[SkMatrix::kMPersp1]));
|
||||
bMatrix[SkMatrix::kMTransX] = 2 * (SkScalarMul(fCenterX1, bMatrix[SkMatrix::kMTransX]) -
|
||||
SkScalarMul(fRadius0, bMatrix[SkMatrix::kMPersp2]));
|
||||
this->addCoordTransform(&fBTransform);
|
||||
}
|
||||
|
||||
GR_DECLARE_EFFECT_TEST;
|
||||
|
||||
|
@ -471,6 +482,7 @@ private:
|
|||
// Cache of values - these can change arbitrarily, EXCEPT
|
||||
// we shouldn't change between degenerate and non-degenerate?!
|
||||
|
||||
GrCoordTransform fBTransform;
|
||||
SkScalar fCenterX1;
|
||||
SkScalar fRadius0;
|
||||
SkBool8 fPosRoot;
|
||||
|
@ -535,43 +547,9 @@ void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
const TextureSamplerArray& samplers) {
|
||||
|
||||
this->emitUniforms(builder, key);
|
||||
// 2 copies of uniform array, 1 for each of vertex & fragment shader,
|
||||
// to work around Xoom bug. Doesn't seem to cause performance decrease
|
||||
// in test apps, but need to keep an eye on it.
|
||||
fVSParamUni = builder->addUniformArray(GrGLShaderBuilder::kVertex_Visibility,
|
||||
kFloat_GrSLType, "Radial2VSParams", 6);
|
||||
fFSParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility,
|
||||
fParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility,
|
||||
kFloat_GrSLType, "Radial2FSParams", 6);
|
||||
|
||||
// For radial gradients without perspective we can pass the linear
|
||||
// part of the quadratic as a varying.
|
||||
GrGLShaderBuilder::VertexBuilder* vertexBuilder =
|
||||
(kVec2f_GrSLType == coords[0].type()) ? builder->getVertexBuilder() : NULL;
|
||||
if (NULL != vertexBuilder) {
|
||||
vertexBuilder->addVarying(kFloat_GrSLType, "Radial2BCoeff",
|
||||
&fVSVaryingName, &fFSVaryingName);
|
||||
}
|
||||
|
||||
// VS
|
||||
{
|
||||
SkString p2;
|
||||
SkString p3;
|
||||
builder->getUniformVariable(fVSParamUni).appendArrayAccess(2, &p2);
|
||||
builder->getUniformVariable(fVSParamUni).appendArrayAccess(3, &p3);
|
||||
|
||||
// For radial gradients without perspective we can pass the linear
|
||||
// part of the quadratic as a varying.
|
||||
if (NULL != vertexBuilder) {
|
||||
// r2Var = 2 * (r2Parm[2] * varCoord.x - r2Param[3])
|
||||
vertexBuilder->vsCodeAppendf("\t%s = 2.0 *(%s * %s.x - %s);\n",
|
||||
fVSVaryingName, p2.c_str(),
|
||||
coords[0].getVSName().c_str(), p3.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// FS
|
||||
{
|
||||
SkString coords2D = builder->ensureFSCoords2D(coords, 0);
|
||||
SkString cName("c");
|
||||
SkString ac4Name("ac4");
|
||||
SkString rootName("root");
|
||||
|
@ -582,30 +560,30 @@ void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
SkString p3;
|
||||
SkString p4;
|
||||
SkString p5;
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(0, &p0);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(1, &p1);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(2, &p2);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(3, &p3);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(4, &p4);
|
||||
builder->getUniformVariable(fFSParamUni).appendArrayAccess(5, &p5);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(0, &p0);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(2, &p2);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(3, &p3);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4);
|
||||
builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5);
|
||||
|
||||
// If we we're able to interpolate the linear component,
|
||||
// bVar is the varying; otherwise compute it
|
||||
// We interpolate the linear component in coords[1].
|
||||
SkASSERT(coords[0].type() == coords[1].type());
|
||||
const char* coords2D;
|
||||
SkString bVar;
|
||||
if (NULL != vertexBuilder) {
|
||||
bVar = fFSVaryingName;
|
||||
if (kVec3f_GrSLType == coords[0].type()) {
|
||||
builder->fsCodeAppendf("\tvec3 interpolants = vec3(%s.xy, %s.x) / %s.z;\n",
|
||||
coords[0].c_str(), coords[1].c_str(), coords[0].c_str());
|
||||
coords2D = "interpolants.xy";
|
||||
bVar = "interpolants.z";
|
||||
} else {
|
||||
bVar = "b";
|
||||
builder->fsCodeAppendf("\tfloat %s = 2.0 * (%s * %s.x - %s);\n",
|
||||
bVar.c_str(), p2.c_str(), coords2D.c_str(), p3.c_str());
|
||||
coords2D = coords[0].c_str();
|
||||
bVar.printf("%s.x", coords[1].c_str());
|
||||
}
|
||||
|
||||
// c = (x^2)+(y^2) - params[4]
|
||||
builder->fsCodeAppendf("\tfloat %s = dot(%s, %s) - %s;\n",
|
||||
cName.c_str(),
|
||||
coords2D.c_str(),
|
||||
coords2D.c_str(),
|
||||
p4.c_str());
|
||||
cName.c_str(), coords2D, coords2D, p4.c_str());
|
||||
|
||||
// If we aren't degenerate, emit some extra code, and accept a slightly
|
||||
// more complex coord.
|
||||
|
@ -631,7 +609,6 @@ void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
|
|||
}
|
||||
|
||||
this->emitColor(builder, t.c_str(), key, outputColor, inputColor, samplers);
|
||||
}
|
||||
}
|
||||
|
||||
void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman,
|
||||
|
@ -661,8 +638,7 @@ void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman,
|
|||
data.isPosRoot() ? 1.f : -1.f
|
||||
};
|
||||
|
||||
uman.set1fv(fVSParamUni, 0, 6, values);
|
||||
uman.set1fv(fFSParamUni, 0, 6, values);
|
||||
uman.set1fv(fParamUni, 0, 6, values);
|
||||
fCachedCenter = centerX1;
|
||||
fCachedRadius = radius0;
|
||||
fCachedPosRoot = data.isPosRoot();
|
||||
|
|
|
@ -89,6 +89,7 @@ const char* GrEffect::name() const {
|
|||
|
||||
void GrEffect::addCoordTransform(const GrCoordTransform* transform) {
|
||||
fCoordTransforms.push_back(transform);
|
||||
SkDEBUGCODE(transform->setInEffect();)
|
||||
}
|
||||
|
||||
void GrEffect::addTextureAccess(const GrTextureAccess* access) {
|
||||
|
|
|
@ -391,8 +391,7 @@ void GrGLProgramEffectsBuilder::emitTransforms(const GrEffectRef& effect,
|
|||
default:
|
||||
GrCrash("Unexpected uniform type.");
|
||||
}
|
||||
SkNEW_APPEND_TO_TARRAY(outCoords, TransformedCoords,
|
||||
(fsVaryingName, varyingType, vsVaryingName));
|
||||
SkNEW_APPEND_TO_TARRAY(outCoords, TransformedCoords, (fsVaryingName, varyingType));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,20 +54,17 @@ public:
|
|||
*/
|
||||
class TransformedCoords {
|
||||
public:
|
||||
TransformedCoords(const char* name, GrSLType type, const char* vsName)
|
||||
: fName(name), fType(type), fVSName(vsName) {
|
||||
TransformedCoords(const char* name, GrSLType type)
|
||||
: fName(name), fType(type) {
|
||||
}
|
||||
|
||||
const char* c_str() const { return fName.c_str(); }
|
||||
GrSLType type() const { return fType; }
|
||||
const SkString& getName() const { return fName; }
|
||||
// TODO: Remove the VS name when we have vertexless shaders, and gradients are reworked.
|
||||
const SkString& getVSName() const { return fVSName; }
|
||||
|
||||
private:
|
||||
SkString fName;
|
||||
GrSLType fType;
|
||||
SkString fVSName;
|
||||
};
|
||||
|
||||
typedef SkTArray<TransformedCoords> TransformedCoordsArray;
|
||||
|
|
Загрузка…
Ссылка в новой задаче