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

Unified Diff: gm/samplerstress.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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 | « gm/roundrects.cpp ('k') | gm/shaderbounds.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/samplerstress.cpp
diff --git a/gm/samplerstress.cpp b/gm/samplerstress.cpp
index 4bec6784a891ed11830270d322dd03201bd1b7cb..f317cf9103d0ac6b9abcb44a59f0e00fd5a50db6 100644
--- a/gm/samplerstress.cpp
+++ b/gm/samplerstress.cpp
@@ -21,13 +21,9 @@ class SamplerStressGM : public GM {
public:
SamplerStressGM()
: fTextureCreated(false)
- , fShader(nullptr)
, fMaskFilter(nullptr) {
}
- virtual ~SamplerStressGM() {
- }
-
protected:
SkString onShortName() override {
@@ -69,15 +65,14 @@ protected:
}
void createShader() {
- if (fShader.get()) {
+ if (fShader) {
return;
}
createTexture();
- fShader.reset(SkShader::CreateBitmapShader(fTexture,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode));
+ fShader = SkShader::MakeBitmapShader(fTexture, SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode);
}
void createMaskFilter() {
@@ -140,9 +135,9 @@ protected:
}
private:
- SkBitmap fTexture;
- bool fTextureCreated;
- SkAutoTUnref<SkShader> fShader;
+ SkBitmap fTexture;
+ bool fTextureCreated;
+ sk_sp<SkShader> fShader;
SkAutoTUnref<SkMaskFilter> fMaskFilter;
typedef GM INHERITED;
« no previous file with comments | « gm/roundrects.cpp ('k') | gm/shaderbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698