Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@9387 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
e1613d8284
commit
26da7f00ae
@ -26,7 +26,7 @@ public:
|
||||
kPartial_Clear
|
||||
};
|
||||
|
||||
GameBench(void* param, Type type, Clear clear,
|
||||
GameBench(void* param, Type type, Clear clear,
|
||||
bool aligned = false, bool useAtlas = false)
|
||||
: INHERITED(param)
|
||||
, fType(type)
|
||||
@ -171,7 +171,7 @@ protected:
|
||||
}
|
||||
|
||||
canvas->concat(mat);
|
||||
if (fUseAtlas) {
|
||||
if (fUseAtlas) {
|
||||
static int curCell = 0;
|
||||
src = fAtlasRects[curCell % (kNumAtlasedX)][curCell / (kNumAtlasedX)];
|
||||
curCell = (curCell + 1) % (kNumAtlasedX*kNumAtlasedY);
|
||||
@ -288,25 +288,25 @@ private:
|
||||
};
|
||||
|
||||
// Partial clear
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kScale_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kScale_Type,
|
||||
GameBench::kPartial_Clear)); )
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
GameBench::kPartial_Clear)); )
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
GameBench::kPartial_Clear, true)); )
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kRotate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kRotate_Type,
|
||||
GameBench::kPartial_Clear)); )
|
||||
|
||||
// Full clear
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kScale_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kScale_Type,
|
||||
GameBench::kFull_Clear)); )
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
GameBench::kFull_Clear)); )
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
GameBench::kFull_Clear, true)); )
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kRotate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kRotate_Type,
|
||||
GameBench::kFull_Clear)); )
|
||||
|
||||
// Atlased
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type,
|
||||
GameBench::kFull_Clear, false, true)); )
|
||||
|
@ -22,16 +22,16 @@ public:
|
||||
SkMatrix local;
|
||||
local.setRotate(180);
|
||||
s->setLocalMatrix(local);
|
||||
|
||||
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setShader(s)->unref();
|
||||
|
||||
|
||||
SkAutoTUnref<SkTypeface> orig(SkTypeface::CreateFromName("Times",
|
||||
SkTypeface::kBold));
|
||||
fColorType = SkNEW_ARGS(SkGTypeface, (orig, paint));
|
||||
}
|
||||
|
||||
|
||||
virtual ~ColorTypeGM() {
|
||||
fColorType->unref();
|
||||
}
|
||||
@ -49,7 +49,7 @@ protected:
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setTypeface(fColorType);
|
||||
|
||||
|
||||
for (SkScalar size = 10; size <= 100; size += 10) {
|
||||
paint.setTextSize(size);
|
||||
canvas->translate(0, paint.getFontMetrics(NULL));
|
||||
|
@ -42,13 +42,13 @@ static void draw_col(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat,
|
||||
|
||||
class FilterBitmapGM : public skiagm::GM {
|
||||
void onOnceBeforeDraw() {
|
||||
|
||||
|
||||
make_bitmap();
|
||||
|
||||
|
||||
SkScalar cx = SkScalarHalf(fBM.width());
|
||||
SkScalar cy = SkScalarHalf(fBM.height());
|
||||
SkScalar scale = get_scale();
|
||||
|
||||
|
||||
|
||||
fMatrix[0].setScale(scale, scale);
|
||||
fMatrix[1].setRotate(30, cx, cy); fMatrix[1].postScale(scale, scale);
|
||||
@ -58,7 +58,7 @@ public:
|
||||
SkBitmap fBM;
|
||||
SkMatrix fMatrix[2];
|
||||
SkString fName;
|
||||
|
||||
|
||||
FilterBitmapGM()
|
||||
{
|
||||
this->setBGColor(0xFFDDDDDD);
|
||||
@ -76,10 +76,10 @@ protected:
|
||||
virtual SkISize onISize() SK_OVERRIDE {
|
||||
return SkISize::Make(920, 480);
|
||||
}
|
||||
|
||||
|
||||
virtual void make_bitmap() = 0;
|
||||
virtual SkScalar get_scale() = 0;
|
||||
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
|
||||
|
||||
canvas->translate(10, 10);
|
||||
@ -106,14 +106,14 @@ class FilterBitmapTextGM: public FilterBitmapGM {
|
||||
sprintf( name, "filterbitmap_text_%.2fpt", fTextSize );
|
||||
setName( name );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
float fTextSize;
|
||||
|
||||
|
||||
SkScalar get_scale() SK_OVERRIDE {
|
||||
return 32.f/fTextSize;
|
||||
}
|
||||
|
||||
|
||||
void make_bitmap() SK_OVERRIDE {
|
||||
fBM.setConfig(SkBitmap::kARGB_8888_Config, int(fTextSize * 8), int(fTextSize * 6));
|
||||
fBM.allocPixels();
|
||||
@ -134,7 +134,7 @@ class FilterBitmapTextGM: public FilterBitmapGM {
|
||||
setTypeface(&paint, "Times", SkTypeface::kBoldItalic);
|
||||
canvas.drawText("Hamburgefons", 12, fTextSize/2, 4.8f*fTextSize, paint);
|
||||
}
|
||||
private:
|
||||
private:
|
||||
typedef FilterBitmapGM INHERITED;
|
||||
};
|
||||
|
||||
@ -147,15 +147,15 @@ class FilterBitmapCheckerboardGM: public FilterBitmapGM {
|
||||
sprintf( name, "filterbitmap_checkerboard_%d_%d", fSize, fNumChecks );
|
||||
setName( name );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
int fSize;
|
||||
int fNumChecks;
|
||||
|
||||
|
||||
SkScalar get_scale() SK_OVERRIDE {
|
||||
return 192.f/fSize;
|
||||
}
|
||||
|
||||
|
||||
void make_bitmap() SK_OVERRIDE {
|
||||
fBM.setConfig(SkBitmap::kARGB_8888_Config, fSize, fSize);
|
||||
fBM.allocPixels();
|
||||
@ -166,14 +166,14 @@ class FilterBitmapCheckerboardGM: public FilterBitmapGM {
|
||||
int cx = (x * fNumChecks) / fSize;
|
||||
int cy = (y * fNumChecks) / fSize;
|
||||
if ((cx+cy)%2) {
|
||||
*s = 0xFFFFFFFF;
|
||||
} else {
|
||||
*s = 0xFFFFFFFF;
|
||||
} else {
|
||||
*s = 0xFF000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private:
|
||||
private:
|
||||
typedef FilterBitmapGM INHERITED;
|
||||
};
|
||||
|
||||
@ -186,15 +186,15 @@ class FilterBitmapImageGM: public FilterBitmapGM {
|
||||
sprintf( name, "filterbitmap_image_%s", filename );
|
||||
setName( name );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
SkString fFilename;
|
||||
int fSize;
|
||||
|
||||
|
||||
SkScalar get_scale() SK_OVERRIDE {
|
||||
return 192.f/fSize;
|
||||
}
|
||||
|
||||
|
||||
void make_bitmap() SK_OVERRIDE {
|
||||
SkString path(skiagm::GM::gResourcePath);
|
||||
path.append( "/" );
|
||||
@ -217,7 +217,7 @@ class FilterBitmapImageGM: public FilterBitmapGM {
|
||||
}
|
||||
fSize = fBM.height();
|
||||
}
|
||||
private:
|
||||
private:
|
||||
typedef FilterBitmapGM INHERITED;
|
||||
};
|
||||
|
||||
|
@ -111,7 +111,7 @@
|
||||
'../src/utils/win/SkHRESULT.cpp',
|
||||
'../src/utils/win/SkIStream.cpp',
|
||||
'../src/utils/win/SkWGL_win.cpp',
|
||||
|
||||
|
||||
#testing
|
||||
'../src/fonts/SkGScalerContext.cpp',
|
||||
'../src/fonts/SkGScalerContext.h',
|
||||
|
@ -420,7 +420,7 @@ public:
|
||||
}
|
||||
void rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2,
|
||||
SkScalar w);
|
||||
|
||||
|
||||
/** Add a cubic bezier from the last point, approaching control points
|
||||
(x1,y1) and (x2,y2), and ending at (x3,y3). If no moveTo() call has been
|
||||
made for this contour, the first point is automatically set to (0,0).
|
||||
|
@ -42,7 +42,7 @@ static void build_coeff4(SkFixed dst[4], float t) {
|
||||
DS( 1.0 / 18.0), DS( 9.0 / 18.0), DS( 27.0 / 18.0), DS(-21.0 / 18.0),
|
||||
DS( 0.0 / 18.0), DS( 0.0 / 18.0), DS( -6.0 / 18.0), DS( 7.0 / 18.0),
|
||||
};
|
||||
|
||||
|
||||
dst[0] = SkFloatToFixed(poly_eval(&coefficients[ 0], t));
|
||||
dst[1] = SkFloatToFixed(poly_eval(&coefficients[ 4], t));
|
||||
dst[2] = SkFloatToFixed(poly_eval(&coefficients[ 8], t));
|
||||
@ -107,7 +107,7 @@ static void bicubicFilter(const SkBitmapProcState& s, int x, int y,
|
||||
int y1 = SkClampMax(sy , maxY);
|
||||
int y2 = SkClampMax(sy + 1, maxY);
|
||||
int y3 = SkClampMax(sy + 2, maxY);
|
||||
|
||||
|
||||
*colors++ = doBicubicFilter( s.fBitmap, coeffX, coeffY, x0, x1, x2, x3, y0, y1, y2, y3 );
|
||||
|
||||
x++;
|
||||
@ -176,7 +176,7 @@ SkBitmapProcState::chooseBicubicFilterProc(const SkPaint& paint) {
|
||||
if (0xFF != paint.getAlpha()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (fInvType & SkMatrix::kAffine_Mask) {
|
||||
return bicubicFilter;
|
||||
} else if (fInvType & SkMatrix::kScale_Mask) {
|
||||
|
@ -168,7 +168,7 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip,
|
||||
fShiftUp = shiftUp;
|
||||
|
||||
SkScalar conicTol = SK_ScalarHalf * (1 << shiftUp);
|
||||
|
||||
|
||||
if (SkPath::kLine_SegmentMask == path.getSegmentMasks()) {
|
||||
return this->buildPoly(path, iclip, shiftUp);
|
||||
}
|
||||
@ -250,7 +250,7 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip,
|
||||
const int MAX_QUADS = 1 << MAX_POW2;
|
||||
const int MAX_QUAD_PTS = 1 + 2 * MAX_QUADS;
|
||||
SkPoint storage[MAX_QUAD_PTS];
|
||||
|
||||
|
||||
SkConic conic;
|
||||
conic.set(pts, iter.conicWeight());
|
||||
int pow2 = conic.computeQuadPOW2(conicTol);
|
||||
|
@ -810,15 +810,15 @@ void SkPath::rLineTo(SkScalar x, SkScalar y) {
|
||||
|
||||
void SkPath::quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2) {
|
||||
SkDEBUGCODE(this->validate();)
|
||||
|
||||
|
||||
this->injectMoveToIfNeeded();
|
||||
|
||||
|
||||
SkPathRef::Editor ed(&fPathRef);
|
||||
SkPoint* pts = ed.growForVerb(kQuad_Verb);
|
||||
pts[0].set(x1, y1);
|
||||
pts[1].set(x2, y2);
|
||||
fSegmentMask |= kQuad_SegmentMask;
|
||||
|
||||
|
||||
GEN_ID_INC;
|
||||
DIRTY_AFTER_EDIT;
|
||||
}
|
||||
@ -841,15 +841,15 @@ void SkPath::conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2,
|
||||
this->quadTo(x1, y1, x2, y2);
|
||||
} else {
|
||||
SkDEBUGCODE(this->validate();)
|
||||
|
||||
|
||||
this->injectMoveToIfNeeded();
|
||||
|
||||
|
||||
SkPathRef::Editor ed(&fPathRef);
|
||||
SkPoint* pts = ed.growForConic(w);
|
||||
pts[0].set(x1, y1);
|
||||
pts[1].set(x2, y2);
|
||||
fSegmentMask |= kConic_SegmentMask;
|
||||
|
||||
|
||||
GEN_ID_INC;
|
||||
DIRTY_AFTER_EDIT;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ class SkGScalerContext : public SkScalerContext {
|
||||
public:
|
||||
SkGScalerContext(SkGTypeface*, const SkDescriptor*);
|
||||
virtual ~SkGScalerContext();
|
||||
|
||||
|
||||
protected:
|
||||
virtual unsigned generateGlyphCount() SK_OVERRIDE;
|
||||
virtual uint16_t generateCharToGlyph(SkUnichar) SK_OVERRIDE;
|
||||
@ -24,7 +24,7 @@ protected:
|
||||
virtual void generatePath(const SkGlyph&, SkPath*) SK_OVERRIDE;
|
||||
virtual void generateFontMetrics(SkPaint::FontMetrics* mX,
|
||||
SkPaint::FontMetrics* mY) SK_OVERRIDE;
|
||||
|
||||
|
||||
private:
|
||||
SkGTypeface* fFace;
|
||||
SkScalerContext* fProxy;
|
||||
@ -78,7 +78,7 @@ uint16_t SkGScalerContext::generateCharToGlyph(SkUnichar uni) {
|
||||
|
||||
void SkGScalerContext::generateAdvance(SkGlyph* glyph) {
|
||||
fProxy->getAdvance(glyph);
|
||||
|
||||
|
||||
SkVector advance;
|
||||
fMatrix.mapXY(SkFixedToScalar(glyph->fAdvanceX),
|
||||
SkFixedToScalar(glyph->fAdvanceY), &advance);
|
||||
@ -117,13 +117,13 @@ void SkGScalerContext::generateImage(const SkGlyph& glyph) {
|
||||
if (SkMask::kARGB32_Format == glyph.fMaskFormat) {
|
||||
SkPath path;
|
||||
fProxy->getPath(glyph, &path);
|
||||
|
||||
|
||||
SkBitmap bm;
|
||||
bm.setConfig(SkBitmap::kARGB_8888_Config, glyph.fWidth, glyph.fHeight,
|
||||
glyph.rowBytes());
|
||||
bm.setPixels(glyph.fImage);
|
||||
bm.eraseColor(0);
|
||||
|
||||
|
||||
SkCanvas canvas(bm);
|
||||
canvas.translate(-SkIntToScalar(glyph.fLeft),
|
||||
-SkIntToScalar(glyph.fTop));
|
||||
@ -215,21 +215,21 @@ size_t SkGTypeface::onGetTableData(SkFontTableTag tag, size_t offset,
|
||||
class SkGFont : public SkRefCnt {
|
||||
public:
|
||||
virtual ~SkGFont();
|
||||
|
||||
|
||||
int unicharToGlyph(SkUnichar) const;
|
||||
|
||||
|
||||
int countGlyphs() const { return fCount; }
|
||||
|
||||
|
||||
float getAdvance(int index) const {
|
||||
SkASSERT((unsigned)index < (unsigned)fCount);
|
||||
return fGlyphs[index].fAdvance;
|
||||
}
|
||||
|
||||
|
||||
const SkPath& getPath(int index) const {
|
||||
SkASSERT((unsigned)index < (unsigned)fCount);
|
||||
return fGlyphs[index].fPath;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
struct Glyph {
|
||||
SkUnichar fUni;
|
||||
@ -238,13 +238,13 @@ private:
|
||||
};
|
||||
int fCount;
|
||||
Glyph* fGlyphs;
|
||||
|
||||
|
||||
friend class SkGFontBuilder;
|
||||
SkGFont(int count, Glyph* array);
|
||||
};
|
||||
|
||||
class SkGFontBuilder {
|
||||
public:
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
|
@ -15,7 +15,7 @@ class SkGTypeface : public SkTypeface {
|
||||
public:
|
||||
SkGTypeface(SkTypeface* proxy, const SkPaint&);
|
||||
virtual ~SkGTypeface();
|
||||
|
||||
|
||||
SkTypeface* proxy() const { return fProxy; }
|
||||
const SkPaint& paint() const { return fPaint; }
|
||||
|
||||
@ -28,13 +28,13 @@ protected:
|
||||
uint32_t glyphIDsCount) const SK_OVERRIDE;
|
||||
virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE;
|
||||
virtual void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const SK_OVERRIDE;
|
||||
|
||||
|
||||
virtual int onGetUPEM() const SK_OVERRIDE;
|
||||
|
||||
|
||||
virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE;
|
||||
virtual size_t onGetTableData(SkFontTableTag, size_t offset,
|
||||
size_t length, void* data) const SK_OVERRIDE;
|
||||
|
||||
|
||||
private:
|
||||
SkTypeface* fProxy;
|
||||
SkPaint fPaint;
|
||||
|
@ -111,7 +111,7 @@ int tool_main(int argc, char** argv) {
|
||||
if (!FLAGS_headCode.isEmpty()) {
|
||||
L.runCode(FLAGS_headCode[0]);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < FLAGS_skpPath.count(); i ++) {
|
||||
SkOSFile::Iter iter(FLAGS_skpPath[i], "skp");
|
||||
SkString inputFilename;
|
||||
|
Loading…
Reference in New Issue
Block a user