diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-03-19 21:52:42 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-03-19 21:52:42 +0000 |
commit | 98388345db8a56e12e25b02b56a5d843376cb3db (patch) | |
tree | c534651c180de794a956ed720ee1d4ab8cfab703 | |
parent | 032c42f49ff6629726be020c5f093c64a4847c19 (diff) | |
download | src-98388345db8a56e12e25b02b56a5d843376cb3db.tar.gz |
promote SkMask's rowBytes to 32bits, since its bounds is a 32bit rect
be sure a rect is sorted before using it as the path's bounds cache
git-svn-id: http://skia.googlecode.com/svn/trunk/src@128 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | core/SkBitmap.cpp | 2 | ||||
-rw-r--r-- | core/SkDraw.cpp | 6 | ||||
-rw-r--r-- | core/SkPath.cpp | 2 | ||||
-rw-r--r-- | core/SkScalerContext.cpp | 2 | ||||
-rw-r--r-- | effects/SkBlurMask.cpp | 4 | ||||
-rw-r--r-- | effects/SkLayerRasterizer.cpp | 2 |
6 files changed, 10 insertions, 8 deletions
diff --git a/core/SkBitmap.cpp b/core/SkBitmap.cpp index 5ca3601a..bdc795fa 100644 --- a/core/SkBitmap.cpp +++ b/core/SkBitmap.cpp @@ -893,7 +893,7 @@ void SkBitmap::buildMipMap(bool forceRebuild) { level[i].fPixels = addr; level[i].fWidth = SkToU16(width); level[i].fHeight = SkToU16(height); - level[i].fRowBytes = SkToU16(rowBytes); + level[i].fRowBytes = rowBytes; dstBM.setConfig(config, width, height, rowBytes); dstBM.setPixels(addr); diff --git a/core/SkDraw.cpp b/core/SkDraw.cpp index bc981f95..55530f59 100644 --- a/core/SkDraw.cpp +++ b/core/SkDraw.cpp @@ -1250,7 +1250,7 @@ static void D1G_NoBounder_RectClip(const SkDraw1Glyph& state, } mask.fRowBytes = glyph.rowBytes(); - mask.fFormat = glyph.fMaskFormat; + mask.fFormat = (SkMask::Format)glyph.fMaskFormat; mask.fImage = aa; state.fBlitter->blitMask(mask, *bounds); } @@ -1280,7 +1280,7 @@ static void D1G_NoBounder_RgnClip(const SkDraw1Glyph& state, } mask.fRowBytes = glyph.rowBytes(); - mask.fFormat = glyph.fMaskFormat; + mask.fFormat = (SkMask::Format)glyph.fMaskFormat; mask.fImage = (uint8_t*)aa; do { state.fBlitter->blitMask(mask, cr); @@ -1313,7 +1313,7 @@ static void D1G_Bounder(const SkDraw1Glyph& state, if (state.fBounder->doIRect(cr)) { mask.fRowBytes = glyph.rowBytes(); - mask.fFormat = glyph.fMaskFormat; + mask.fFormat = (SkMask::Format)glyph.fMaskFormat; mask.fImage = (uint8_t*)aa; do { state.fBlitter->blitMask(mask, cr); diff --git a/core/SkPath.cpp b/core/SkPath.cpp index de90896a..3d5ccda7 100644 --- a/core/SkPath.cpp +++ b/core/SkPath.cpp @@ -62,6 +62,8 @@ private: fPath = path; fDirty = path->fFastBoundsIsDirty; fEmpty = path->isEmpty(); + // can't use fRect for our bounds unless we know is upright and proper + fRect.sort(); } }; diff --git a/core/SkScalerContext.cpp b/core/SkScalerContext.cpp index 8f84cbba..9d028318 100644 --- a/core/SkScalerContext.cpp +++ b/core/SkScalerContext.cpp @@ -41,7 +41,7 @@ void SkGlyph::toMask(SkMask* mask) const { mask->fImage = (uint8_t*)fImage; mask->fBounds.set(fLeft, fTop, fLeft + fWidth, fTop + fHeight); mask->fRowBytes = this->rowBytes(); - mask->fFormat = fMaskFormat; + mask->fFormat = (SkMask::Format)fMaskFormat; } size_t SkGlyph::computeImageSize() const { diff --git a/effects/SkBlurMask.cpp b/effects/SkBlurMask.cpp index a7b32029..416eda42 100644 --- a/effects/SkBlurMask.cpp +++ b/effects/SkBlurMask.cpp @@ -228,7 +228,7 @@ bool SkBlurMask::Blur(SkMask* dst, const SkMask& src, dst->fBounds.set(src.fBounds.fLeft - rx, src.fBounds.fTop - ry, src.fBounds.fRight + rx, src.fBounds.fBottom + ry); - dst->fRowBytes = SkToU16(dst->fBounds.width()); + dst->fRowBytes = dst->fBounds.width(); dst->fFormat = SkMask::kA8_Format; dst->fImage = NULL; @@ -277,7 +277,7 @@ bool SkBlurMask::Blur(SkMask* dst, const SkMask& src, if (style == kInner_Style) { dst->fBounds = src.fBounds; // restore trimmed bounds - dst->fRowBytes = SkToU16(dst->fBounds.width()); + dst->fRowBytes = dst->fBounds.width(); } #if 0 diff --git a/effects/SkLayerRasterizer.cpp b/effects/SkLayerRasterizer.cpp index 390e3a32..ad16ea83 100644 --- a/effects/SkLayerRasterizer.cpp +++ b/effects/SkLayerRasterizer.cpp @@ -107,7 +107,7 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix, if (SkMask::kComputeBoundsAndRenderImage_CreateMode == mode) { mask->fFormat = SkMask::kA8_Format; - mask->fRowBytes = SkToU16(mask->fBounds.width()); + mask->fRowBytes = mask->fBounds.width(); mask->fImage = SkMask::AllocImage(mask->computeImageSize()); memset(mask->fImage, 0, mask->computeImageSize()); } |