diff options
author | Mike Reed <reed@google.com> | 2010-03-01 09:40:00 -0500 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2010-03-01 09:42:24 -0500 |
commit | 86cd5d6eb40d1bfbfa4eed24f28d8a0f485d63f4 (patch) | |
tree | 5b971d86147865caac0c1936567a8fb121f139c2 /src/core/SkDraw.cpp | |
parent | 5770f2c5ca580514442e30a9f4965e8bb15342f3 (diff) | |
download | external_skia-86cd5d6eb40d1bfbfa4eed24f28d8a0f485d63f4.zip external_skia-86cd5d6eb40d1bfbfa4eed24f28d8a0f485d63f4.tar.gz external_skia-86cd5d6eb40d1bfbfa4eed24f28d8a0f485d63f4.tar.bz2 |
change entrypoint in bounder to pass more Glyph info
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 8bf4c08..f112d4b 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1370,8 +1370,12 @@ static void D1G_Bounder(const SkDraw1Glyph& state, return; } } - - if (state.fBounder->doIRect(cr, glyph.getGlyphID())) { + + // we need to pass the origin, which we approximate with our + // (unadjusted) left,top coordinates (the caller called fixedfloor) + if (state.fBounder->doIRectGlyph(cr, + left - glyph.fLeft, + top - glyph.fTop, glyph)) { mask.fRowBytes = glyph.rowBytes(); mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat); mask.fImage = (uint8_t*)aa; @@ -2249,9 +2253,20 @@ bool SkBounder::doIRect(const SkIRect& r) { return rr.intersect(fClip->getBounds(), r) && this->onIRect(rr); } -bool SkBounder::doIRect(const SkIRect& r, uint16_t glyphID) { +// TODO: change the prototype to take fixed, and update the callers +bool SkBounder::doIRectGlyph(const SkIRect& r, int x, int y, + const SkGlyph& glyph) { SkIRect rr; - return rr.intersect(fClip->getBounds(), r) && this->onIRect(rr, glyphID); + if (!rr.intersect(fClip->getBounds(), r)) { + return false; + } + GlyphRec rec; + rec.fLSB.set(SkIntToFixed(x), SkIntToFixed(y)); + rec.fRSB.set(rec.fLSB.fX + glyph.fAdvanceX, + rec.fLSB.fY + glyph.fAdvanceY); + rec.fGlyphID = glyph.getGlyphID(); + rec.fFlags = 0; + return this->onIRectGlyph(rr, rec); } bool SkBounder::doHairline(const SkPoint& pt0, const SkPoint& pt1, |