aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-03-19 21:52:42 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-03-19 21:52:42 +0000
commit49f0ff25a046d6001dc2d095b6fa3c30f0f46b6a (patch)
tree2168e0a25046e9434e61f9e747c29c1d1dc92d5f /src
parent79b2cd1be5e334c05d8090548788d1bceb42c5f7 (diff)
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@128 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmap.cpp2
-rw-r--r--src/core/SkDraw.cpp6
-rw-r--r--src/core/SkPath.cpp2
-rw-r--r--src/core/SkScalerContext.cpp2
-rw-r--r--src/effects/SkBlurMask.cpp4
-rw-r--r--src/effects/SkLayerRasterizer.cpp2
6 files changed, 10 insertions, 8 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 5ca3601a42..bdc795fa6b 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/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/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index bc981f95b4..55530f59f9 100644
--- a/src/core/SkDraw.cpp
+++ b/src/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/src/core/SkPath.cpp b/src/core/SkPath.cpp
index de90896a56..3d5ccda786 100644
--- a/src/core/SkPath.cpp
+++ b/src/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/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 8f84cbba9c..9d028318bc 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/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/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp
index a7b3202996..416eda422c 100644
--- a/src/effects/SkBlurMask.cpp
+++ b/src/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/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp
index 390e3a32ff..ad16ea8378 100644
--- a/src/effects/SkLayerRasterizer.cpp
+++ b/src/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());
}