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

Unified Diff: samplecode/SampleShip.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 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 | « samplecode/SampleLayers.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleShip.cpp
diff --git a/samplecode/SampleShip.cpp b/samplecode/SampleShip.cpp
index fddf0235baf7836de550e0f313b70f155427f100..daaf5e3551a9513a94803c0dca72e5bb0c4fd13a 100644
--- a/samplecode/SampleShip.cpp
+++ b/samplecode/SampleShip.cpp
@@ -48,10 +48,10 @@ static void draw_atlas_sim(SkCanvas* canvas, SkImage* atlas, const SkRSXform xfo
class DrawShipView : public SampleView {
public:
DrawShipView(const char name[], DrawAtlasProc proc) : fName(name), fProc(proc) {
- fAtlas.reset(GetResourceAsImage("ship.png"));
+ fAtlas = GetResourceAsImage("ship.png");
if (!fAtlas) {
SkDebugf("\nCould not decode file ship.png. Falling back to penguin mode.\n");
- fAtlas.reset(GetResourceAsImage("baby_tux.png"));
+ fAtlas = GetResourceAsImage("baby_tux.png");
if (!fAtlas) {
SkDebugf("\nCould not decode file baby_tux.png. Did you forget"
" to set the resourcePath?\n");
@@ -146,7 +146,7 @@ protected:
fXform[i].fTy += dy;
}
- fProc(canvas, fAtlas, fXform, fTex, nullptr, kGrid*kGrid+1, nullptr, &paint);
+ fProc(canvas, fAtlas.get(), fXform, fTex, nullptr, kGrid*kGrid+1, nullptr, &paint);
paint.setColor(SK_ColorBLACK);
canvas->drawRect(SkRect::MakeXYWH(0, 0, 200, 24), paint);
paint.setColor(SK_ColorWHITE);
@@ -168,7 +168,7 @@ private:
const char* fName;
DrawAtlasProc fProc;
- SkAutoTUnref<SkImage> fAtlas;
+ sk_sp<SkImage> fAtlas;
SkRSXform fXform[kGrid*kGrid+1];
SkRect fTex[kGrid*kGrid+1];
WallTimer fTimer;
« no previous file with comments | « samplecode/SampleLayers.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698