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

Unified Diff: samplecode/SampleTiling.cpp

Issue 232913003: Make sure SkDrawLooper objects can only be allocated on the heap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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/SampleTextOnPath.cpp ('k') | samplecode/SampleUnpremul.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleTiling.cpp
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index faa8d801443720ed0f47d936dbc4d4195a20f30d..7d109fd50f0b2499d63ace3937e2ebaab0ee7791 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -62,13 +62,13 @@ static const int gWidth = 32;
static const int gHeight = 32;
class TilingView : public SampleView {
- SkAutoTUnref<SkPicture> fTextPicture;
- SkBlurDrawLooper fLooper;
+ SkAutoTUnref<SkPicture> fTextPicture;
+ SkAutoTUnref<SkBlurDrawLooper> fLooper;
public:
TilingView()
- : fLooper(0x88000000,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(1)),
- SkIntToScalar(2), SkIntToScalar(2)) {
+ : fLooper(SkBlurDrawLooper::Create(0x88000000,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(1)),
+ SkIntToScalar(2), SkIntToScalar(2))) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) {
makebm(&fTexture[i], gColorTypes[i], gWidth, gHeight);
}
@@ -116,7 +116,7 @@ protected:
SkString str;
p.setAntiAlias(true);
p.setDither(true);
- p.setLooper(&fLooper);
+ p.setLooper(fLooper);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
p.setTextAlign(SkPaint::kCenter_Align);
@@ -150,7 +150,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- p.setLooper(&fLooper);
+ p.setLooper(fLooper);
str.printf("%s, %s", gConfigNames[i], gFilterNames[j]);
textCanvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p);
}
« no previous file with comments | « samplecode/SampleTextOnPath.cpp ('k') | samplecode/SampleUnpremul.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698