aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
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 /samplecode
parent5015176adf046ef906a2313b6e6b64b72cc84898 (diff)
Style Change: SkNEW->new; SkDELETE->delete
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/ClockFaceView.cpp6
-rw-r--r--samplecode/GMSampleView.cpp2
-rw-r--r--samplecode/OverView.cpp2
-rw-r--r--samplecode/SampleApp.cpp9
-rw-r--r--samplecode/SampleArc.cpp2
-rw-r--r--samplecode/SampleHT.cpp6
-rw-r--r--samplecode/SampleIdentityScale.cpp2
-rw-r--r--samplecode/SampleLua.cpp6
-rw-r--r--samplecode/SamplePdfFileViewer.cpp4
-rw-r--r--samplecode/SamplePictFile.cpp2
-rw-r--r--samplecode/SampleSubpixelTranslate.cpp2
11 files changed, 20 insertions, 23 deletions
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index 4717c30d9e..9a1f8f97fb 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -104,7 +104,7 @@ private:
SkFlattenable* Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
SkMatrix matrix;
buffer.readMatrix(&matrix);
- return SkNEW_ARGS(Dot2DPathEffect, (buffer.readScalar(), matrix, NULL));
+ return new Dot2DPathEffect(buffer.readScalar(), matrix, NULL);
}
class InverseFillPE : public SkPathEffect {
@@ -129,9 +129,7 @@ private:
typedef SkPathEffect INHERITED;
};
-SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) {
- return SkNEW(InverseFillPE);
-}
+SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) { return new InverseFillPE; }
static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) {
SkMatrix lattice;
diff --git a/samplecode/GMSampleView.cpp b/samplecode/GMSampleView.cpp
index e74612b248..24c94cb585 100644
--- a/samplecode/GMSampleView.cpp
+++ b/samplecode/GMSampleView.cpp
@@ -14,7 +14,7 @@ GMSampleView::~GMSampleView() {
}
SkEvent* GMSampleView::NewShowSizeEvt(bool doShowSize) {
- SkEvent* evt = SkNEW_ARGS(SkEvent, ("GMSampleView::showSize"));
+ SkEvent* evt = new SkEvent("GMSampleView::showSize");
evt->setFast32(doShowSize);
return evt;
}
diff --git a/samplecode/OverView.cpp b/samplecode/OverView.cpp
index bdb8ddd657..9e229ff947 100644
--- a/samplecode/OverView.cpp
+++ b/samplecode/OverView.cpp
@@ -119,7 +119,7 @@ private:
};
SkView* create_overview(int count, const SkViewFactory* factories[]) {
- return SkNEW_ARGS(OverView, (count, factories));
+ return new OverView(count, factories);
}
bool is_overview(SkView* view) {
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 1d4bd1e705..d2f10b3365 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1275,9 +1275,8 @@ SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) {
fSubpixelState != SkOSMenu::kMixedState ||
fHintingState > 0 ||
fFilterQualityIndex > 0) {
-
- canvas = SkNEW_ARGS(FlagsFilterCanvas, (canvas, fLCDState, fAAState, fSubpixelState,
- fHintingState, fFilterQualityIndex));
+ canvas = new FlagsFilterCanvas(canvas, fLCDState, fAAState, fSubpixelState, fHintingState,
+ fFilterQualityIndex);
fFlagsFilterCanvas.reset(canvas);
}
@@ -1671,10 +1670,10 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
}
break;
case 'B':
- post_event_to_sink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), curr_view(this));
+ post_event_to_sink(new SkEvent("PictFileView::toggleBBox"), curr_view(this));
// Cannot call updateTitle() synchronously, because the toggleBBox event is still in
// the queue.
- post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)), this);
+ post_event_to_sink(new SkEvent(gUpdateWindowTitleEvtName), this);
this->inval(NULL);
break;
case 'D':
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index 842e7a0ef9..90fbb7863c 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -92,7 +92,7 @@ public:
fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200));
fRect.offset(SkIntToScalar(20), SkIntToScalar(20));
- fAnimatingDrawable = SkNEW_ARGS(MyDrawable, (fRect));
+ fAnimatingDrawable = new MyDrawable(fRect);
SkPictureRecorder recorder;
this->drawRoot(recorder.beginRecording(SkRect::MakeWH(800, 500)));
diff --git a/samplecode/SampleHT.cpp b/samplecode/SampleHT.cpp
index 20648ccdac..7b452505a4 100644
--- a/samplecode/SampleHT.cpp
+++ b/samplecode/SampleHT.cpp
@@ -61,8 +61,8 @@ public:
void spawnAnimation(SkMSec now) {
this->setTime(now);
- SkDELETE(fInterp);
- fInterp = SkNEW_ARGS(SkInterpolator, (5, 3));
+ delete fInterp;
+ fInterp = new SkInterpolator(5, 3);
SkScalar values[5];
color_to_floats(fColor, values); values[4] = 0;
fInterp->setKeyFrame(0, now, values);
@@ -101,7 +101,7 @@ public:
switch (res) {
case SkInterpolator::kFreezeEnd_Result:
- SkDELETE(fInterp);
+ delete fInterp;
fInterp = NULL;
break;
default:
diff --git a/samplecode/SampleIdentityScale.cpp b/samplecode/SampleIdentityScale.cpp
index 3302d27ed8..7a329dedd0 100644
--- a/samplecode/SampleIdentityScale.cpp
+++ b/samplecode/SampleIdentityScale.cpp
@@ -33,7 +33,7 @@ public:
if (codec) {
stream.rewind();
codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
- SkDELETE(codec);
+ delete codec;
} else {
fBM.allocN32Pixels(1, 1);
*(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index 8865f1a153..5fc9ab0c78 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -41,9 +41,7 @@ class LuaView : public SampleView {
public:
LuaView() : fLua(NULL) {}
- virtual ~LuaView() {
- SkDELETE(fLua);
- }
+ virtual ~LuaView() { delete fLua; }
void setImageFilename(lua_State* L) {
SkString str = GetResourcePath("mandrill_256.png");
@@ -59,7 +57,7 @@ public:
lua_State* ensureLua() {
if (NULL == fLua) {
- fLua = SkNEW(SkLua);
+ fLua = new SkLua;
SkString str = GetResourcePath(LUA_FILENAME);
SkData* data = SkData::NewFromFileName(str.c_str());
diff --git a/samplecode/SamplePdfFileViewer.cpp b/samplecode/SamplePdfFileViewer.cpp
index 6faea55b17..747f729d3e 100644
--- a/samplecode/SamplePdfFileViewer.cpp
+++ b/samplecode/SamplePdfFileViewer.cpp
@@ -5,6 +5,8 @@
* found in the LICENSE file.
*/
+#include "SkTypes.h"
+
#ifdef SAMPLE_PDF_FILE_VIEWER
#include "SampleCode.h"
@@ -40,7 +42,7 @@ private:
return NULL;
}
- SkPicture* pic = SkNEW(SkPicture);
+ SkPicture* pic = new SkPicture;
SkCanvas* canvas = pic->beginRecording((int) renderer->MediaBox(0).width(),
(int) renderer->MediaBox(0).height());
renderer->renderPage(0, canvas, renderer->MediaBox(0));
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp
index c0973a5042..dd315f8a14 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -194,7 +194,7 @@ private:
// no bbox playback necessary
return pic.detach();
case kRTree_BBoxType:
- factory.reset(SkNEW(SkRTreeFactory));
+ factory.reset(new SkRTreeFactory);
break;
default:
SkASSERT(false);
diff --git a/samplecode/SampleSubpixelTranslate.cpp b/samplecode/SampleSubpixelTranslate.cpp
index 02993632cf..0f7639efa2 100644
--- a/samplecode/SampleSubpixelTranslate.cpp
+++ b/samplecode/SampleSubpixelTranslate.cpp
@@ -35,7 +35,7 @@ public:
if (codec) {
stream.rewind();
codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
- SkDELETE(codec);
+ delete codec;
} else {
fBM.allocN32Pixels(1, 1);
*(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad