90 {
91public:
94 }
96
97 int fRefCnt;
98
99 void ref() {
101 fRefCnt += 1;
102 }
103 void unref() {
105
107 if (0 == --fRefCnt) {
109 delete this;
110 }
111 }
112
113 int* method()
const {
return new int; }
114};
115
117 return sk_make_sp<Effect>();
118}
119
121public:
123
125
128 }
129};
130
133
136 }
138};
141 foo->fValue = 42;
142 return foo;
143}
144
150}
153
158
162
165 } else {
167 }
170 } else {
172 }
173
176
179 } else {
181 }
184 } else {
186 }
187
190
195
200
201
204
205
208
213
215 {
216
223 }
225
226
232
241
243 {
244
255 bar3 = bar1;
257
258 }
260
261
267 baz = nullptr;
271
272 {
276
279
283 }
284
285 {
290 }
291
292
293 {
295 public:
296 foo() : bar(this) {}
297 void reset() { bar.reset(); }
298 private:
300 };
301
302
304 }
305
306
307 {
308 struct StructB;
311 };
312
315 ~StructB() override {}
316 };
317
318
319 StructA*
a =
new StructA;
320 a->b.reset(
new StructB);
322
323
324
325
326
327
329 }
330}
331
332namespace {
333struct FooAbstract :
public SkRefCnt {
334 virtual void f() = 0;
335};
336struct FooConcrete : public FooAbstract {
338};
339}
341
342
343 return sk_make_sp<FooConcrete>();
344}
347}
348
349
350
354
357
359
362
365}
366
370
371 {
374 }
375
378}
#define check(reporter, ref, unref, make, kill)
static sk_sp< Effect > make_effect()
static void reset_counters()
static sk_sp< FooAbstract > make_foo()
static sk_sp< Effect > Create()
sk_sp< T > sk_make_sp(Args &&... args)
sk_sp< T > sk_ref_sp(T *obj)
#define DEF_TEST(name, reporter)
Type::kYUV Type::kRGBA() int(0.7 *637)
void set(sk_sp< Effect > value)
const sk_sp< Effect > & get() const
void reset(T *ptr=nullptr)
EMSCRIPTEN_KEEPALIVE void empty()
static sk_sp< EffectImpl > Create()