37#include <initializer_list>
47 auto context = ctxInfo.directContext();
48 if (!context->priv().caps()->mipmapSupport()) {
55 surf->recordingContext());
64 surf->recordingContext());
69 for (
auto allocateMips : {
false,
true}) {
79 surf1->getCanvas()->drawCircle(128, 128, 50,
SkPaint());
90 surf2->getCanvas()->scale(0.2f, 0.2f);
91 surf2->getCanvas()->drawImage(surf1->makeImageSnapshot(), 0, 0,
sampling);
92 context->flushAndSubmit();
97 surf1->getCanvas()->drawCircle(128, 128, 100,
SkPaint());
98 context->flushAndSubmit();
108 auto dContext = ctxInfo.directContext();
109 if (!dContext->priv().caps()->mipmapSupport()) {
112 static constexpr auto kCreateWithMipMaps =
true;
125 auto img = surf->makeImageSnapshot();
146 const auto singlePixelInfo =
155 surf->readPixels(singlePixelInfo, &pixel,
sizeof(uint32_t), 0, 0);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(GrTextureMipMapInvalidationTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
SK_API SkPMColor SkPreMultiplyColor(SkColor c)
constexpr SkColor SK_ColorDKGRAY
#define REPORTER_ASSERT(r, cond,...)
GrTexture * peekTexture() const
skgpu::Mipmapped mipmapped() const
bool mipmapsAreDirty() const
std::function< void(GrBackendTexture)> BackendTextureReleaseProc
SK_API sk_sp< SkImage > BorrowTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
SK_API bool MakeBackendTextureFromImage(GrDirectContext *context, sk_sp< SkImage > image, GrBackendTexture *backendTexture, BackendTextureReleaseProc *backendTextureReleaseProc)
sk_sp< const SkImage > image
SkSamplingOptions sampling
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)
GrTextureProxy * GetTextureImageProxy(SkImage *image, GrRecordingContext *rContext)
SkSamplingOptions(SkFilterMode::kLinear))
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeWH(float w, float h)