48 return surface->makeImageSnapshot();
64 return surface->makeImageSnapshot();
71 paint.setAntiAlias(
true);
72 for (
int i = 0;
i < 4; ++
i) {
84 SkISize getISize()
override {
return {640, 572}; }
86 void onDraw(
SkCanvas* canvas)
override {
87 constexpr int WW = 100,
104 0, one/2, one/2, one/4,
105 0, one/2, one/2, -one/4,
106 one/4, one/2, one/2, 0,
107 -one/4, one/2, one/2, 0,
126 dstFilter, srcFilter,
rect));
143 for (
int i = 0;
i < 2;
i++) {
144 const bool enforcePMColor = (
i == 0);
157 std::move(bg), dstFilter,
rect));
164 SkString str(enforcePMColor ?
"enforcePM" :
"no enforcePM");
172 using INHERITED =
GM;
178#include
"include/effects/SkBlenders.h"
181 float fK1, fK2, fK3, fK4;
188 static constexpr int W = 200;
189 static constexpr int H = 200;
191 SkISize getISize()
override {
return {(
W + 30) * 2, (
H + 30) * 4}; }
193 void onOnceBeforeDraw()
override {
195 static constexpr char kShader[] = R
"(
196 uniform shader srcImage;
197 uniform shader dstImage;
198 uniform blender arithBlend;
199 half4 main(float2 xy) {
200 return arithBlend.eval(srcImage.eval(xy), dstImage.eval(xy));
205 fRuntimeEffect = effect;
221 bool onAnimate(
double nanos)
override {
222 double theta = nanos * 1
e-6 * 0.001;
223 fK1 = sin(theta + 0) * 0.25;
224 fK2 = cos(theta + 1) * 0.25;
225 fK3 = sin(theta + 2) * 0.25;
230 void onDraw(
SkCanvas* canvas)
override {
281 using INHERITED = GM;
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
static sk_sp< SkImage > make_src(int w, int h)
static sk_sp< SkImage > make_dst(int w, int h)
static void show_k_text(SkCanvas *canvas, SkScalar x, SkScalar y, const SkScalar k[])
static sk_sp< SkBlender > Arithmetic(float k1, float k2, float k3, float k4, bool enforcePremul)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawPaint(const SkPaint &paint)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
@ kAntiAlias
may have transparent pixels on glyph edges
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkImageFilter > Arithmetic(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4, bool enforcePMColor, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
static sk_sp< SkImageFilter > Blend(SkBlendMode mode, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground=nullptr, const CropRect &cropRect={})
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
void setShader(sk_sp< SkShader > shader)
void setBlender(sk_sp< SkBlender > blender)
sk_sp< SkShader > makeShader(sk_sp< const SkData > uniforms, sk_sp< SkShader > children[], size_t childCount, const SkMatrix *localMatrix=nullptr) const
static Result MakeForShader(SkString sksl, const Options &)
void appendScalar(SkScalar value)
const char * c_str() const
GM(SkColor backgroundColor=SK_ColorWHITE)
const uint8_t uint32_t uint32_t GError ** error
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SkSamplingOptions sampling
SK_API sk_sp< SkShader > Blend(SkBlendMode mode, sk_sp< SkShader > dst, sk_sp< SkShader > src)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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
font
Font Metadata and Metrics.
SkSamplingOptions(SkFilterMode::kLinear))
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)