28 enum class Mode { kLinear, kMip, kAniso };
64 kNumVertImages*kImageSize + (kNumVertImages+1)*kSpacer);
69 constexpr int kNumLines = 100;
70 constexpr SkScalar kAngleStep = 360.0f / kNumLines;
71 constexpr int kInnerOffset = 10;
75 auto canvas = surf->getCanvas();
84 canvas->translate(kImageSize/2.0f, kImageSize/2.0f);
85 for (
int i = 0;
i < kNumLines; ++
i, angle += kAngleStep) {
88 canvas->drawLine(cos * kInnerOffset, sin * kInnerOffset,
89 cos * kImageSize/2, sin * kImageSize/2,
p);
91 fImage = surf->makeImageSnapshot();
101 SkScalar gScales[] = { 0.9f, 0.8f, 0.75f, 0.6f, 0.5f, 0.4f, 0.25f, 0.2f, 0.1f };
111 yOff = kSpacer +
i * (fImage->
height() + kSpacer);
126 xOff = fImage->
width() + 2*kSpacer;
127 yOff = kSpacer +
i * (fImage->
height() + kSpacer);
131 yOff = kSpacer + (
std::size(gScales) -
i - 1) * (fImage->
height() + kSpacer);
139 inline static constexpr int kImageSize = 256;
140 inline static constexpr int kSpacer = 10;
141 inline static constexpr int kNumVertImages = 5;
147 using INHERITED =
GM;
173 surf->
width() *3/5.f,
212 static constexpr float kScales[] = {1.f, 0.5f, 0.25f, 0.125f};
216 for (
bool shader : {
false,
true}) {
219 for (
float sy : kScales) {
221 for (
float sx : kScales) {
223 canvas->
scale(sx, sy);
240 for (
float sx : kScales) {
248 inline static constexpr int kPad = 5;
255DEF_GM(
return new AnisoMipsGM();)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kTopLeft_GrSurfaceOrigin
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kUnknown_SkColorType
uninitialized
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
#define INHERITED(method,...)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
#define SkScalarFloorToInt(x)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
virtual GrRecordingContext * recordingContext() const
void clear(SkColor color)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void scale(SkScalar sx, SkScalar sy)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SkISize dimensions() const
sk_sp< SkImage > withDefaultMipmaps() const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
sk_sp< SkImage > makeImageSnapshot()
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
sk_sp< SkImage > updateImage(SkSurface *surf, SkColor color)
SkString getName() const override
SkString getName() const override
void onDraw(SkCanvas *canvas) override
void draw(SkCanvas *canvas, int x, int y, int xSize, int ySize)
void onOnceBeforeDraw() override
SkISize getISize() override
GM(SkColor backgroundColor=SK_ColorWHITE)
static const int kImageSize
sk_sp< const SkImage > image
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
DEF_SWITCHES_START aot vmservice shared library name
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
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)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkColorType colorType() const
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
static constexpr SkSamplingOptions Aniso(int maxAniso)