49 : fFilter(filter), fMipmapMode(mm), fUpscale(upscale) {
50 this->setBGColor(0xFFFFFFFF);
58 name.append(
"_nearest");
61 name.append(
"_linear");
64 switch (fMipmapMode) {
68 name.append(
"_mipmap_nearest");
71 name.append(
"_mipmap_linear");
74 name.append(fUpscale ?
"_up" :
"_down");
80 int w = kTestPad + 2*kN*(kImageSize.
width() + 2*kDrawPad + kTestPad);
81 int h = kTestPad + 2*kN*(kImageSize.
height() + 2*kDrawPad + kTestPad);
95 *errorMsg = kErrorMsg_DrawSkippedGpuOnly;
105 rContext, fBitmap,
"DrawResult_Draw_BitMap", mipmapped));
107 *errorMsg =
"Failed to create proxy.";
119 3*fBitmap.
width()/5 + 2, 4*fBitmap.
height()/5 + 2);
125 SkRect b = fUpscale ?
a.makeInset (.31f *
a.width(), .31f *
a.height())
126 :
a.makeOutset(.25f *
a.width(), .25f *
a.height());
129 b = fUpscale ?
a.makeInset (.25f *
a.width(), .35f *
a.height())
130 :
a.makeOutset(.20f *
a.width(), .35f *
a.height());
139 rContext, subsetBmp,
"DrawResult_Draw_SubsetBitMap", mipmapped));
147 for (
int tm = 0; tm < textureMatrices.
size(); ++tm) {
150 auto wmy =
static_cast<Wrap>(my);
152 auto wmx =
static_cast<Wrap>(mx);
154 const auto& caps = *rContext->
priv().
caps();
160 std::unique_ptr<GrFragmentProcessor> fp1;
173 static constexpr SkVector kT = {-100, 300};
179 sdc->addDrawOp(std::move(op));
182 x += localRect.
width() + kTestPad;
196 drawRect, localRect)) {
197 sdc->addDrawOp(std::move(op));
205 x += localRect.
width() + kTestPad;
211 y += localRect.
height() + kTestPad;
213 if (tm < textureMatrices.
size() - 1) {
224 inline static constexpr SkISize kImageSize = {128, 88};
225 inline static constexpr SkScalar kDrawPad = 10.f;
226 inline static constexpr SkScalar kTestPad = 10.f;
232 using INHERITED = GM;
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
constexpr SkColor SK_ColorRED
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeCachedBitmapProxyView(GrRecordingContext *rContext, const SkBitmap &bitmap, std::string_view label, skgpu::Mipmapped mipmapped)
#define SkScalarFloorToScalar(x)
const GrCaps * caps() const
bool mipmapSupport() const
GrRecordingContextPriv priv()
static constexpr int kWrapModeCount
static std::unique_ptr< GrFragmentProcessor > MakeSubset(GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState, const SkRect &subset, const GrCaps &caps, const float border[4]=kDefaultBorder, bool alwaysUseShaderTileMode=false)
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView, SkAlphaType, const SkMatrix &=SkMatrix::I(), GrSamplerState::Filter=GrSamplerState::Filter::kNearest, GrSamplerState::MipmapMode mipmapMode=GrSamplerState::MipmapMode::kNone)
SkAlphaType alphaType() const
bool extractSubset(SkBitmap *dst, const SkIRect &subset) const
SkISize dimensions() const
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
SkMatrix & postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
SkMatrix & preRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkISize getISize() override
DrawResult onDraw(GrRecordingContext *rContext, SkCanvas *canvas, SkString *errorMsg) override
TexelSubset(Filter filter, MipmapMode mm, bool upscale)
void onOnceBeforeDraw() override
SkString getName() const override
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 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
const myers::Point & get< 0 >(const myers::Segment &s)
GrOp::Owner MakeRect(GrRecordingContext *context, GrPaint &&paint, const SkRect &drawRect, const SkRect &localRect, const SkMatrix &localM)
SurfaceDrawContext * TopDeviceSurfaceDrawContext(const SkCanvas *canvas)
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkIRect MakeSize(const SkISize &size)
constexpr SkIPoint topLeft() const
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
SkIRect makeInset(int32_t dx, int32_t dy) const
constexpr int32_t width() const
constexpr int32_t height() const
static SkRect Make(const SkISize &size)
constexpr SkRect makeOffset(float dx, float dy) const
SkRect makeOutset(float dx, float dy) const
constexpr float height() const
constexpr float right() const
constexpr float width() const
constexpr float bottom() const