Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@12232 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
50a7600d05
commit
11a253b686
@ -1749,7 +1749,7 @@ void SkDraw::drawText(const char text[], size_t byteLength,
|
||||
|
||||
// transform our starting point
|
||||
#if SK_DISTANCEFIELD_FONTS
|
||||
if (!(procFlags & SkDrawProcs::kSkipBakedGlyphTransform_Flag))
|
||||
if (!(procFlags & SkDrawProcs::kSkipBakedGlyphTransform_Flag))
|
||||
#endif
|
||||
{
|
||||
SkPoint loc;
|
||||
|
@ -23,7 +23,7 @@ SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
|
||||
"Dump the contents of the font cache before every purge.");
|
||||
|
||||
|
||||
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
|
||||
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
|
||||
const GrPaint& paint,
|
||||
SkColor color,
|
||||
SkScalar textRatio)
|
||||
@ -137,7 +137,7 @@ void GrDistanceFieldTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
|
||||
// not valid, need to find a different solution for this
|
||||
vx += SkIntToFixed(glyph->fBounds.fLeft);
|
||||
vy += SkIntToFixed(glyph->fBounds.fTop);
|
||||
|
||||
|
||||
// keep them as ints until we've done the clip-test
|
||||
GrFixed width = glyph->fBounds.width();
|
||||
GrFixed height = glyph->fBounds.height();
|
||||
|
@ -361,12 +361,12 @@ bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
|
||||
for (int i = 0; i < dfWidth*dfHeight; ++i) {
|
||||
unsigned char val;
|
||||
double outerval = outerDist[i];
|
||||
if (outerval < 0.0) {
|
||||
outerval = 0.0;
|
||||
if (outerval < 0.0) {
|
||||
outerval = 0.0;
|
||||
}
|
||||
double innerval = innerDist[i];
|
||||
if (innerval < 0.0) {
|
||||
innerval = 0.0;
|
||||
if (innerval < 0.0) {
|
||||
innerval = 0.0;
|
||||
}
|
||||
double dist = outerval - innerval;
|
||||
if (dist <= -DISTANCE_FIELD_RANGE) {
|
||||
@ -378,9 +378,9 @@ bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
|
||||
}
|
||||
*dfPtr++ = val;
|
||||
}
|
||||
|
||||
|
||||
// copy to atlas
|
||||
plot = fAtlasMgr->addToAtlas(&fAtlas, dfWidth, dfHeight, dfStorage.get(),
|
||||
plot = fAtlasMgr->addToAtlas(&fAtlas, dfWidth, dfHeight, dfStorage.get(),
|
||||
&glyph->fAtlasLocation);
|
||||
|
||||
} else {
|
||||
@ -394,8 +394,8 @@ bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
|
||||
return false;
|
||||
}
|
||||
|
||||
plot = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(),
|
||||
glyph->height(), storage.get(),
|
||||
plot = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(),
|
||||
glyph->height(), storage.get(),
|
||||
&glyph->fAtlasLocation);
|
||||
#if SK_DISTANCEFIELD_FONTS
|
||||
}
|
||||
@ -408,4 +408,3 @@ bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
|
||||
glyph->fPlot = plot;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,7 @@
|
||||
#include "GrTexture.h"
|
||||
|
||||
// The distance field is constructed as unsigned char values, so that the zero value is at 128.
|
||||
// Hence our zero threshold is 128/255.
|
||||
// Hence our zero threshold is 128/255.
|
||||
#define THRESHOLD "0.50196078431"
|
||||
|
||||
class GrGLDistanceFieldTextureEffect : public GrGLVertexEffect {
|
||||
@ -47,7 +47,7 @@ public:
|
||||
kVec2f_GrSLType);
|
||||
builder->fsCodeAppend(";\n");
|
||||
builder->fsCodeAppend("\tfloat distance = texColor.r;\n");
|
||||
// this gives us a smooth step across approximately one fragment
|
||||
// this gives us a smooth step across approximately one fragment
|
||||
// (assuming a radius of the diagonal of the fragment, hence a factor of sqrt(2)/2)
|
||||
builder->fsCodeAppend("\tfloat afwidth = 0.7071*length(vec2(dFdx(distance), dFdy(distance)));\n");
|
||||
builder->fsCodeAppend("\tfloat val = smoothstep("THRESHOLD"-afwidth, "THRESHOLD"+afwidth, distance);\n");
|
||||
|
@ -14,7 +14,7 @@
|
||||
class GrGLDistanceFieldTextureEffect;
|
||||
|
||||
/**
|
||||
* The output color of this effect is a modulation of the input color and a sample from a
|
||||
* The output color of this effect is a modulation of the input color and a sample from a
|
||||
* distance field texture (using a smoothed step function near 0.5).
|
||||
* It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input
|
||||
* coords are a custom attribute.
|
||||
|
Loading…
Reference in New Issue
Block a user