Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@8249 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2013-03-20 07:01:02 +00:00
parent 3fbab82bd3
commit 01c34ee599
12 changed files with 27 additions and 31 deletions

View File

@ -179,7 +179,7 @@ public:
fVertexAttribIndices[0] = -1;
fVertexAttribIndices[1] = -1;
return EffectRef;
}
@ -187,13 +187,13 @@ public:
GrAssert(0 == fSavedCoordChangeCnt);
GrSafeAssign(fEffectRef, EffectRef);
fCoordChangeMatrix.reset();
fVertexAttribIndices[0] = attr0;
fVertexAttribIndices[1] = attr1;
return EffectRef;
}
const GrEffectRef* getEffect() const { return fEffectRef; }
const int* getVertexAttribIndices() const { return fVertexAttribIndices; }

View File

@ -124,7 +124,7 @@ static SkScalerContext* allocNextContext(const SkScalerContext::Rec& rec) {
if (0 == newFace) {
return NULL;
}
SkAutoTUnref<SkTypeface> aur(newFace);
uint32_t newFontID = newFace->uniqueID();
@ -784,5 +784,3 @@ SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc) const
}
return c;
}

View File

@ -217,7 +217,7 @@ protected:
private:
// never null
SkAutoTUnref<SkTypeface> fTypeface;
// optional object, which may be null
SkPathEffect* fPathEffect;
SkMaskFilter* fMaskFilter;

View File

@ -1044,7 +1044,7 @@ bool GrContext::canDrawOval(const GrPaint& paint, const GrRect& oval, bool* isCi
return false;
}
// we can draw circles
// we can draw circles
*isCircle = SkScalarNearlyEqual(oval.width(), oval.height())
&& circleStaysCircle(this->getMatrix());
// and axis-aligned ellipses only
@ -1235,7 +1235,7 @@ void GrContext::internalDrawCircle(const GrPaint& paint,
kEdgeEffectStage = GrPaint::kTotalStages,
};
drawState->setAttribBindings(GrDrawState::kDefault_AttribBindings);
GrEffectRef* effect = GrCircleEdgeEffect::Create(isStroked);
static const int kCircleEdgeAttrIndex = 1;
drawState->setEffect(kEdgeEffectStage, effect, kCircleEdgeAttrIndex)->unref();

View File

@ -489,7 +489,7 @@ public:
fStages[stageIdx].setEffect(effect);
return effect;
}
const GrEffectRef* setEffect(int stageIdx, const GrEffectRef* effect,
int attr0, int attr1 = -1) {
fStages[stageIdx].setEffect(effect, attr0, attr1);

View File

@ -28,7 +28,7 @@ public:
const char* inputColor,
const TextureSamplerArray& samplers) SK_OVERRIDE {
const GrCircleEdgeEffect& effect = GetEffectFromStage<GrCircleEdgeEffect>(stage);
const char *vsName, *fsName;
builder->addVarying(kVec4f_GrSLType, "CircleEdge", &vsName, &fsName);

View File

@ -14,7 +14,7 @@ class GrGLCircleEdgeEffect;
/**
* The output of this effect is a modulation of the input color and coverage for a circle,
* specified as center_x, center_y, x_radius, inner radius and outer radius in window space
* specified as center_x, center_y, x_radius, inner radius and outer radius in window space
* (y-down).
*/
@ -26,7 +26,7 @@ public:
CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrCircleEdgeEffect, (true)))));
static SkAutoTUnref<GrEffectRef> gCircleFillEdgeEffectRef(
CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrCircleEdgeEffect, (false)))));
if (stroke) {
gCircleStrokeEdgeEffectRef.get()->ref();
return gCircleStrokeEdgeEffectRef;
@ -45,7 +45,7 @@ public:
typedef GrGLCircleEdgeEffect GLEffect;
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
inline bool isStroked() const { return fStroke; }
private:
@ -54,7 +54,7 @@ private:
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE {
return true;
}
bool fStroke;
GR_DECLARE_EFFECT_TEST;

View File

@ -26,7 +26,7 @@ public:
const char* inputColor,
const TextureSamplerArray& samplers) SK_OVERRIDE {
const GrEllipseEdgeEffect& effect = GetEffectFromStage<GrEllipseEdgeEffect>(stage);
const char *vsCenterName, *fsCenterName;
const char *vsEdgeName, *fsEdgeName;
@ -49,16 +49,16 @@ public:
builder->fsCodeAppend("\tfloat dOuter = length(outerOffset);\n");
// compare outer lengths against xOuterRadius
builder->fsCodeAppendf("\tfloat edgeAlpha = clamp(%s.x-dOuter, 0.0, 1.0);\n", fsEdgeName);
if (effect.isStroked()) {
builder->fsCodeAppendf("\tinnerOffset.y *= %s.w;\n", fsEdgeName);
builder->fsCodeAppend("\tfloat dInner = length(innerOffset);\n");
// compare inner lengths against xInnerRadius
builder->fsCodeAppendf("\tfloat innerAlpha = clamp(dInner-%s.z, 0.0, 1.0);\n", fsEdgeName);
builder->fsCodeAppend("\tedgeAlpha *= innerAlpha;\n");
}
SkString modulate;
GrGLSLModulate4f(&modulate, inputColor, "edgeAlpha");
builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str());
@ -82,7 +82,7 @@ private:
GrEllipseEdgeEffect::GrEllipseEdgeEffect(bool stroke) : GrEffect() {
this->addVertexAttrib(kVec2f_GrSLType);
this->addVertexAttrib(kVec4f_GrSLType);
fStroke = stroke;
}

