59 static const FactoryT gFactories[] = {
97 const auto drawColumn = [&]() {
99 for (
const auto&
f : gFactories) {
101 p.setShader(
f(
image, inner, outer));
103 canvas->drawRect(
rect,
p);
104 canvas->drawRect(
rect, border);
106 canvas->translate(0,
rect.height() * 1.5f);
114 canvas->translate(0,
rect.height() *
std::size(gFactories) * 1.5f);
118 canvas->translate(
rect.width() * 1.5f, 0);
150 canvas->clipRect(imgRect);
151 if (applyPerspToCTM) {
152 canvas->concat(persp);
155 imgShaderPaint.
setShader(std::move(shader));
156 canvas->drawPaint(imgShaderPaint);
159 canvas->translate(10.f +
image->
width(), 0.f);
195 imgRect.
width() / 2.f, kGradColors,
nullptr, 2,
201 imgRect.
width() / 2.f, kGradColors,
nullptr, 2,
208 imgRect.
width() / 2.f, kGradColors,
nullptr, 2,
214 imgRect.
width() / 2.f, kGradColors,
nullptr, 2,
235 auto mshader = mandrill->makeShader(
240 auto eshader = example5->makeShader(
259 center = ictm.mapPoint(center);
265 paint.setShader(shader);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kSrcOver
r = s + (1-sa)*d
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
const SkPixmap & pixmap() const
void drawPaint(const SkPaint &paint)
SkMatrix getTotalMatrix() const
SkImageInfo imageInfo() const
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
const SkImageInfo & imageInfo() const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
bool scalePixels(const SkPixmap &dst, const SkSamplingOptions &, CachingHint cachingHint=kAllow_CachingHint) const
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix RotateDeg(SkScalar deg)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
bool setPolyToPoly(const SkPoint src[], const SkPoint dst[], int count)
bool invert(SkMatrix *inverse) const
void setStyle(Style style)
void setAntiAlias(bool aa)
@ kStroke_Style
set to stroke geometry
void setShader(sk_sp< SkShader > shader)
sk_sp< SkShader > makeWithLocalMatrix(const SkMatrix &) const
bool onAnimate(double nanos) override
void onOnceBeforeDraw() override
void onDraw(SkCanvas *canvas) override
sk_sp< SkShader > fShader
SkISize getISize() override
SkString getName() const override
static sk_sp< SkImage > make_image(SkCanvas *rootCanvas)
DEF_SIMPLE_GM(localmatrixshader_nested, canvas, 450, 1200)
sk_sp< const SkImage > image
sk_sp< SkBlender > blender SkRect rect
SK_API sk_sp< SkShader > Blend(SkBlendMode mode, sk_sp< SkShader > dst, sk_sp< SkShader > src)
SK_API sk_sp< SkShader > Color(SkColor)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static double NanosToSeconds(double nanos)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkISize Make(int32_t w, int32_t h)
SkImageInfo makeWH(int newWidth, int newHeight) const
static SkImageInfo MakeN32Premul(int width, int height)
static SkRect Make(const SkISize &size)
void toQuad(SkPoint quad[4]) const
static SkRect MakeIWH(int w, int h)
constexpr float centerX() const
constexpr float centerY() const
constexpr float width() const
constexpr SkPoint center() const