| Index: samplecode/SampleCamera.cpp
|
| diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp
|
| index ed6cc528293536f534555053dd45c8da3d87b907..85b854eced17c69c2673b2349a40a227193c756f 100644
|
| --- a/samplecode/SampleCamera.cpp
|
| +++ b/samplecode/SampleCamera.cpp
|
| @@ -20,7 +20,7 @@
|
| #include "SkRandom.h"
|
|
|
| class CameraView : public SampleView {
|
| - SkTDArray<SkShader*> fShaders;
|
| + SkTArray<sk_sp<SkShader>> fShaders;
|
| int fShaderIndex;
|
| bool fFrontFace;
|
| public:
|
| @@ -39,11 +39,10 @@ public:
|
| SkMatrix matrix;
|
| matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
|
|
|
| - SkShader* s = SkShader::MakeBitmapShader(bm,
|
| + fShaders.push_back(SkShader::MakeBitmapShader(bm,
|
| SkShader::kClamp_TileMode,
|
| SkShader::kClamp_TileMode,
|
| - &matrix).release();
|
| - *fShaders.append() = s;
|
| + &matrix));
|
| } else {
|
| break;
|
| }
|
| @@ -51,10 +50,6 @@ public:
|
| this->setBGColor(0xFFDDDDDD);
|
| }
|
|
|
| - virtual ~CameraView() {
|
| - fShaders.unrefAll();
|
| - }
|
| -
|
| protected:
|
| // overrides from SkEventSink
|
| bool onQuery(SkEvent* evt) override {
|
|
|