aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBatchAtlas.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/GrBatchAtlas.cpp
parent5015176adf046ef906a2313b6e6b64b72cc84898 (diff)
Style Change: SkNEW->new; SkDELETE->delete
Diffstat (limited to 'src/gpu/GrBatchAtlas.cpp')
-rw-r--r--src/gpu/GrBatchAtlas.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index f75df8bf12..1607ed12f6 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -234,13 +234,13 @@ GrBatchAtlas::GrBatchAtlas(GrTexture* texture, int numPlotsX, int numPlotsY)
// set up allocated plots
fBPP = GrBytesPerPixel(texture->desc().fConfig);
- fPlotArray = SkNEW_ARRAY(SkAutoTUnref<BatchPlot>, (fNumPlotsX * fNumPlotsY));
+ fPlotArray = new SkAutoTUnref<BatchPlot>[(fNumPlotsX * fNumPlotsY)];
SkAutoTUnref<BatchPlot>* currPlot = fPlotArray;
for (int y = fNumPlotsY - 1, r = 0; y >= 0; --y, ++r) {
for (int x = fNumPlotsX - 1, c = 0; x >= 0; --x, ++c) {
uint32_t id = r * fNumPlotsX + c;
- currPlot->reset(SkNEW(BatchPlot));
+ currPlot->reset(new BatchPlot);
(*currPlot)->init(this, texture, id, 1, x, y, fPlotWidth, fPlotHeight, fBPP);
// build LRU list
@@ -252,7 +252,7 @@ GrBatchAtlas::GrBatchAtlas(GrTexture* texture, int numPlotsX, int numPlotsY)
GrBatchAtlas::~GrBatchAtlas() {
SkSafeUnref(fTexture);
- SkDELETE_ARRAY(fPlotArray);
+ delete[] fPlotArray;
}
void GrBatchAtlas::processEviction(AtlasID id) {
@@ -278,7 +278,7 @@ inline void GrBatchAtlas::updatePlot(GrDrawBatch::Target* target, AtlasID* id, B
// This new update will piggy back on that previously scheduled update.
if (target->hasTokenBeenFlushed(plot->lastUploadToken())) {
plot->setLastUploadToken(target->asapToken());
- SkAutoTUnref<GrPlotUploader> uploader(SkNEW_ARGS(GrPlotUploader, (plot)));
+ SkAutoTUnref<GrPlotUploader> uploader(new GrPlotUploader(plot));
target->upload(uploader);
}
*id = plot->id();
@@ -338,14 +338,14 @@ bool GrBatchAtlas::addToAtlas(AtlasID* id, GrDrawBatch::Target* batchTarget,
this->processEviction(plot->id());
fPlotList.remove(plot);
SkAutoTUnref<BatchPlot>& newPlot = fPlotArray[plot->index()];
- newPlot.reset(SkNEW(BatchPlot));
+ newPlot.reset(new BatchPlot);
newPlot->init(this, fTexture, index, ++generation, x, y, fPlotWidth, fPlotHeight, fBPP);
fPlotList.addToHead(newPlot.get());
SkDEBUGCODE(bool verify = )newPlot->addSubImage(width, height, image, loc, fBPP * width);
SkASSERT(verify);
newPlot->setLastUploadToken(batchTarget->currentToken());
- SkAutoTUnref<GrPlotUploader> uploader(SkNEW_ARGS(GrPlotUploader, (newPlot)));
+ SkAutoTUnref<GrPlotUploader> uploader(new GrPlotUploader(newPlot));
batchTarget->upload(uploader);
*id = newPlot->id();
plot->unref();