Replace new with SkNEW in more effects classes.

http://codereview.appspot.com/6431052/



git-svn-id: http://skia.googlecode.com/svn/trunk@4727 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
tomhudson@google.com 2012-07-24 12:22:40 +00:00
parent e21cb18c52
commit 060ef18d5c
4 changed files with 6 additions and 6 deletions

View File

@ -108,7 +108,7 @@ void SkBitmapCache::add(const void* buffer, size_t len, const SkBitmap& bm) {
fEntryCount -= 1;
}
Entry* entry = new Entry(buffer, len, bm);
Entry* entry = SkNEW_ARGS(Entry, (buffer, len, bm));
this->attachToHead(entry);
fEntryCount += 1;
}

View File

@ -728,7 +728,7 @@ void Gradient_Shader::commonAsABitmap(SkBitmap* bitmap) const {
SkAutoMutexAcquire ama(gMutex);
if (NULL == gCache) {
gCache = new SkBitmapCache(MAX_NUM_CACHED_GRADIENT_BITMAPS);
gCache = SkNEW_ARGS(SkBitmapCache, (MAX_NUM_CACHED_GRADIENT_BITMAPS));
}
size_t size = count * sizeof(int32_t);

View File

@ -40,7 +40,7 @@ void SkLayerRasterizer::addLayer(const SkPaint& paint, SkScalar dx,
SkScalar dy) {
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers.push_back();
new (&rec->fPaint) SkPaint(paint);
SkNEW_PLACEMENT_ARGS(&rec->fPaint, SkPaint, (paint));
rec->fOffset.set(dx, dy);
}
@ -189,9 +189,9 @@ SkLayerRasterizer::SkLayerRasterizer(SkFlattenableReadBuffer& buffer)
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers.push_back();
#if 0
new (&rec->fPaint) SkPaint(buffer);
SkNEW_PLACEMENT_ARGS(&rec->fPaint, SkPaint, (buffer));
#else
new (&rec->fPaint) SkPaint;
SkNEW_PLACEMENT(&rec->fPaint, SkPaint);
paint_read(&rec->fPaint, buffer);
#endif
rec->fOffset.fX = buffer.readScalar();

View File

@ -179,7 +179,7 @@ SkTable_ColorFilter::SkTable_ColorFilter(SkFlattenableReadBuffer& buffer) : INHE
bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) {
if (table) {
if (NULL == fBitmap) {
fBitmap = new SkBitmap;
fBitmap = SkNEW(SkBitmap);
fBitmap->setConfig(SkBitmap::kA8_Config, 256, 4, 256);
fBitmap->allocPixels();
uint8_t* bitmapPixels = fBitmap->getAddr8(0, 0);