You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
/*
|
|
* 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 "Sample.h"
|
|
#include "SkBlurMask.h"
|
|
#include "SkCanvas.h"
|
|
#include "SkMaskFilter.h"
|
|
|
|
class BigBlurView : public Sample {
|
|
public:
|
|
BigBlurView() {
|
|
}
|
|
|
|
protected:
|
|
virtual bool onQuery(Sample::Event* evt) {
|
|
if (Sample::TitleQ(*evt)) {
|
|
Sample::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 Sample INHERITED;
|
|
};
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
DEF_SAMPLE( return new BigBlurView(); )
|