24#include <initializer_list>
39 return SkISize::Make(kNumCols * kBitmapSize, kNumRows * kBitmapSize);
83 int xOffset = 0, yOffset = 0;
99 int saveCount = canvas->
save();
104 xOffset + kBitmapSize/2.0f,
105 yOffset + kBitmapSize,
109 if (xOffset >= 1024) {
117 static const int kBitmapSize = 256;
118 static const int kNumRows = 5;
119 static const int kNumCols = 4;
129 using INHERITED =
GM;
134DEF_GM(
return new AndroidBlendModesGM;)
SK_API const char * SkBlendMode_Name(SkBlendMode blendMode)
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kOverlay
multiply or screen, depending on destination
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
constexpr SkColor SK_ColorTRANSPARENT
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorBLACK
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
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)
void clear(SkColor color)
void restoreToCount(int saveCount)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static void DrawString(SkCanvas *canvas, const char text[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint, Align align=kLeft_Align)
SkString getName() const override
void drawTile(SkCanvas *canvas, int xOffset, int yOffset, SkBlendMode mode)
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
void onOnceBeforeDraw() override
GM(SkColor backgroundColor=SK_ColorWHITE)
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
font
Font Metadata and Metrics.
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)