Flutter Engine
The Flutter Engine
third_party
skia
docs
examples
skpaint_blur_mask_filter.cpp
Go to the documentation of this file.
1
// Copyright 2020 Google LLC.
2
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
#include "
tools/fiddle/examples.h
"
4
REG_FIDDLE
(skpaint_blur_mask_filter, 256, 256,
false
, 0) {
5
void
draw
(
SkCanvas
* canvas) {
6
canvas->
drawColor
(
SkColorSetARGB
(0xFF, 0xFF, 0xFF, 0xFF));
7
SkPaint
paint
;
8
paint
.setMaskFilter(
SkMaskFilter::MakeBlur
(
kNormal_SkBlurStyle
, 5.0f));
9
sk_sp<SkTextBlob>
blob =
SkTextBlob::MakeFromString
(
"Skia"
,
SkFont
(
nullptr
, 120));
10
canvas->
drawTextBlob
(blob.
get
(), 0, 160,
paint
);
11
}
12
}
// END FIDDLE
kNormal_SkBlurStyle
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition:
SkBlurTypes.h:12
SkColorSetARGB
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition:
SkColor.h:49
draw
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition:
aaclip.cpp:27
SkCanvas
Definition:
SkCanvas.h:106
SkCanvas::drawColor
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
Definition:
SkCanvas.h:1182
SkCanvas::drawTextBlob
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
Definition:
SkCanvas.cpp:2484
SkFont
Definition:
SkFont.h:35
SkMaskFilter::MakeBlur
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
Definition:
SkBlurMaskFilterImpl.cpp:535
SkPaint
Definition:
SkPaint.h:44
SkTextBlob::MakeFromString
static sk_sp< SkTextBlob > MakeFromString(const char *string, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
Definition:
SkTextBlob.h:115
sk_sp< SkTextBlob >
sk_sp::get
T * get() const
Definition:
SkRefCnt.h:303
paint
const Paint & paint
Definition:
color_source.cc:38
examples.h
REG_FIDDLE
REG_FIDDLE(skpaint_blur_mask_filter, 256, 256, false, 0)
Definition:
skpaint_blur_mask_filter.cpp:4
Generated on Sun Jun 23 2024 21:55:56 for Flutter Engine by
1.9.4