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

Unified Diff: samplecode/SampleLayers.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/SampleFilterQuality.cpp ('k') | samplecode/SampleShip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleLayers.cpp
diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp
index beb7e4ae1a736b08cc75e70d4582c2cc859396d7..118356872a7d478b6efd1c49d95506580de65e6d 100644
--- a/samplecode/SampleLayers.cpp
+++ b/samplecode/SampleLayers.cpp
@@ -244,13 +244,13 @@ DEF_SAMPLE( return new LayersView; )
class BackdropView : public SampleView {
SkPoint fCenter;
SkScalar fAngle;
- SkAutoTUnref<SkImage> fImage;
+ sk_sp<SkImage> fImage;
SkAutoTUnref<SkImageFilter> fFilter;
public:
BackdropView() {
fCenter.set(200, 150);
fAngle = 0;
- fImage.reset(GetResourceAsImage("mandrill_512.png"));
+ fImage = GetResourceAsImage("mandrill_512.png");
fFilter.reset(SkDilateImageFilter::Create(8, 8));
}
@@ -265,7 +265,7 @@ protected:
}
void onDrawContent(SkCanvas* canvas) override {
- canvas->drawImage(fImage, 0, 0, nullptr);
+ canvas->drawImage(fImage.get(), 0, 0, nullptr);
const SkScalar w = 250;
const SkScalar h = 150;
« no previous file with comments | « samplecode/SampleFilterQuality.cpp ('k') | samplecode/SampleShip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698