Flutter Engine
The Flutter Engine
gamma_mask_filter.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(gamma_mask_filter, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 const char text[] = "Skia";
8
9 SkFont font(fontMgr->matchFamilyStyle(nullptr, {}), 80);
11 paint.setAntiAlias(true);
12
13 canvas->drawString(text, 16, 80, font, paint);
14
16 canvas->drawString(text, 16, 160, font, paint);
17
19 canvas->drawString(text, 16, 240, font, paint);
20}
21} // END FIDDLE
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
Definition: SkCanvas.h:1182
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
Definition: SkCanvas.h:1803
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
Definition: SkFontMgr.cpp:109
Definition: SkFont.h:35
static SkMaskFilter * CreateGamma(SkScalar gamma)
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkFontMgr > fontMgr
Definition: examples.cpp:32
REG_FIDDLE(gamma_mask_filter, 256, 256, false, 0)
std::u16string text
font
Font Metadata and Metrics.