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

Unified Diff: src/utils/SkPatchGrid.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/utils/SkNullCanvas.cpp ('k') | src/utils/SkPatchUtils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkPatchGrid.cpp
diff --git a/src/utils/SkPatchGrid.cpp b/src/utils/SkPatchGrid.cpp
index 96e3c8f25e8a128de2900edddf6a4b96c2cba124..386e3a633df499b62f8c2c2d1040a9159b885eda 100644
--- a/src/utils/SkPatchGrid.cpp
+++ b/src/utils/SkPatchGrid.cpp
@@ -22,11 +22,11 @@ SkPatchGrid::SkPatchGrid(int rows, int cols, VertexType flags, SkXfermode* xfer)
}
SkPatchGrid::~SkPatchGrid() {
- SkDELETE_ARRAY(fCornerPts);
- SkDELETE_ARRAY(fCornerColors);
- SkDELETE_ARRAY(fTexCoords);
- SkDELETE_ARRAY(fHrzCtrlPts);
- SkDELETE_ARRAY(fVrtCtrlPts);
+ delete[] fCornerPts;
+ delete[] fCornerColors;
+ delete[] fTexCoords;
+ delete[] fHrzCtrlPts;
+ delete[] fVrtCtrlPts;
}
bool SkPatchGrid::setPatch(int x, int y, const SkPoint cubics[12], const SkColor colors[4],
@@ -120,38 +120,38 @@ bool SkPatchGrid::getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4],
}
void SkPatchGrid::reset(int rows, int cols, VertexType flags, SkXfermode* xMode) {
- SkDELETE_ARRAY(fCornerPts);
- SkDELETE_ARRAY(fCornerColors);
- SkDELETE_ARRAY(fTexCoords);
- SkDELETE_ARRAY(fHrzCtrlPts);
- SkDELETE_ARRAY(fVrtCtrlPts);
-
+ delete[] fCornerPts;
+ delete[] fCornerColors;
+ delete[] fTexCoords;
+ delete[] fHrzCtrlPts;
+ delete[] fVrtCtrlPts;
+
fCols = cols;
fRows = rows;
fModeFlags = flags;
fXferMode = xMode;
-
- fCornerPts = SkNEW_ARRAY(SkPoint, (fRows + 1) * (fCols + 1));
- fHrzCtrlPts = SkNEW_ARRAY(SkPoint, (fRows + 1) * fCols * 2);
- fVrtCtrlPts = SkNEW_ARRAY(SkPoint, fRows * 2 * (fCols + 1));
+
+ fCornerPts = new SkPoint[(fRows + 1) * (fCols + 1)];
+ fHrzCtrlPts = new SkPoint[(fRows + 1) * fCols * 2];
+ fVrtCtrlPts = new SkPoint[fRows * 2 * (fCols + 1)];
memset(fCornerPts, 0, (fRows + 1) * (fCols + 1) * sizeof(SkPoint));
memset(fHrzCtrlPts, 0, (fRows + 1) * fCols * 2 * sizeof(SkPoint));
memset(fVrtCtrlPts, 0, fRows * 2 * (fCols + 1) * sizeof(SkPoint));
if (fModeFlags & kColors_VertexType) {
- fCornerColors = SkNEW_ARRAY(SkColor, (fRows + 1) * (fCols + 1));
+ fCornerColors = new SkColor[(fRows + 1) * (fCols + 1)];
memset(fCornerColors, 0, (fRows + 1) * (fCols + 1) * sizeof(SkColor));
}
if (fModeFlags & kTexs_VertexType) {
- fTexCoords = SkNEW_ARRAY(SkPoint, (fRows + 1) * (fCols + 1));
+ fTexCoords = new SkPoint[(fRows + 1) * (fCols + 1)];
memset(fTexCoords, 0, (fRows + 1) * (fCols + 1) * sizeof(SkPoint));
}
}
void SkPatchGrid::draw(SkCanvas* canvas, SkPaint& paint) {
- int* maxCols = SkNEW_ARRAY(int, fCols);
- int* maxRows = SkNEW_ARRAY(int, fRows);
+ int* maxCols = new int[fCols];
+ int* maxRows = new int[fRows];
memset(maxCols, 0, fCols * sizeof(int));
memset(maxRows, 0, fRows * sizeof(int));
@@ -184,6 +184,6 @@ void SkPatchGrid::draw(SkCanvas* canvas, SkPaint& paint) {
}
}
}
- SkDELETE_ARRAY(maxCols);
- SkDELETE_ARRAY(maxRows);
+ delete[] maxCols;
+ delete[] maxRows;
}
« no previous file with comments | « src/utils/SkNullCanvas.cpp ('k') | src/utils/SkPatchUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698