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

Unified Diff: gm/tilemodes_scaled.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 | « gm/shadows.cpp ('k') | include/effects/SkBlurDrawLooper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tilemodes_scaled.cpp
diff --git a/gm/tilemodes_scaled.cpp b/gm/tilemodes_scaled.cpp
index bbb86a70fd12f14541115e3ca0fbe20596ae7255..e9c6c9950ad631d6d0912f1501b49c6675d53223 100644
--- a/gm/tilemodes_scaled.cpp
+++ b/gm/tilemodes_scaled.cpp
@@ -13,6 +13,7 @@
#include "SkColorPriv.h"
#include "SkColorFilter.h"
#include "SkTypeface.h"
+#include "SkBlurMask.h"
// effects
#include "SkGradientShader.h"
@@ -55,10 +56,12 @@ static const SkColorType gColorTypes[] = {
};
class ScaledTilingGM : public skiagm::GM {
- SkBlurDrawLooper fLooper;
+ SkAutoTUnref<SkBlurDrawLooper> fLooper;
public:
ScaledTilingGM(bool powerOfTwoSize)
- : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), 0x88000000)
+ : fLooper(SkBlurDrawLooper::Create(0x88000000,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(1)),
+ SkIntToScalar(2), SkIntToScalar(2)))
, fPowerOfTwoSize(powerOfTwoSize) {
}
@@ -117,7 +120,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);
@@ -157,7 +160,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- p.setLooper(&fLooper);
+ p.setLooper(fLooper);
str.printf("%s, %s", gColorTypeNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), scale*x, scale*(y + r.height() * 2 / 3), p);
}
« no previous file with comments | « gm/shadows.cpp ('k') | include/effects/SkBlurDrawLooper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698