e396455d2d
BUG=skia: R=scroggo@google.com, djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/253833002 git-svn-id: http://skia.googlecode.com/svn/trunk@14411 2bbb7eff-a529-9590-31e7-b0007b416f81
51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
|
|
/*
|
|
* 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 "SkBlurMask.h"
|
|
#include "SkBlurMaskFilter.h"
|
|
#include "SkCanvas.h"
|
|
#include "SkView.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(
|
|
kNormal_SkBlurStyle,
|
|
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128)),
|
|
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);
|