aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrLayerCache.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-08-26 13:07:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-26 13:07:49 -0700
commit385fe4d4b62d7d1dd76116dd570df3290a2f487b (patch)
tree53d982ff238828331e86acd44071a44162a8688c /src/gpu/GrLayerCache.cpp
parent5015176adf046ef906a2313b6e6b64b72cc84898 (diff)
Style Change: SkNEW->new; SkDELETE->delete
Diffstat (limited to 'src/gpu/GrLayerCache.cpp')
-rw-r--r--src/gpu/GrLayerCache.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index 4a2060779a..e894c3023e 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -90,7 +90,7 @@ GrLayerCache::~GrLayerCache() {
GrCachedLayer* layer = &(*iter);
SkASSERT(0 == layer->uses());
this->unlock(layer);
- SkDELETE(layer);
+ delete layer;
}
SkASSERT(0 == fPictureHash.count());
@@ -104,9 +104,9 @@ void GrLayerCache::initAtlas() {
GR_STATIC_ASSERT(kNumPlotsX*kNumPlotsX == GrPictureInfo::kNumPlots);
SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight);
- fAtlas.reset(SkNEW_ARGS(GrAtlas, (fContext->getGpu(), kSkia8888_GrPixelConfig,
- kRenderTarget_GrSurfaceFlag,
- textureSize, kNumPlotsX, kNumPlotsY, false)));
+ fAtlas.reset(new GrAtlas(fContext->getGpu(), kSkia8888_GrPixelConfig,
+ kRenderTarget_GrSurfaceFlag, textureSize, kNumPlotsX, kNumPlotsY,
+ false));
}
void GrLayerCache::freeAll() {
@@ -115,7 +115,7 @@ void GrLayerCache::freeAll() {
for (; !iter.done(); ++iter) {
GrCachedLayer* layer = &(*iter);
this->unlock(layer);
- SkDELETE(layer);
+ delete layer;
}
fLayerHash.rewind();
@@ -133,9 +133,8 @@ GrCachedLayer* GrLayerCache::createLayer(uint32_t pictureID,
const SkPaint* paint) {
SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0);
- GrCachedLayer* layer = SkNEW_ARGS(GrCachedLayer, (pictureID, start, stop,
- srcIR, dstIR, initialMat,
- key, keySize, paint));
+ GrCachedLayer* layer = new GrCachedLayer(pictureID, start, stop, srcIR, dstIR, initialMat, key,
+ keySize, paint);
fLayerHash.add(layer);
return layer;
}
@@ -200,7 +199,7 @@ bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
// Not in the atlas - will it fit?
GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
if (NULL == pictInfo) {
- pictInfo = SkNEW_ARGS(GrPictureInfo, (layer->pictureID()));
+ pictInfo = new GrPictureInfo(layer->pictureID());
fPictureHash.add(pictInfo);
}
@@ -235,7 +234,7 @@ bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
if (pictInfo->fPlotUsage.isEmpty()) {
fPictureHash.remove(pictInfo->fPictureID);
- SkDELETE(pictInfo);
+ delete pictInfo;
}
}
@@ -295,7 +294,7 @@ void GrLayerCache::unlock(GrCachedLayer* layer) {
if (pictInfo->fPlotUsage.isEmpty()) {
fPictureHash.remove(pictInfo->fPictureID);
- SkDELETE(pictInfo);
+ delete pictInfo;
}
}
@@ -380,13 +379,13 @@ void GrLayerCache::purge(uint32_t pictureID) {
SkASSERT(0 == toBeRemoved[i]->uses());
this->unlock(toBeRemoved[i]);
fLayerHash.remove(GrCachedLayer::GetKey(*toBeRemoved[i]));
- SkDELETE(toBeRemoved[i]);
+ delete toBeRemoved[i];
}
GrPictureInfo* pictInfo = fPictureHash.find(pictureID);
if (pictInfo) {
fPictureHash.remove(pictureID);
- SkDELETE(pictInfo);
+ delete pictInfo;
}
}
@@ -431,7 +430,7 @@ void GrLayerCache::purgePlot(GrPlot* plot) {
// Aggressively remove layers and, if it becomes totally uncached, delete the picture info
fLayerHash.remove(GrCachedLayer::GetKey(*toBeRemoved[i]));
- SkDELETE(toBeRemoved[i]);
+ delete toBeRemoved[i];
GrPictureInfo* pictInfo = fPictureHash.find(pictureIDToRemove);
if (pictInfo) {
@@ -442,7 +441,7 @@ void GrLayerCache::purgePlot(GrPlot* plot) {
if (pictInfo->fPlotUsage.isEmpty()) {
fPictureHash.remove(pictInfo->fPictureID);
- SkDELETE(pictInfo);
+ delete pictInfo;
}
}
}