Flutter Engine
The Flutter Engine
Functions
skbug_237_drawImage_with_blur.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (skbug_237_drawImage_with_blur, 256, 256, false, 6)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( skbug_237_drawImage_with_blur  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file skbug_237_drawImage_with_blur.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, 5.0f, false));
8 canvas->clear(0xFF88FF88);
9 canvas->scale(4, 4);
10 auto subset = image->makeSubset(nullptr, {16, 16, 48, 48});
11 canvas->drawImage(subset, 16, 16, SkSamplingOptions(), &paint);
12}
13} // END FIDDLE
@ 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 clear(SkColor color)
Definition: SkCanvas.h:1199
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
virtual sk_sp< SkImage > makeSubset(GrDirectContext *direct, const SkIRect &subset) const =0
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
const Paint & paint
Definition: color_source.cc:38
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SkSamplingOptions(SkFilterMode::kLinear))