skia2/samplecode/SampleBigBlur.cpp
Mike Reed 1be1f8d097 hide SkBlurMaskFilter and SkBlurQuality
SK_SUPPORT_LEGACY_BLURMASKFILTER

Bug: skia:
Change-Id: Ic3e27e08e6e3cd2ffc1cd13b044e197bebc96236
Reviewed-on: https://skia-review.googlesource.com/113940
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-03-14 17:27:36 +00:00

48 lines
1.2 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 "SkCanvas.h"
#include "SkMaskFilter.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);
paint.setMaskFilter(SkMaskFilter::MakeBlur(
kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128))));
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);