aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleStrokePath.cpp
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-09-18 20:57:05 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-09-18 20:57:05 +0000
commitda449a38a2ac06f47f504cef7897afe322981dae (patch)
tree8c1d0b1f40b443dcd1b592076a97be683e271041 /samplecode/SampleStrokePath.cpp
parent0e3c664250f561ec9f7107b92136517a72d03afd (diff)
update with tests for blur
git-svn-id: http://skia.googlecode.com/svn/trunk@357 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleStrokePath.cpp')
-rw-r--r--samplecode/SampleStrokePath.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/samplecode/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp
index ec0a970e94..5de6b72602 100644
--- a/samplecode/SampleStrokePath.cpp
+++ b/samplecode/SampleStrokePath.cpp
@@ -5,6 +5,8 @@
#include "SkRandom.h"
#include "SkView.h"
+#include "SkBlurMaskFilter.h"
+
static void scale_to_width(SkPath* path, SkScalar dstWidth) {
const SkRect& bounds = path->getBounds();
SkScalar scale = dstWidth / bounds.width();
@@ -83,6 +85,36 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
+
+ if (true) {
+ canvas->drawColor(SK_ColorBLACK);
+
+ paint.setTextSize(24);
+ paint.setColor(SK_ColorWHITE);
+ canvas->translate(10, 30);
+
+ static const SkBlurMaskFilter::BlurStyle gStyle[] = {
+ SkBlurMaskFilter::kNormal_BlurStyle,
+ SkBlurMaskFilter::kInner_BlurStyle,
+ SkBlurMaskFilter::kOuter_BlurStyle,
+ SkBlurMaskFilter::kSolid_BlurStyle,
+ };
+ for (int x = 0; x < 5; x++) {
+ SkMaskFilter* mf;
+ SkScalar radius = 4;
+ for (int y = 0; y < 10; y++) {
+ if (x) {
+ mf = SkBlurMaskFilter::Create(radius, gStyle[x - 1]);
+ paint.setMaskFilter(mf)->unref();
+ }
+ canvas->drawText("Title Bar", 9, x*100, y*30, paint);
+ radius *= 0.75f;
+ }
+
+ }
+ return;
+ }
+
paint.setColor(SK_ColorBLUE);
#if 1