Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
skbug_8955.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkPaint.h"
#include "include/core/SkTextBlob.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (skbug_8955, canvas, 100, 100)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( skbug_8955  ,
canvas  ,
100  ,
100   
)

Definition at line 15 of file skbug_8955.cpp.

15 {
16 SkPaint p;
18 font.setSize(50);
19 auto blob = SkTextBlob::MakeFromText("+", 1, font);
20
21 // This bug only appeared when drawing the same text blob. We would generate no glyphs on the
22 // first draw, and fail to mark the blob as having any bitmap runs. That would prevent us from
23 // re-generating the blob on the second draw, even though the matrix had been restored.
24 canvas->save();
25 canvas->scale(0, 0);
26 canvas->drawTextBlob(blob, 30, 60, p);
27 canvas->restore();
28 canvas->drawTextBlob(blob, 30, 60, p);
29}
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
SkFont DefaultPortableFont()
font
Font Metadata and Metrics.