diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-06-29 16:25:36 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-06-29 16:25:36 +0000 |
commit | 4516f4786f5dda1b86a8f825b9e8e910d9c2363c (patch) | |
tree | 276d700f732a017cef1eadb8a8cf176c87e0bd0a /src | |
parent | 4b7577b042966657c776fd95c67f9363af57945f (diff) |
use sk_bzero instead of bzero, since it isn't always available.
git-svn-id: http://skia.googlecode.com/svn/trunk@244 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmap.cpp | 8 | ||||
-rw-r--r-- | src/core/SkConcaveToTriangles.cpp | 2 | ||||
-rw-r--r-- | src/core/SkDraw.cpp | 2 | ||||
-rw-r--r-- | src/core/SkMatrix.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPictureFlat.cpp | 2 | ||||
-rw-r--r-- | src/core/SkRect.cpp | 2 | ||||
-rw-r--r-- | src/core/SkScalerContext.cpp | 10 | ||||
-rw-r--r-- | src/gl/SkGL.cpp | 2 | ||||
-rw-r--r-- | src/gl/SkGL.h | 4 | ||||
-rw-r--r-- | src/gl/SkGLTextCache.cpp | 4 | ||||
-rw-r--r-- | src/gl/SkTextureCache.cpp | 4 | ||||
-rw-r--r-- | src/images/SkImageDecoder_libpvjpeg.cpp | 2 | ||||
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 6 | ||||
-rwxr-xr-x | src/ports/SkFontHost_mac.cpp | 2 |
14 files changed, 26 insertions, 26 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 2513b5147e..5ee4c5614b 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -84,12 +84,12 @@ struct SkBitmap::MipMap : SkNoncopyable { /////////////////////////////////////////////////////////////////////////////// SkBitmap::SkBitmap() { - bzero(this, sizeof(*this)); + sk_bzero(this, sizeof(*this)); } SkBitmap::SkBitmap(const SkBitmap& src) { SkDEBUGCODE(src.validate();) - bzero(this, sizeof(*this)); + sk_bzero(this, sizeof(*this)); *this = src; SkDEBUGCODE(this->validate();) } @@ -153,7 +153,7 @@ void SkBitmap::swap(SkBitmap& other) { void SkBitmap::reset() { this->freePixels(); - bzero(this, sizeof(*this)); + sk_bzero(this, sizeof(*this)); } int SkBitmap::ComputeBytesPerPixel(SkBitmap::Config config) { @@ -1319,7 +1319,7 @@ void SkBitmap::unflatten(SkFlattenableReadBuffer& buffer) { SkBitmap::RLEPixels::RLEPixels(int width, int height) { fHeight = height; fYPtrs = (uint8_t**)sk_malloc_throw(height * sizeof(uint8_t*)); - bzero(fYPtrs, height * sizeof(uint8_t*)); + sk_bzero(fYPtrs, height * sizeof(uint8_t*)); } SkBitmap::RLEPixels::~RLEPixels() { diff --git a/src/core/SkConcaveToTriangles.cpp b/src/core/SkConcaveToTriangles.cpp index efad5287d4..fa718e5096 100644 --- a/src/core/SkConcaveToTriangles.cpp +++ b/src/core/SkConcaveToTriangles.cpp @@ -687,7 +687,7 @@ bool ConvertPointsToVertices(size_t numPts, const SkPoint *pts, Vertex *vta) { // Clear everything. DebugPrintf("Zeroing vertices\n"); - bzero(vta, numPts * sizeof(*vta)); + sk_bzero(vta, numPts * sizeof(*vta)); // Initialize vertices. DebugPrintf("Initializing vertices\n"); diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index fa3eb55a36..c4ea43a4cb 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -151,7 +151,7 @@ SkDraw::SkDraw(const SkDraw& src) { typedef void (*BitmapXferProc)(void* pixels, size_t bytes, uint32_t data); static void D_Clear_BitmapXferProc(void* pixels, size_t bytes, uint32_t) { - bzero(pixels, bytes); + sk_bzero(pixels, bytes); } static void D_Dst_BitmapXferProc(void*, size_t, uint32_t data) {} diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index 48fa804d9b..3d2712b073 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -397,7 +397,7 @@ bool SkMatrix::setRectToRect(const SkRect& src, const SkRect& dst, } if (dst.isEmpty()) { - bzero(fMat, 8 * sizeof(SkScalar)); + sk_bzero(fMat, 8 * sizeof(SkScalar)); this->setTypeMask(kScale_Mask | kRectStaysRect_Mask); } else { SkScalar tx, sx = SkScalarDiv(dst.width(), src.width()); diff --git a/src/core/SkPictureFlat.cpp b/src/core/SkPictureFlat.cpp index e221e55a20..3b02752a3f 100644 --- a/src/core/SkPictureFlat.cpp +++ b/src/core/SkPictureFlat.cpp @@ -246,7 +246,7 @@ void SkRefCntPlayback::setCount(int count) { fCount = count; fArray = SkNEW_ARRAY(SkRefCnt*, count); - bzero(fArray, count * sizeof(SkRefCnt*)); + sk_bzero(fArray, count * sizeof(SkRefCnt*)); } SkRefCnt* SkRefCntPlayback::set(int index, SkRefCnt* obj) { diff --git a/src/core/SkRect.cpp b/src/core/SkRect.cpp index d602754c5b..7d7324920c 100644 --- a/src/core/SkRect.cpp +++ b/src/core/SkRect.cpp @@ -67,7 +67,7 @@ void SkRect::set(const SkPoint pts[], int count) SkASSERT((pts && count > 0) || count == 0); if (count <= 0) { - bzero(this, sizeof(SkRect)); + sk_bzero(this, sizeof(SkRect)); } else { #ifdef SK_SCALAR_SLOW_COMPARES int32_t l, t, r, b; diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index cc3eb1aa25..7d66c2a5e6 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -334,7 +334,7 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) { glyph->toMask(&mask); mask.fFormat = SkMask::kA8_Format; - bzero(glyph->fImage, mask.computeImageSize()); + sk_bzero(glyph->fImage, mask.computeImageSize()); if (!fRasterizer->rasterize(fillPath, fillToDevMatrix, NULL, fMaskFilter, &mask, @@ -364,7 +364,7 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) { bm.setConfig(config, glyph->fWidth, glyph->fHeight, glyph->rowBytes()); bm.setPixels(glyph->fImage); - bzero(glyph->fImage, bm.height() * bm.rowBytes()); + sk_bzero(glyph->fImage, bm.height() * bm.rowBytes()); draw.fClip = &clip; draw.fMatrix = &matrix; @@ -400,7 +400,7 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) { } // clean out our glyph, since it may be larger than dstM - //bzero(dst, height * dstRB); + //sk_bzero(dst, height * dstRB); while (--height >= 0) { memcpy(dst, src, width); @@ -576,10 +576,10 @@ protected: virtual void generateFontMetrics(SkPaint::FontMetrics* mx, SkPaint::FontMetrics* my) { if (mx) { - bzero(mx, sizeof(*mx)); + sk_bzero(mx, sizeof(*mx)); } if (my) { - bzero(my, sizeof(*my)); + sk_bzero(my, sizeof(*my)); } } }; diff --git a/src/gl/SkGL.cpp b/src/gl/SkGL.cpp index 89bcdf4bc2..1fce98f82c 100644 --- a/src/gl/SkGL.cpp +++ b/src/gl/SkGL.cpp @@ -120,7 +120,7 @@ void SkGL::Ortho(float left, float right, float bottom, float top, float mat[16]; - bzero(mat, sizeof(mat)); + sk_bzero(mat, sizeof(mat)); mat[0] = 2 / (right - left); mat[5] = 2 / (top - bottom); diff --git a/src/gl/SkGL.h b/src/gl/SkGL.h index dd2c77f880..9f79ad16fc 100644 --- a/src/gl/SkGL.h +++ b/src/gl/SkGL.h @@ -193,12 +193,12 @@ struct SkGLMatrix { SkGLScalar fMat[16]; void reset() { - bzero(fMat, sizeof(fMat)); + sk_bzero(fMat, sizeof(fMat)); fMat[0] = fMat[5] = fMat[10] = fMat[15] = SK_GLScalar1; } void set(const SkMatrix& m) { - bzero(fMat, sizeof(fMat)); + sk_bzero(fMat, sizeof(fMat)); fMat[0] = SkScalarToGL(m[SkMatrix::kMScaleX]); fMat[4] = SkScalarToGL(m[SkMatrix::kMSkewX]); fMat[12] = SkScalarToGL(m[SkMatrix::kMTransX]); diff --git a/src/gl/SkGLTextCache.cpp b/src/gl/SkGLTextCache.cpp index 141e1001e4..2619dc82e9 100644 --- a/src/gl/SkGLTextCache.cpp +++ b/src/gl/SkGLTextCache.cpp @@ -127,7 +127,7 @@ SkGLTextCache::Strike::addGlyphAndBind(const SkGlyph& glyph, /////////////////////////////////////////////////////////////////////////////// SkGLTextCache::SkGLTextCache() { - bzero(fStrikeList, sizeof(fStrikeList)); + sk_bzero(fStrikeList, sizeof(fStrikeList)); } SkGLTextCache::~SkGLTextCache() { @@ -146,7 +146,7 @@ void SkGLTextCache::deleteAllStrikes(bool texturesAreValid) { strike = next; } } - bzero(fStrikeList, sizeof(fStrikeList)); + sk_bzero(fStrikeList, sizeof(fStrikeList)); } SkGLTextCache::Strike* SkGLTextCache::findGlyph(const SkGlyph& glyph, diff --git a/src/gl/SkTextureCache.cpp b/src/gl/SkTextureCache.cpp index 17b37cae4e..2eb5d84e36 100644 --- a/src/gl/SkTextureCache.cpp +++ b/src/gl/SkTextureCache.cpp @@ -23,7 +23,7 @@ SkTextureCache::SkTextureCache(size_t countMax, size_t sizeMax) fTexCountMax(countMax), fTexSizeMax(sizeMax), fTexCount(0), fTexSize(0) { - bzero(fHash, sizeof(fHash)); + sk_bzero(fHash, sizeof(fHash)); this->validate(); } @@ -52,7 +52,7 @@ void SkTextureCache::deleteAllCaches(bool texturesAreValid) { } fSorted.reset(); - bzero(fHash, sizeof(fHash)); + sk_bzero(fHash, sizeof(fHash)); fTexCount = 0; fTexSize = 0; diff --git a/src/images/SkImageDecoder_libpvjpeg.cpp b/src/images/SkImageDecoder_libpvjpeg.cpp index 91777418b2..b98763e6c9 100644 --- a/src/images/SkImageDecoder_libpvjpeg.cpp +++ b/src/images/SkImageDecoder_libpvjpeg.cpp @@ -107,7 +107,7 @@ static bool getFrame(PVJpgDecoderInterface* codec, SkBitmap* bitmap, TPvJpgDecFrame frame; uint8* ptrs[3]; int32 widths[3], heights[3]; - bzero(ptrs, sizeof(ptrs)); + sk_bzero(ptrs, sizeof(ptrs)); frame.ptr = ptrs; frame.iWidth = widths; frame.iHeight = heights; diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 7aa14b252e..b30aba53fb 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -156,7 +156,7 @@ SkFaceRec::SkFaceRec(SkStream* strm, uint32_t fontID) : fSkStream(strm), fFontID(fontID) { // SkDEBUGF(("SkFaceRec: opening %s (%p)\n", key.c_str(), strm)); - bzero(&fFTStream, sizeof(fFTStream)); + sk_bzero(&fFTStream, sizeof(fFTStream)); fFTStream.size = fSkStream->getLength(); fFTStream.descriptor.pointer = fSkStream; fFTStream.read = sk_stream_read; @@ -754,10 +754,10 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx, if (this->setupSize()) { ERROR: if (mx) { - bzero(mx, sizeof(SkPaint::FontMetrics)); + sk_bzero(mx, sizeof(SkPaint::FontMetrics)); } if (my) { - bzero(my, sizeof(SkPaint::FontMetrics)); + sk_bzero(my, sizeof(SkPaint::FontMetrics)); } return; } diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index e9dfc6a852..5deae35491 100755 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -251,7 +251,7 @@ void SkScalerContext_Mac::generateImage(const SkGlyph& glyph) SkAutoMutexAcquire ac(gFTMutex); SkASSERT(fLayout); - bzero(glyph.fImage, glyph.fHeight * glyph.rowBytes()); + sk_bzero(glyph.fImage, glyph.fHeight * glyph.rowBytes()); CGContextRef contextRef = ::CGBitmapContextCreate(glyph.fImage, glyph.fWidth, glyph.fHeight, 8, glyph.rowBytes(), fGrayColorSpace, |