Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1343)

Unified Diff: src/gpu/GrBatchAtlas.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchAtlas.cpp
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index f75df8bf126df38fe57be9c5b1f8ba6b153d1363..1607ed12f623bc5eed1e75490e65f6db46881386 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();
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698