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

Side by Side Diff: samplecode/ClockFaceView.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, 3 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 private: 97 private:
98 SkScalar fRadius; 98 SkScalar fRadius;
99 SkTDArray<SkPoint>* fPts; 99 SkTDArray<SkPoint>* fPts;
100 100
101 typedef Sk2DPathEffect INHERITED; 101 typedef Sk2DPathEffect INHERITED;
102 }; 102 };
103 103
104 SkFlattenable* Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) { 104 SkFlattenable* Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
105 SkMatrix matrix; 105 SkMatrix matrix;
106 buffer.readMatrix(&matrix); 106 buffer.readMatrix(&matrix);
107 return SkNEW_ARGS(Dot2DPathEffect, (buffer.readScalar(), matrix, NULL)); 107 return new Dot2DPathEffect(buffer.readScalar(), matrix, NULL);
108 } 108 }
109 109
110 class InverseFillPE : public SkPathEffect { 110 class InverseFillPE : public SkPathEffect {
111 public: 111 public:
112 InverseFillPE() {} 112 InverseFillPE() {}
113 virtual bool filterPath(SkPath* dst, const SkPath& src, 113 virtual bool filterPath(SkPath* dst, const SkPath& src,
114 SkStrokeRec*, const SkRect*) const override { 114 SkStrokeRec*, const SkRect*) const override {
115 *dst = src; 115 *dst = src;
116 dst->setFillType(SkPath::kInverseWinding_FillType); 116 dst->setFillType(SkPath::kInverseWinding_FillType);
117 return true; 117 return true;
118 } 118 }
119 119
120 #ifndef SK_IGNORE_TO_STRING 120 #ifndef SK_IGNORE_TO_STRING
121 void toString(SkString* str) const override { 121 void toString(SkString* str) const override {
122 str->appendf("InverseFillPE: ()"); 122 str->appendf("InverseFillPE: ()");
123 } 123 }
124 #endif 124 #endif
125 125
126 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(InverseFillPE) 126 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(InverseFillPE)
127 127
128 private: 128 private:
129 typedef SkPathEffect INHERITED; 129 typedef SkPathEffect INHERITED;
130 }; 130 };
131 131
132 SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) { 132 SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) { return new Inve rseFillPE; }
133 return SkNEW(InverseFillPE);
134 }
135 133
136 static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) { 134 static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) {
137 SkMatrix lattice; 135 SkMatrix lattice;
138 SkScalar rad = 3 + SkIntToScalar(4) * (1 - interp); 136 SkScalar rad = 3 + SkIntToScalar(4) * (1 - interp);
139 lattice.setScale(rad*2, rad*2, 0, 0); 137 lattice.setScale(rad*2, rad*2, 0, 0);
140 lattice.postSkew(SK_Scalar1/3, 0, 0, 0); 138 lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
141 return new Dot2DPathEffect(rad, lattice, pts); 139 return new Dot2DPathEffect(rad, lattice, pts);
142 } 140 }
143 141
144 static void r7(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p, SkScalar int erp) { 142 static void r7(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p, SkScalar int erp) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 250 }
253 251
254 private: 252 private:
255 typedef SkView INHERITED; 253 typedef SkView INHERITED;
256 }; 254 };
257 255
258 ////////////////////////////////////////////////////////////////////////////// 256 //////////////////////////////////////////////////////////////////////////////
259 257
260 static SkView* MyFactory() { return new ClockFaceView; } 258 static SkView* MyFactory() { return new ClockFaceView; }
261 static SkViewRegister reg(MyFactory); 259 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « platform_tools/android/apps/visualbench/src/main/jni/main.cpp ('k') | samplecode/GMSampleView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698