| Index: gm/drawatlascolor.cpp
|
| diff --git a/gm/drawatlascolor.cpp b/gm/drawatlascolor.cpp
|
| index b5dba99640bd1a5bed9f732ec484258a1085e7fa..d7b973c3fdb46f8eafc7bb1536f6545724863da5 100644
|
| --- a/gm/drawatlascolor.cpp
|
| +++ b/gm/drawatlascolor.cpp
|
| @@ -72,9 +72,7 @@ protected:
|
| void onDraw(SkCanvas* canvas) override {
|
| const SkRect target = SkRect::MakeWH(SkIntToScalar(kAtlasSize), SkIntToScalar(kAtlasSize));
|
|
|
| - if (nullptr == fAtlas) {
|
| - fAtlas = make_atlas(canvas, kAtlasSize);
|
| - }
|
| + auto atlas = make_atlas(canvas, kAtlasSize);
|
|
|
| const struct {
|
| SkXfermode::Mode fMode;
|
| @@ -151,11 +149,11 @@ protected:
|
| canvas->translate(SkIntToScalar(i*(target.height()+kPad)),
|
| SkIntToScalar(kTextPad+kPad));
|
| // w/o a paint
|
| - canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors,
|
| + canvas->drawAtlas(atlas.get(), xforms, rects, quadColors, numColors,
|
| gModes[i].fMode, nullptr, nullptr);
|
| canvas->translate(0.0f, numColors*(target.height()+kPad));
|
| // w a paint
|
| - canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors,
|
| + canvas->drawAtlas(atlas.get(), xforms, rects, quadColors, numColors,
|
| gModes[i].fMode, nullptr, &paint);
|
| canvas->restore();
|
| }
|
| @@ -168,9 +166,6 @@ private:
|
| static constexpr int kPad = 2;
|
| static constexpr int kTextPad = 8;
|
|
|
| -
|
| - sk_sp<SkImage> fAtlas;
|
| -
|
| typedef GM INHERITED;
|
| };
|
| DEF_GM( return new DrawAtlasColorsGM; )
|
|
|