Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@9440 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
4a3ca94322
commit
8f6ef4010f
@ -106,7 +106,7 @@ private:
|
||||
void drawPosText_asPaths(const char text[], size_t byteLength,
|
||||
const SkScalar pos[], SkScalar constY,
|
||||
int scalarsPerPosition, const SkPaint&) const;
|
||||
|
||||
|
||||
/**
|
||||
* Return the current clip bounds, in local coordinates, with slop to account
|
||||
* for antialiasing or hairlines (i.e. device-bounds outset by 1, and then
|
||||
|
@ -946,11 +946,11 @@ public:
|
||||
}
|
||||
return matrix;
|
||||
}
|
||||
|
||||
|
||||
SkMatrix* setTextMatrix(SkMatrix* matrix) const {
|
||||
return SetTextMatrix(matrix, fTextSize, fTextScaleX, fTextSkewX);
|
||||
}
|
||||
|
||||
|
||||
SkDEVCODE(void toString(SkString*) const;)
|
||||
|
||||
private:
|
||||
@ -1033,7 +1033,7 @@ private:
|
||||
|
||||
bool tooBigToUseCache() const;
|
||||
bool tooBigToUseCache(const SkMatrix& ctm) const;
|
||||
|
||||
|
||||
// Set flags/hinting/textSize up to use for drawing text as paths.
|
||||
// Returns scale factor to restore the original textSize, since will will
|
||||
// have change it to kCanonicalTextSizeForPaths.
|
||||
|
@ -37,7 +37,7 @@ bool SkDraw::ShouldDrawTextAsPaths(const SkPaint& paint, const SkMatrix& ctm) {
|
||||
0 == paint.getStrokeWidth()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// we don't cache perspective
|
||||
if (ctm.hasPerspective()) {
|
||||
return true;
|
||||
@ -1867,7 +1867,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
|
||||
SkMatrix matrix = *fMatrix;
|
||||
matrix.preScale(matrixScale, matrixScale);
|
||||
const SkScalar posScale = SkScalarInvert(matrixScale);
|
||||
|
||||
|
||||
SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
|
||||
SkAutoGlyphCache autoCache(paint, NULL, NULL);
|
||||
SkGlyphCache* cache = autoCache.getCache();
|
||||
@ -1876,7 +1876,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
|
||||
AlignProc alignProc = pick_align_proc(paint.getTextAlign());
|
||||
TextMapState tms(SkMatrix::I(), constY);
|
||||
TextMapState::Proc tmsProc = tms.pickProc(scalarsPerPosition);
|
||||
|
||||
|
||||
while (text < stop) {
|
||||
const SkGlyph& glyph = glyphCacheProc(cache, &text, 0, 0);
|
||||
if (glyph.fWidth) {
|
||||
@ -1885,7 +1885,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
|
||||
tmsProc(tms, pos);
|
||||
SkIPoint fixedLoc;
|
||||
alignProc(tms.fLoc, glyph, &fixedLoc);
|
||||
|
||||
|
||||
SkMatrix localMatrix = matrix;
|
||||
localMatrix.preTranslate(SkFixedToScalar(fixedLoc.fX) * posScale,
|
||||
SkFixedToScalar(fixedLoc.fY) * posScale);
|
||||
|
@ -961,10 +961,10 @@ SkScalar SkPaint::setupForAsPaths() {
|
||||
flags &= ~TEXT_AS_PATHS_PAINT_FLAGS_TO_IGNORE;
|
||||
// set the flags we do care about
|
||||
flags |= SkPaint::kSubpixelText_Flag;
|
||||
|
||||
|
||||
this->setFlags(flags);
|
||||
this->setHinting(SkPaint::kNo_Hinting);
|
||||
|
||||
|
||||
SkScalar textSize = fTextSize;
|
||||
this->setTextSize(kCanonicalTextSizeForPaths);
|
||||
return textSize / kCanonicalTextSizeForPaths;
|
||||
@ -981,7 +981,7 @@ public:
|
||||
}
|
||||
|
||||
const SkPaint& getPaint() const { return *fPaint; }
|
||||
|
||||
|
||||
/**
|
||||
* Returns 0 if the paint was unmodified, or the scale factor need to
|
||||
* the original textSize
|
||||
@ -1274,7 +1274,7 @@ SkScalar SkPaint::getFontMetrics(FontMetrics* metrics, SkScalar zoom) const {
|
||||
SkCanonicalizePaint canon(*this);
|
||||
const SkPaint& paint = canon.getPaint();
|
||||
SkScalar scale = canon.getScale();
|
||||
|
||||
|
||||
SkMatrix zoomMatrix, *zoomPtr = NULL;
|
||||
if (zoom) {
|
||||
zoomMatrix.setScale(zoom, zoom);
|
||||
|
@ -449,7 +449,7 @@ void SkString::insert(size_t offset, const char text[], size_t len) {
|
||||
if (offset > length) {
|
||||
offset = length;
|
||||
}
|
||||
|
||||
|
||||
// Check if length + len exceeds 32bits, we trim len
|
||||
len = check_add32(length, len);
|
||||
if (0 == len) {
|
||||
|
@ -30,7 +30,7 @@ static const int bugChar = strlen(funcName) + 1;
|
||||
|
||||
#define COMPARE_RESULT(append, compare) CompareResult(&bugOut, append, compare)
|
||||
#else
|
||||
#define COMPARE_RESULT(append, compare) compare
|
||||
#define COMPARE_RESULT(append, compare) compare
|
||||
#endif
|
||||
|
||||
bool SkOpAngle::calcSlop(double x, double y, double rx, double ry, bool* result) const{
|
||||
@ -105,7 +105,7 @@ bool SkOpAngle::operator<(const SkOpAngle& rh) const { // this/lh: left-hand; r
|
||||
}
|
||||
// at this point, both y's are zero, so lines are coincident or one is degenerate
|
||||
SkASSERT(x * rx != 0); // and a degenerate line should haven't gotten this far
|
||||
}
|
||||
}
|
||||
// see if either curve can be lengthened before trying the tangent
|
||||
if (fSegment->other(fEnd) != rh.fSegment // tangents not absolutely identical
|
||||
&& rh.fSegment->other(rh.fEnd) != fSegment) { // and not intersecting
|
||||
@ -133,7 +133,7 @@ bool SkOpAngle::operator<(const SkOpAngle& rh) const { // this/lh: left-hand; r
|
||||
// if the vector was a result of subdividing a curve, see if it is stable
|
||||
bool sloppy1 = x_ry < rx_y;
|
||||
bool sloppy2 = !sloppy1;
|
||||
if ((!fComputed || calcSlop(x, y, rx, ry, &sloppy1))
|
||||
if ((!fComputed || calcSlop(x, y, rx, ry, &sloppy1))
|
||||
&& (!rh.fComputed || rh.calcSlop(rx, ry, x, y, &sloppy2))
|
||||
&& sloppy1 != sloppy2) {
|
||||
return COMPARE_RESULT("8 CalcSlop(x, y ...", sloppy1);
|
||||
@ -384,7 +384,7 @@ void SkOpAngle::setSpans() {
|
||||
fUnsortable = fSegment->isTiny(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
SkASSERT(0);
|
||||
|
@ -81,7 +81,7 @@ private:
|
||||
// if subdividing a quad or cubic causes the tangent to go from the maximum angle to the
|
||||
// minimum, mark it unorderable. It still can be sorted, which is good enough for find-top
|
||||
// but can't be ordered, and therefore can't be used to compute winding
|
||||
bool fUnorderable;
|
||||
bool fUnorderable;
|
||||
mutable bool fUnsortable; // this alone is editable by the less than operator
|
||||
#if DEBUG_ANGLE
|
||||
int fID;
|
||||
|
@ -407,7 +407,7 @@ SkDCubic SkDCubic::subDivide(double t1, double t2) const {
|
||||
return dst;
|
||||
}
|
||||
|
||||
void SkDCubic::align(int endIndex, int ctrlIndex, SkDPoint* dstPt) const {
|
||||
void SkDCubic::align(int endIndex, int ctrlIndex, SkDPoint* dstPt) const {
|
||||
if (fPts[endIndex].fX == fPts[ctrlIndex].fX) {
|
||||
dstPt->fX = fPts[endIndex].fX;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ struct SkDCubic {
|
||||
const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < 4); return fPts[n]; }
|
||||
SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 4); return fPts[n]; }
|
||||
|
||||
void align(int endIndex, int ctrlIndex, SkDPoint* dstPt) const;
|
||||
void align(int endIndex, int ctrlIndex, SkDPoint* dstPt) const;
|
||||
double calcPrecision() const;
|
||||
SkDCubicPair chopAt(double t) const;
|
||||
bool clockwise() const;
|
||||
|
@ -221,7 +221,7 @@ SkDQuad SkDQuad::subDivide(double t1, double t2) const {
|
||||
return dst;
|
||||
}
|
||||
|
||||
void SkDQuad::align(int endIndex, SkDPoint* dstPt) const {
|
||||
void SkDQuad::align(int endIndex, SkDPoint* dstPt) const {
|
||||
if (fPts[endIndex].fX == fPts[1].fX) {
|
||||
dstPt->fX = fPts[endIndex].fX;
|
||||
}
|
||||
|
@ -412,9 +412,9 @@ static int find_slop(double x, double y, double rx, double ry) {
|
||||
static double diamond_angle(double y, double x)
|
||||
{
|
||||
if (y >= 0)
|
||||
return (x >= 0 ? y/(x+y) : 1-x/(-x+y));
|
||||
return (x >= 0 ? y/(x+y) : 1-x/(-x+y));
|
||||
else
|
||||
return (x < 0 ? 2-y/(-x-y) : 3+x/(x-y));
|
||||
return (x < 0 ? 2-y/(-x-y) : 3+x/(x-y));
|
||||
}
|
||||
|
||||
static const double slopTests[][4] = {
|
||||
@ -431,8 +431,8 @@ static void PathOpsAngleFindSlop(skiatest::Reporter* reporter) {
|
||||
double y = slopTest[1];
|
||||
double rx = slopTest[2];
|
||||
double ry = slopTest[3];
|
||||
SkDebugf("%s xy %d=%d\n", __FUNCTION__, (int) index, find_slop(x, y, rx, ry));
|
||||
SkDebugf("%s rxy %d=%d\n", __FUNCTION__, (int) index, find_slop(rx, ry, x, y));
|
||||
SkDebugf("%s xy %d=%d\n", __FUNCTION__, (int) index, find_slop(x, y, rx, ry));
|
||||
SkDebugf("%s rxy %d=%d\n", __FUNCTION__, (int) index, find_slop(rx, ry, x, y));
|
||||
double angle = diamond_angle(y, x);
|
||||
double rAngle = diamond_angle(ry, rx);
|
||||
double diff = fabs(angle - rAngle);
|
||||
|
Loading…
Reference in New Issue
Block a user