28 const std::array<SkColor, 3>&
colors,
29 const std::array<float, 3>&
offsets) {
52 for (
int y = 0;
y < 3; ++
y) {
53 for (
int x = 0;
x < 3; ++
x) {
74 constexpr SkColor4f kTransYellow = {1.0f, 1.0f, 0.0f, 0.5f};
79 create_image_shader(destCanvas,
106 canvas->
scale(0.5f, 0.5f);
120 p.setShader(create_gradient_shader(r,
122 { 0.0f, 0.75f, 1.0f }));
127 canvas->
scale(0.5f, 0.5f);
139 static constexpr int kNumTilesPerSide = 3;
145 for (
int i = 0;
i < 256; ++
i) {
146 table1[
i] = (
i/64) * 85;
151 uint8_t table2[256], table3[256];
152 for (
int i = 0;
i < 256; ++
i) {
153 if (
i >= 85 &&
i <= 170) {
155 table3[
i] = ((
i - 85) / 85.0f) * 255.0f;
165 static const std::array<SkColor, 3> kGradientColors[kNumTilesPerSide*kNumTilesPerSide] = {
170 { 0x00000000, 0x80000000, 0xFF000000 },
195 for (
int y = 0;
y < kNumTilesPerSide; ++
y) {
196 for (
int x = 0;
x < kNumTilesPerSide; ++
x) {
200 int colorFilterIndex =
x*kNumTilesPerSide+
y;
201 p.setShader(create_gradient_shader(r,
202 kGradientColors[colorFilterIndex],
203 { 0.0f, 0.5f, 1.0f }));
204 p.setColorFilter(colorFilters[colorFilterIndex]);
215 static const SkColor4f kOpaqueWhite { 1.0f, 1.0f, 1.0f, 1.0f };
216 static const SkColor4f kTransBluish { 0.0f, 0.5f, 1.0f, 0.5f };
217 static const SkColor4f kTransWhite { 1.0f, 1.0f, 1.0f, 0.75f };
232 for (
int passes = 0; passes < 2; ++passes) {
322 p.setShader(std::move(shader));
331#if defined(SK_GRAPHITE)
355 canvas->
saveLayer(
nullptr, &restorePaint);
370DEF_GM(
return new GraphiteStartGM;)
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kLastCoeffMode
last porter duff blend mode
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
constexpr SkColor SK_ColorDKGRAY
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
bool writePixels(const SkImageInfo &info, const void *pixels, size_t rowBytes, int x, int y)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
static sk_sp< SkColorFilter > MakeGaussian()
static sk_sp< SkColorFilter > Compose(const sk_sp< SkColorFilter > &outer, sk_sp< SkColorFilter > inner)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorFilter > Table(const uint8_t table[256])
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkColorFilter > Lighting(SkColor mul, SkColor add)
static sk_sp< SkColorFilter > SRGBToLinearGamma()
static sk_sp< SkColorFilter > LinearToSRGBGamma()
static sk_sp< SkColorFilter > TableARGB(const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256])
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)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static SkMatrix RotateDeg(SkScalar deg)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setBlendMode(SkBlendMode mode)
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
sk_sp< SkShader > makeWithColorFilter(sk_sp< SkColorFilter >) const
void onDraw(SkCanvas *canvas) override
static constexpr int kTileWidth
static constexpr int kWidth
SkISize getISize() override
static constexpr int kClipInset
static constexpr int kHeight
SkString getName() const override
static constexpr int kTileHeight
void onOnceBeforeDraw() override
GraphiteStartGM()=default
static constexpr SkScalar kTileHeight
static constexpr SkScalar kTileWidth
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
unsigned useCenter Optional< SkMatrix > matrix
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
sk_sp< const SkImage > image
PODArray< SkColor > colors
SK_API sk_sp< SkShader > Blend(SkBlendMode mode, sk_sp< SkShader > dst, sk_sp< SkShader > src)
SK_API sk_sp< SkShader > Color(SkColor)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
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)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
void offsetTo(float newX, float newY)
SkScalar fLeft
smaller x-axis bounds
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
SkRect makeInset(float dx, float dy) const
SkScalar fRight
larger x-axis bounds
void offset(float dx, float dy)
static constexpr SkRect MakeWH(float w, float h)
SkScalar fTop
smaller y-axis bounds