Index: gm/drawatlas.cpp |
diff --git a/gm/drawatlas.cpp b/gm/drawatlas.cpp |
index a98b176a376674f04d787062635931d2a20d26ed..dd81628378cd9f5afd56dda3ca86f1a283d62e65 100644 |
--- a/gm/drawatlas.cpp |
+++ b/gm/drawatlas.cpp |
@@ -35,8 +35,6 @@ class DrawAtlasGM : public skiagm::GM { |
return surface->makeImageSnapshot(); |
} |
- sk_sp<SkImage> fAtlas; |
- |
public: |
DrawAtlasGM() {} |
@@ -52,9 +50,7 @@ protected: |
void onDraw(SkCanvas* canvas) override { |
const SkRect target = { 50, 50, 80, 90 }; |
- if (nullptr == fAtlas) { |
- fAtlas = MakeAtlas(canvas, target); |
- } |
+ auto atlas = MakeAtlas(canvas, target); |
const struct { |
SkScalar fScale; |
@@ -91,9 +87,9 @@ protected: |
paint.setFilterQuality(kLow_SkFilterQuality); |
paint.setAntiAlias(true); |
- canvas->drawAtlas(fAtlas.get(), xform, tex, N, nullptr, &paint); |
+ canvas->drawAtlas(atlas.get(), xform, tex, N, nullptr, &paint); |
canvas->translate(0, 100); |
- canvas->drawAtlas(fAtlas.get(), xform, tex, colors, N, SkXfermode::kSrcIn_Mode, nullptr, &paint); |
+ canvas->drawAtlas(atlas.get(), xform, tex, colors, N, SkXfermode::kSrcIn_Mode, nullptr, &paint); |
} |
private: |