Flutter Engine
The Flutter Engine
Functions
largeglyphblur.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBlurTypes.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkFontTypes.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTextBlob.h"
#include "include/core/SkTypeface.h"
#include "src/core/SkBlurMask.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"
#include <string.h>

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (largeglyphblur, canvas, 1920, 600)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( largeglyphblur  ,
canvas  ,
1920  ,
600   
)

Definition at line 26 of file largeglyphblur.cpp.

26 {
27 const char text[] = "Hamburgefons";
28
30 auto blob = SkTextBlob::MakeFromText(text, strlen(text), font);
31
32 // setup up maskfilter
34
35 SkPaint blurPaint;
37
38 canvas->drawTextBlob(blob, 10, 200, blurPaint);
39 canvas->drawTextBlob(blob, 10, 200, SkPaint());
40
41 size_t len = strlen(text);
42 canvas->drawSimpleText(text, len, SkTextEncoding::kUTF8, 10, 500, font, blurPaint);
43 canvas->drawSimpleText(text, len, SkTextEncoding::kUTF8, 10, 500, font, SkPaint());
44}
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition: SkBlurTypes.h:12
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define SkIntToScalar(x)
Definition: SkScalar.h:57
static SkScalar SK_SPI ConvertRadiusToSigma(SkScalar radius)
Definition: SkBlurMask.cpp:39
Definition: SkFont.h:35
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
Definition: SkTextBlob.cpp:788
float SkScalar
Definition: extension.cpp:12
std::u16string text
sk_sp< SkTypeface > DefaultPortableTypeface()
font
Font Metadata and Metrics.