41#include <initializer_list>
63 int expectedMaxWindowRects) {
74 if (preinstantiated) {
115 if (preinstantiated) {
130 using namespace skgpu;
132 auto direct = ctxInfo.directContext();
135 const GrCaps& caps = *direct->priv().caps();
139 for (
auto widthHeight : {100, 128, 1048576}) {
143 for (
auto budgeted : { Budgeted::kYes, Budgeted::kNo }) {
144 for (
auto numSamples : {1, 4, 16, 128}) {
145 SkISize dims = {widthHeight, widthHeight};
197 int supportedSamples =
264 using namespace skgpu;
266 auto direct = ctxInfo.directContext();
269 GrGpu* gpu = direct->priv().getGpu();
270 const GrCaps& caps = *direct->priv().caps();
284 if (direct->colorTypeSupportedAsSurface(
colorType)) {
290 static constexpr int kExpectedNumSamples = 1;
294 gpu->deleteTestingOnlyBackendRenderTarget(backendRT);
297 for (
auto numSamples : {1, 4}) {
300 if (!supportedNumSamples) {
313 static constexpr int kStencilBits = 8;
328 sk_gpu_test::ManagedBackendTexture::MakeWithoutData(direct,
337 "Could not create renderable backend texture of color type %d",
359 sk_gpu_test::ManagedBackendTexture::MakeWithoutData(direct,
368 "Could not create non-renderable backend texture of color type %d",
393 auto direct = ctxInfo.directContext();
398 for (
int width : { 0, 100 }) {
399 for (
int height : { 0, 100}) {
405 direct->priv().caps()->getDefaultBackendFormat(
@ kBorrow_GrWrapOwnership
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
skgpu::Protected Protected
static const int kWidthHeight
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
static void check_surface(skiatest::Reporter *reporter, GrSurfaceProxy *proxy, int width, int height, skgpu::Budgeted budgeted)
static void check_texture(skiatest::Reporter *reporter, GrResourceProvider *provider, GrTextureProxy *texProxy, SkBackingFit fit)
static void check_rendertarget(skiatest::Reporter *reporter, const GrCaps &caps, GrResourceProvider *provider, GrRenderTargetProxy *rtProxy, int numSamples, SkBackingFit fit, int expectedMaxWindowRects)
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static constexpr bool SkToBool(const T &x)
#define REPORTER_ASSERT(r, cond,...)
bool supportsProtectedContent() const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
virtual int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat &) const =0
int maxWindowRectangles() const
UniqueID uniqueID() const
sk_sp< GrTextureProxy > wrapBackendTexture(const GrBackendTexture &, GrWrapOwnership, GrWrapCacheable, GrIOType, sk_sp< skgpu::RefCntedCallback >=nullptr)
sk_sp< GrTextureProxy > createProxy(const GrBackendFormat &, SkISize dimensions, GrRenderable, int renderTargetSampleCnt, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, GrProtected, std::string_view label, GrInternalSurfaceFlags=GrInternalSurfaceFlags::kNone, UseAllocator useAllocator=UseAllocator::kYes)
sk_sp< GrTextureProxy > wrapRenderableBackendTexture(const GrBackendTexture &, int sampleCnt, GrWrapOwnership, GrWrapCacheable, sk_sp< skgpu::RefCntedCallback > releaseHelper)
sk_sp< GrSurfaceProxy > wrapBackendRenderTarget(const GrBackendRenderTarget &, sk_sp< skgpu::RefCntedCallback > releaseHelper)
int maxWindowRectangles(const GrCaps &caps) const
bool instantiate(GrResourceProvider *) override
sk_sp< GrTexture > createApproxTexture(SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, skgpu::Renderable renderable, int renderTargetSampleCnt, skgpu::Protected isProtected, std::string_view label)
GrResourceProviderPriv priv()
sk_sp< GrTexture > createTexture(SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, skgpu::Renderable renderable, int renderTargetSampleCnt, skgpu::Mipmapped mipmapped, skgpu::Budgeted budgeted, skgpu::Protected isProtected, std::string_view label)
SkISize backingStoreDimensions() const
virtual GrRenderTargetProxy * asRenderTargetProxy()
const GrBackendFormat & backendFormat() const
size_t gpuMemorySize() const
GrTexture * peekTexture() const
skgpu::Budgeted isBudgeted() const
SkISize dimensions() const
virtual GrTextureProxy * asTextureProxy()
bool isInstantiated() const
UniqueID uniqueID() const
GrRenderTarget * peekRenderTarget() const
virtual GrBackendFormat backendFormat() const =0
SkISize dimensions() const
GrInternalSurfaceFlags flags() const
bool instantiate(GrResourceProvider *) override
GrTextureProxy * asTextureProxy() override
uint32_t uint32_t * format
SK_API GrBackendRenderTarget MakeGL(int width, int height, int sampleCnt, int stencilBits, const GrGLFramebufferInfo &glInfo)
skgpu::Protected fProtected