Flutter Engine
The Flutter Engine
Image_Filter_Methods.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(Image_Filter_Methods, 256, 256, false, 0) {
6
7void draw(SkCanvas* canvas) {
10 paint.setStrokeWidth(2);
12 region.op({10, 10, 50, 50}, SkRegion::kUnion_Op);
13 region.op({10, 50, 90, 90}, SkRegion::kUnion_Op);
14 paint.setImageFilter(SkImageFilters::Blur(5.0f, 5.0f, nullptr));
15 canvas->drawRegion(region, paint);
16 paint.setImageFilter(nullptr);
18 canvas->translate(100, 100);
19 canvas->drawRegion(region, paint);
20}
21} // END FIDDLE
REG_FIDDLE(Image_Filter_Methods, 256, 256, false, 0)
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition: SkBlurTypes.h:12
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawRegion(const SkRegion &region, const SkPaint &paint)
Definition: SkCanvas.cpp:1685
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kUnion_Op
target unioned with operand
Definition: SkRegion.h:369
bool op(const SkIRect &rect, Op op)
Definition: SkRegion.h:384
const Paint & paint
Definition: color_source.cc:38
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238