Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@9159 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
1c5a94f5e0
commit
539f364e80
@ -22,20 +22,20 @@ public:
|
||||
virtual int saveLayer(const SkRect* bounds, const SkPaint* paint,
|
||||
SaveFlags flags) SK_OVERRIDE;
|
||||
virtual void restore() SK_OVERRIDE;
|
||||
|
||||
|
||||
virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
|
||||
virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
|
||||
virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
|
||||
virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
|
||||
virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
|
||||
virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
|
||||
|
||||
|
||||
virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE;
|
||||
virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool) SK_OVERRIDE;
|
||||
virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE;
|
||||
virtual bool clipRegion(const SkRegion& deviceRgn,
|
||||
SkRegion::Op) SK_OVERRIDE;
|
||||
|
||||
|
||||
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
@ -72,7 +72,7 @@ public:
|
||||
private:
|
||||
lua_State* fL;
|
||||
SkString fFunc;
|
||||
|
||||
|
||||
void sendverb(const char verb[]);
|
||||
|
||||
typedef SkCanvas INHERITED;
|
||||
|
@ -60,4 +60,3 @@ protected:
|
||||
private:
|
||||
typedef SkTypeface_FreeType INHERITED;
|
||||
};
|
||||
|
||||
|
@ -675,7 +675,7 @@ protected:
|
||||
|
||||
private:
|
||||
static void CTPathElement(void *info, const CGPathElement *element);
|
||||
|
||||
|
||||
#if defined(SK_IGNORE_MAC_TEXT_BOUNDS_FIX)
|
||||
void getVerticalOffset(CGGlyph glyphID, SkIPoint* offset) const;
|
||||
#else
|
||||
@ -688,7 +688,7 @@ private:
|
||||
* For use with (and must be called before) generateBBoxes.
|
||||
*/
|
||||
uint16_t getFBoundingBoxesGlyphOffset();
|
||||
|
||||
|
||||
/** Initializes fFBoundingBoxes and returns true on success.
|
||||
*
|
||||
* On Lion and Mountain Lion, CTFontGetBoundingRectsForGlyphs has a bug which causes it to
|
||||
@ -713,10 +713,10 @@ private:
|
||||
* Used on Lion to correct CTFontGetBoundingRectsForGlyphs.
|
||||
*/
|
||||
SkMatrix fFUnitMatrix;
|
||||
|
||||
|
||||
Offscreen fOffscreen;
|
||||
AutoCFRelease<CTFontRef> fCTFont;
|
||||
|
||||
|
||||
/** Vertical variant of fCTFont.
|
||||
*
|
||||
* CT vertical metrics are pre-rotated (in em space, before transform) 90deg clock-wise.
|
||||
@ -725,7 +725,7 @@ private:
|
||||
* Use fCTVerticalFont with kCTFontVerticalOrientation to get metrics in the same space.
|
||||
*/
|
||||
AutoCFRelease<CTFontRef> fCTVerticalFont;
|
||||
|
||||
|
||||
AutoCFRelease<CGFontRef> fCGFont;
|
||||
SkAutoTMalloc<GlyphRect> fFBoundingBoxes;
|
||||
uint16_t fFBoundingBoxesGlyphOffset;
|
||||
@ -760,7 +760,7 @@ SkScalerContext_Mac::SkScalerContext_Mac(SkTypeface_Mac* typeface,
|
||||
CFIndex numGlyphs = CTFontGetGlyphCount(ctFont);
|
||||
SkASSERT(numGlyphs >= 1 && numGlyphs <= 0xFFFF);
|
||||
fGlyphCount = SkToU16(numGlyphs);
|
||||
|
||||
|
||||
#if defined(SK_IGNORE_MAC_TEXT_BOUNDS_FIX)
|
||||
// Get the state we need
|
||||
fRec.getSingleMatrix(&fMatrix);
|
||||
@ -906,7 +906,7 @@ CGRGBPixel* Offscreen::getCG(const SkScalerContext_Mac& context, const SkGlyph&
|
||||
subX = SkFixedToFloat(glyph.getSubXFixed());
|
||||
subY = SkFixedToFloat(glyph.getSubYFixed());
|
||||
}
|
||||
|
||||
|
||||
// CGContextShowGlyphsAtPoint always draws using the horizontal baseline origin.
|
||||
if (context.fVertical) {
|
||||
#if defined(SK_IGNORE_MAC_TEXT_BOUNDS_FIX)
|
||||
@ -918,7 +918,7 @@ CGRGBPixel* Offscreen::getCG(const SkScalerContext_Mac& context, const SkGlyph&
|
||||
subX += offset.fX;
|
||||
subY += offset.fY;
|
||||
}
|
||||
|
||||
|
||||
CGContextShowGlyphsAtPoint(fCG, -glyph.fLeft + subX,
|
||||
glyph.fTop + glyph.fHeight - subY,
|
||||
&glyphID, 1);
|
||||
@ -961,7 +961,7 @@ void SkScalerContext_Mac::getVerticalOffset(CGGlyph glyphID, SkPoint* offset) co
|
||||
// From CG units (pixels, y up) to SkGlyph units (pixels, y down).
|
||||
skVertOffset.fY = -skVertOffset.fY;
|
||||
}
|
||||
|
||||
|
||||
*offset = skVertOffset;
|
||||
}
|
||||
#endif
|
||||
@ -1142,7 +1142,7 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
const CGGlyph cgGlyph = (CGGlyph) glyph->getGlyphID(fBaseGlyphCount);
|
||||
glyph->zeroMetrics();
|
||||
|
||||
|
||||
// The following block produces cgAdvance in CG units (pixels, y up).
|
||||
CGSize cgAdvance;
|
||||
if (fVertical) {
|
||||
@ -1158,7 +1158,7 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
// The following produces skBounds in SkGlyph units (pixels, y down),
|
||||
// or returns early if skBounds would be empty.
|
||||
SkRect skBounds;
|
||||
|
||||
|
||||
// On Mountain Lion, CTFontGetBoundingRectsForGlyphs with kCTFontVerticalOrientation and
|
||||
// CTFontGetVerticalTranslationsForGlyphs do not agree when using OTF CFF fonts.
|
||||
// For TTF fonts these two do agree and we can use CTFontGetBoundingRectsForGlyphs to get
|
||||
@ -1172,10 +1172,10 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
// It is not known which is correct (or if either is correct). However, we must always draw
|
||||
// from the horizontal origin and must use CTFontGetVerticalTranslationsForGlyphs to draw.
|
||||
// As a result, we do not call CTFontGetBoundingRectsForGlyphs for vertical glyphs.
|
||||
|
||||
|
||||
// On Snow Leopard, CTFontGetBoundingRectsForGlyphs ignores kCTFontVerticalOrientation and
|
||||
// returns horizontal bounds.
|
||||
|
||||
|
||||
// On Lion and Mountain Lion, CTFontGetBoundingRectsForGlyphs has a bug which causes it to
|
||||
// return a bad value in cgBounds.origin.x for SFNT fonts whose hhea::numberOfHMetrics is
|
||||
// less than its maxp::numGlyphs. When this is the case we try to read the bounds from the
|
||||
@ -1196,7 +1196,7 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
CGRect cgBounds;
|
||||
CTFontGetBoundingRectsForGlyphs(fCTFont, kCTFontHorizontalOrientation,
|
||||
&cgGlyph, &cgBounds, 1);
|
||||
|
||||
|
||||
// BUG?
|
||||
// 0x200B (zero-advance space) seems to return a huge (garbage) bounds, when
|
||||
// it should be empty. So, if we see a zero-advance, we check if it has an
|
||||
@ -1225,14 +1225,14 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
getVerticalOffset(cgGlyph, &offset);
|
||||
skBounds.offset(offset);
|
||||
}
|
||||
|
||||
|
||||
// Currently the bounds are based on being rendered at (0,0).
|
||||
// The top left must not move, since that is the base from which subpixel positioning is offset.
|
||||
if (fDoSubPosition) {
|
||||
skBounds.fRight += SkFixedToFloat(glyph->getSubXFixed());
|
||||
skBounds.fBottom += SkFixedToFloat(glyph->getSubYFixed());
|
||||
}
|
||||
|
||||
|
||||
SkIRect skIBounds;
|
||||
skBounds.roundOut(&skIBounds);
|
||||
// Expand the bounds by 1 pixel, to give CG room for anti-aliasing.
|
||||
@ -1244,7 +1244,7 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
|
||||
glyph->fTop = SkToS16(skIBounds.fTop);
|
||||
glyph->fWidth = SkToU16(skIBounds.width());
|
||||
glyph->fHeight = SkToU16(skIBounds.height());
|
||||
|
||||
|
||||
#ifdef HACK_COLORGLYPHS
|
||||
glyph->fMaskFormat = SkMask::kARGB32_Format;
|
||||
#endif
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
int t = lua_type(L, -1);
|
||||
SkDebugf("--- expected function %d\n", t);
|
||||
}
|
||||
|
||||
|
||||
lua_newtable(L);
|
||||
setfield_string(L, "verb", verb);
|
||||
}
|
||||
|
@ -70,11 +70,11 @@ public:
|
||||
}
|
||||
lua_close(fL);
|
||||
}
|
||||
|
||||
|
||||
lua_State* get() const { return fL; }
|
||||
lua_State* operator*() const { return fL; }
|
||||
lua_State* operator->() const { return fL; }
|
||||
|
||||
|
||||
bool load(const char code[]) {
|
||||
int err = luaL_loadstring(fL, code) || lua_pcall(fL, 0, 0, 0);
|
||||
if (err) {
|
||||
@ -130,7 +130,7 @@ int tool_main(int argc, char** argv) {
|
||||
SkString inputPath;
|
||||
SkString inputAsSkString(FLAGS_skpPath[i]);
|
||||
sk_tools::make_filepath(&inputPath, inputAsSkString, inputFilename);
|
||||
|
||||
|
||||
const char* path = inputPath.c_str();
|
||||
SkAutoTUnref<SkPicture> pic(load_picture(path));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user