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

Unified Diff: gm/drawatlas.cpp

Issue 2381893004: Remove caching from the draw-atlas GMs. Fixes bugs cycling backends. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/drawatlascolor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | gm/drawatlascolor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698