aboutsummaryrefslogtreecommitdiffstats
path: root/samplecode/SampleBigBlur.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2012-01-18 08:56:56 -0500
committerDerek Sollenberger <derek@android.com>2012-02-06 14:14:40 -0500
commit1cab2921ab279367f8206cdadc9259d12e603548 (patch)
tree2852f9dc2481f639122e18fc7831ae6ca43d6d5a /samplecode/SampleBigBlur.cpp
parentd7176fd5571bc9878d3cdac8696eaa35ec170d9d (diff)
downloadexternal_skia-1cab2921ab279367f8206cdadc9259d12e603548.zip
external_skia-1cab2921ab279367f8206cdadc9259d12e603548.tar.gz
external_skia-1cab2921ab279367f8206cdadc9259d12e603548.tar.bz2
Skia merge (revision 3022)
This CL has companion changes to account for API updates in... (1) frameworks/base (2) external/webkit Change-Id: Ibb989e76e8bd24313849f9631dbef42cdef9eb7d
Diffstat (limited to 'samplecode/SampleBigBlur.cpp')
-rw-r--r--samplecode/SampleBigBlur.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/samplecode/SampleBigBlur.cpp b/samplecode/SampleBigBlur.cpp
new file mode 100644
index 0000000..f5e632c
--- /dev/null
+++ b/samplecode/SampleBigBlur.cpp
@@ -0,0 +1,50 @@
+
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#include "SampleCode.h"
+#include "SkBlurMaskFilter.h"
+#include "SkView.h"
+#include "SkCanvas.h"
+
+class BigBlurView : public SampleView {
+public:
+ BigBlurView() {
+ }
+
+protected:
+ // overrides from SkEventSink
+ virtual bool onQuery(SkEvent* evt) {
+ if (SampleCode::TitleQ(*evt)) {
+ SampleCode::TitleR(evt, "BigBlur");
+ return true;
+ }
+ return this->INHERITED::onQuery(evt);
+ }
+
+ virtual void onDrawContent(SkCanvas* canvas) {
+ SkPaint paint;
+ canvas->save();
+ paint.setColor(SK_ColorBLUE);
+ SkMaskFilter* mf = SkBlurMaskFilter::Create(
+ 128,
+ SkBlurMaskFilter::kNormal_BlurStyle,
+ SkBlurMaskFilter::kHighQuality_BlurFlag);
+ paint.setMaskFilter(mf)->unref();
+ canvas->translate(200, 200);
+ canvas->drawCircle(100, 100, 200, paint);
+ canvas->restore();
+ }
+
+private:
+ typedef SkView INHERITED;
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+static SkView* MyFactory() { return new BigBlurView; }
+static SkViewRegister reg(MyFactory);
+