aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleAtlas.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-17 10:51:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-17 10:51:11 -0700
commit9ce9d6772df650ceb0511f275e1a83dffa78ff72 (patch)
tree1c0d54a75945863947490ec45cccf7c30eaa2ca4 /samplecode/SampleAtlas.cpp
parent42d95a0afb26560586232961445ba36de387ca37 (diff)
update callsites for Make image factories
not forced yet, as we still have the build-guard. waiting on chrome CL BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810813003 TBR= Review URL: https://codereview.chromium.org/1810813003
Diffstat (limited to 'samplecode/SampleAtlas.cpp')
-rw-r--r--samplecode/SampleAtlas.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/samplecode/SampleAtlas.cpp b/samplecode/SampleAtlas.cpp
index a7d5cbe9fd..1075f4d12e 100644
--- a/samplecode/SampleAtlas.cpp
+++ b/samplecode/SampleAtlas.cpp
@@ -39,7 +39,7 @@ static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xfo
}
}
-static SkImage* make_atlas(int atlasSize, int cellSize) {
+static sk_sp<SkImage> make_atlas(int atlasSize, int cellSize) {
SkImageInfo info = SkImageInfo::MakeN32Premul(atlasSize, atlasSize);
SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
SkCanvas* canvas = surface->getCanvas();
@@ -62,7 +62,7 @@ static SkImage* make_atlas(int atlasSize, int cellSize) {
i += 1;
}
}
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
class DrawAtlasDrawable : public SkDrawable {
@@ -131,7 +131,7 @@ class DrawAtlasDrawable : public SkDrawable {
N = 256,
};
- SkAutoTUnref<SkImage> fAtlas;
+ sk_sp<SkImage> fAtlas;
Rec fRec[N];
SkRect fTex[N];
SkRect fBounds;
@@ -142,7 +142,7 @@ public:
: fProc(proc), fBounds(r), fUseColors(false)
{
SkRandom rand;
- fAtlas.reset(make_atlas(kAtlasSize, kCellSize));
+ fAtlas = make_atlas(kAtlasSize, kCellSize);
const SkScalar kMaxSpeed = 5;
const SkScalar cell = SkIntToScalar(kCellSize);
int i = 0;
@@ -187,7 +187,7 @@ protected:
const SkRect cull = this->getBounds();
const SkColor* colorsPtr = fUseColors ? colors : nullptr;
- fProc(canvas, fAtlas, xform, fTex, colorsPtr, N, &cull, &paint);
+ fProc(canvas, fAtlas.get(), xform, fTex, colorsPtr, N, &cull, &paint);
}
SkRect onGetBounds() override {