Flutter Engine
The Flutter Engine
Classes | Macros | Functions
clip_error.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBlurTypes.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkFont.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.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.

Classes

class  ClipErrorGM
 

Macros

#define WIDTH   800
 
#define HEIGHT   800
 

Functions

static void draw_text (SkCanvas *canvas, sk_sp< SkTextBlob > blob, const SkPaint &paint, const SkPaint &blurPaint, const SkPaint &clearPaint)
 

Macro Definition Documentation

◆ HEIGHT

#define HEIGHT   800

Definition at line 29 of file clip_error.cpp.

◆ WIDTH

#define WIDTH   800

Definition at line 28 of file clip_error.cpp.

Function Documentation

◆ draw_text()

static void draw_text ( SkCanvas canvas,
sk_sp< SkTextBlob blob,
const SkPaint paint,
const SkPaint blurPaint,
const SkPaint clearPaint 
)
static

Definition at line 31 of file clip_error.cpp.

33 {
34 canvas->save();
35 canvas->clipRect(SkRect::MakeLTRB(0, 0, 1081, 665));
36 canvas->drawRect(SkRect::MakeLTRB(0, 0, 1081, 665), clearPaint);
37 // draw as blurred to push glyph to be too large for atlas
38 canvas->drawTextBlob(blob, 0, 256, blurPaint);
39 canvas->drawTextBlob(blob, 0, 477, paint);
40 canvas->restore();
41}
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
int save()
Definition: SkCanvas.cpp:447
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
Definition: SkCanvas.cpp:2484
const Paint & paint
Definition: color_source.cc:38
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646