aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleTiling.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-15 15:48:36 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-15 15:48:36 +0000
commit73cb15351f33459e0c861a96135c634dec77ef9d (patch)
treecf521a48286c5cd88354056e65a933cc63f8fbe1 /samplecode/SampleTiling.cpp
parentbeb8b3a4da83ce30e313e72ae0e444870acecb7e (diff)
Make sure SkDrawLooper objects can only be allocated on the heap.
Make constructors of SkLayerDrawLooper and SkBlurDrawLooper non-public. Remove addLayer* methods from SkLayerDrawLooper. SkLayerDrawLooper::Builder is used to create new objects. Provide factory method for creating SkBlurDrawLooper. BUG=2141 R=scroggo@google.com, reed@google.com, djsollen@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/232913003 git-svn-id: http://skia.googlecode.com/svn/trunk@14200 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleTiling.cpp')
-rw-r--r--samplecode/SampleTiling.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index faa8d80144..7d109fd50f 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);
}