View File

@ -25,7 +25,7 @@ public:
CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrEllipseEdgeEffect, (true)))));
static SkAutoTUnref<GrEffectRef> gEllipseFillEdgeEffectRef(
CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrEllipseEdgeEffect, (false)))));
if (stroke) {
gEllipseStrokeEdgeEffectRef.get()->ref();
return gEllipseStrokeEdgeEffectRef;
@ -46,7 +46,7 @@ public:
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
inline bool isStroked() const { return fStroke; }
private:
GrEllipseEdgeEffect(bool stroke);

View File

@ -1195,7 +1195,7 @@ void SkPDFDevice::getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
newResourceObjects->add(fGraphicStateResources[i]);
fGraphicStateResources[i]->ref();
if (recursive) {
fGraphicStateResources[i]->getResources(knownResourceObjects,
fGraphicStateResources[i]->getResources(knownResourceObjects,
newResourceObjects);
}
}
@ -1206,7 +1206,7 @@ void SkPDFDevice::getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
newResourceObjects->add(fXObjectResources[i]);
fXObjectResources[i]->ref();
if (recursive) {
fXObjectResources[i]->getResources(knownResourceObjects,
fXObjectResources[i]->getResources(knownResourceObjects,
newResourceObjects);
}
}
@ -1217,7 +1217,7 @@ void SkPDFDevice::getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
newResourceObjects->add(fFontResources[i]);
fFontResources[i]->ref();
if (recursive) {
fFontResources[i]->getResources(knownResourceObjects,
fFontResources[i]->getResources(knownResourceObjects,
newResourceObjects);
}
}
@ -1228,7 +1228,7 @@ void SkPDFDevice::getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
newResourceObjects->add(fShaderResources[i]);
fShaderResources[i]->ref();
if (recursive) {
fShaderResources[i]->getResources(knownResourceObjects,
fShaderResources[i]->getResources(knownResourceObjects,
newResourceObjects);
}
}

View File

@ -424,5 +424,3 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
SkStream* SkFontConfigInterfaceDirect::openStream(const FontIdentity& identity) {
return SkStream::NewFromFile(identity.fString.c_str());
}

View File

@ -32,11 +32,11 @@ protected:
// See http://freetype.sourceforge.net/freetype2/docs/reference/ft2-bitmap_handling.html#FT_Bitmap_Embolden
// This value was chosen by eyeballing the result in Firefox and trying to match it.
static const FT_Pos kBitmapEmboldenStrength = 1 << 6;
SkScalerContext_FreeType_Base(SkTypeface* typeface, const SkDescriptor *desc)
: INHERITED(typeface, desc)
{}
void generateGlyphImage(FT_Face face, const SkGlyph& glyph);
void generateGlyphPath(FT_Face face, SkPath* path);
void emboldenOutline(FT_Face face, FT_Outline* outline);