239 {
240 enum class DrawStrategy {
241 kDirect,
242 kPictureShader,
243 };
244
246
248 switch(strategy) {
249 case DrawStrategy::kDirect: {
252 break; }
253 case DrawStrategy::kPictureShader: {
258 break; }
259 }
260 };
261
266 font.setTypeface(typeface);
269
277 }();
278
280 m.preScale(2.f, 2.f);
285
288 for (auto strategy : { DrawStrategy::kDirect,
289 DrawStrategy::kPictureShader }) {
291
296 canvas->
drawRect({-1, -1, 101, 101}, outline);
297
300
303
305 }
306}
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kNormal
glyph outlines modified to improve constrast
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
void concat(const SkMatrix &matrix)
void drawPicture(const SkPicture *picture)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
static SkM44 Rotate(SkV3 axis, SkScalar radians)
SkM44 & preConcat(const SkM44 &m)
static SkM44 Perspective(float near, float far, float angle)
SkM44 & preTranslate(SkScalar x, SkScalar y, SkScalar z=0)
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
void setStrokeWidth(SkScalar width)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, SkFilterMode mode, const SkMatrix *localMatrix, const SkRect *tileRect) const
static sk_sp< SkTextBlob > MakeFromString(const char *string, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
Optional< SkRect > bounds
sk_sp< const SkPicture > picture
drawPicture(r.picture.get(), &r.matrix, r.paint)) DRAW(DrawTextBlob
font
Font Metadata and Metrics.