76 typedef GM INHERITED ;
102 for (
int alpha = 0xFF; alpha > 0; alpha -= 0x28) {
103 paint.setAlphaf(1.0f);
104 paint.setShader(
nullptr);
107 paint.setAlpha(alpha);
108 paint.setShader(shaders[
y]);
167 return SkStringPrintf(
"composeshader_bitmap%s", fUseLocalMatrix ?
"_lm" :
"");
171 return SkISize::Make(7 * (squareLength + 5), 2 * (squareLength + 5));
206 if (fUseLocalMatrix) {
219 for (
int alpha = 0xFF; alpha > 0; alpha -= 0x28) {
220 paint.setAlpha(alpha);
221 paint.setShader(shaders[
y]);
237 inline static constexpr int squareLength = 20;
239 const bool fUseLocalMatrix;
241 bool fInitialized =
false;
248 using INHERITED =
GM;
262 dst8Storage[
y *
width +
x] = (
y +
x) / 2;
267 paint.setAntiAlias(
true);
270 canvas->drawRect(r,
paint);
285 canvas->drawRect(r,
paint);
319 p.setBlendMode(
mode);
337 r.
outset(gap + 1.5f, gap + 1.5f);
343 for (
int y = 0;
y < 2; ++
y) {
363 canvas->translate(margin, margin);
365 for (
int m = 0;
m < 16; ++
m) {
370 canvas->translate(0, dy);
373 canvas->translate(
dx, 0);
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kSrcOver
r = s + (1-sa)*d
@ kDstOver
r = d + (1-da)*s
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorTRANSPARENT
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
#define INHERITED(method,...)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
SkString getName() const override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
ComposeShaderBitmapGM(bool use_lm)
SkString getName() const override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
void onOnceBeforeDraw() override
sk_sp< SkShader > fShader
SkString getName() const override
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void eraseColor(SkColor4f) const
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
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 Translate(SkScalar dx, SkScalar dy)
static const SkMatrix & I()
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
sk_sp< SkShader > makeWithLocalMatrix(const SkMatrix &) const
GM(SkColor backgroundColor=SK_ColorWHITE)
static void draw_cell(SkCanvas *canvas, sk_sp< SkShader > src, sk_sp< SkShader > dst, SkBlendMode mode, SkAlpha alpha)
static sk_sp< SkShader > make_linear_gradient_shader(int length)
static void draw_color_bm(SkBitmap *bm, int length)
static sk_sp< SkShader > make_dst_shader(SkScalar size)
static void draw_composed(SkCanvas *canvas, sk_sp< SkShader > src, sk_sp< SkShader > dst, SkBlendMode mode, SkAlpha alpha)
DEF_SIMPLE_GM(composeshader_bitmap2, canvas, 200, 200)
static sk_sp< SkShader > make_src_shader(SkScalar size)
static void draw_alpha8_bm(SkBitmap *bm, int length)
static void draw_pair(SkCanvas *canvas, sk_sp< SkShader > src, sk_sp< SkShader > dst, SkBlendMode mode)
static sk_sp< SkShader > make_shader(SkBlendMode mode)
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
PODArray< SkColor > colors
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
SK_API sk_sp< SkShader > Blend(SkBlendMode mode, sk_sp< SkShader > dst, sk_sp< SkShader > src)
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 mode
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
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkImageInfo MakeA8(int width, int height)
void set(float x, float y)
static SkRect MakeIWH(int w, int h)
void outset(float dx, float dy)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)