48 paint.setDither(
true);
67 : fPowerOfTwoSize(powerOfTwoSize) {
80 if (!fPowerOfTwoSize) {
90 for (
size_t i = 0; i < std::size(
gColorTypes); i++) {
105 const char* gColorTypeNames[] = {
"8888",
"565" };
107 const char* gFilterNames[] = {
"Nearest",
"Linear",
"Trilinear",
"Mitchell",
"Aniso" };
111 const char* gModeNames[] = {
"C",
"R",
"M" };
116 for (
size_t kx = 0; kx < std::size(
gModes); kx++) {
117 for (
size_t ky = 0; ky < std::size(
gModes); ky++) {
119 str.
printf(
"[%s,%s]", gModeNames[kx], gModeNames[ky]);
130 for (
size_t i = 0; i < std::size(
gColorTypes); i++) {
131 for (
size_t j = 0; j < std::size(
gSamplings); j++) {
133 for (
size_t kx = 0; kx < std::size(
gModes); kx++) {
134 for (
size_t ky = 0; ky < std::size(
gModes); ky++) {
138 if (!fPowerOfTwoSize) {
143 paint.setDither(
true);
163 bool fPowerOfTwoSize;
218 const char* gModeNames[] = {
219 "Clamp",
"Repeat",
"Mirror"
227 for (
size_t kx = 0; kx < std::size(
gModes); kx++) {
236 for (
size_t ky = 0; ky < std::size(
gModes); ky++) {
243 for (
size_t kx = 0; kx < std::size(
gModes); kx++) {
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
SK_API SkString static SkString SkStringPrintf()
static SkScalar center(float pos0, float pos1)
constexpr SkBlendMode gModes[]
Type::kYUV Type::kRGBA() int(0.7 *637)
static sk_sp< SkImage > make_bm()
SkString getName() const override
SkISize getISize() override
ScaledTiling2GM(ShaderProc proc, const char name[])
void onDraw(SkCanvas *canvas) override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
ScaledTilingGM(bool powerOfTwoSize)
void onOnceBeforeDraw() override
SkBitmap fTexture[std::size(gColorTypes)]
SkISize getISize() override
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void eraseColor(SkColor4f) const
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawPaint(const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
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)
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)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
static void DrawString(SkCanvas *canvas, const char text[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint, Align align=kLeft_Align)
static constexpr SkCubicResampler Mitchell()
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
constexpr float height() const
constexpr float width() const
static constexpr SkSamplingOptions Aniso(int maxAniso)
static sk_sp< SkShader > make_grad(SkTileMode tx, SkTileMode ty)
static void makebm(SkBitmap *bm, SkColorType ct, int w, int h)
constexpr SkColorType gColorTypes[]
const SkSamplingOptions gSamplings[]
sk_sp< SkShader >(* ShaderProc)(SkTileMode, SkTileMode)