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

Unified Diff: gm/drawatlascolor.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 | « gm/drawatlas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; )
« no previous file with comments | « gm/drawatlas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698