27#if defined(GRAPHITE_TEST_UTILS)
38 , fTextureProxyView(
std::move(view)) {}
51 device->imageInfo().colorInfo());
63 std::string_view label) {
79 return CopyAsDraw(recorder, srcImage.
get(), subset, srcColorInfo,
80 budgeted, mipmapped, backingFit, std::move(label));
104 recorder->
priv().
add(std::move(copyTask));
108 SKGPU_LOG_W(
"Image::Copy failed to generate mipmaps");
117 if (!fTextureProxyView.
proxy()) {
133 std::string_view label)
const {
136 subset, budgeted, mipmapped, backingFit, std::move(label));
140 sk_sp<Image> view = sk_make_sp<Image>(fTextureProxyView,
144 view->linkDevices(
this);
148#if defined(GRAPHITE_TEST_UTILS)
149bool Image::onReadPixelsGraphite(
Recorder* recorder,
157 std::unique_ptr<Recording> recording = recorder->
snap();
161 InsertRecordingInfo
info;
162 info.fRecording = recording.get();
167 fTextureProxyView.
proxy(),
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SKGPU_LOG_W(fmt,...)
GrImageContextPriv priv()
virtual GrImageContext * context() const
sk_sp< SkImage > makeColorSpace(GrDirectContext *, sk_sp< SkColorSpace >) const override
const SkImageInfo & imageInfo() const
bool isTexturable(const TextureInfo &) const
virtual bool supportsReadPixels(const TextureInfo &textureInfo) const =0
virtual TextureInfo getTextureInfoForSampledCopy(const TextureInfo &textureInfo, Mipmapped mipmapped) const =0
static sk_sp< CopyTextureToTextureTask > Make(sk_sp< TextureProxy > srcProxy, SkIRect srcRect, sk_sp< TextureProxy > dstProxy, SkIPoint dstPoint, int dstLevel=0)
void notifyInUse(Recorder *, DrawContext *drawContext) const
static sk_sp< Image > Copy(Recorder *, const TextureProxyView &srcView, const SkColorInfo &, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit, std::string_view label)
Image(TextureProxyView, const SkColorInfo &)
size_t textureSize() const override
sk_sp< Image > copyImage(Recorder *, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit, std::string_view label) const override
sk_sp< SkImage > onReinterpretColorSpace(sk_sp< SkColorSpace >) const override
static sk_sp< Image > WrapDevice(sk_sp< Device > device)
const Caps * caps() const
ResourceProvider * resourceProvider()
std::unique_ptr< Recording > snap()
size_t gpuMemorySize() const
sk_sp< TextureProxy > refProxy() const
TextureProxy * proxy() const
SkISize dimensions() const
static sk_sp< TextureProxy > Make(const Caps *, ResourceProvider *, SkISize dimensions, const TextureInfo &, std::string_view label, skgpu::Budgeted)
const TextureInfo & textureInfo() const
const Texture * texture() const
size_t uninstantiatedGpuMemorySize() const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
sk_sp< const SkImage > image
bool GenerateMipmaps(Recorder *recorder, sk_sp< TextureProxy > texture, const SkColorInfo &colorInfo)
sk_sp< Image > CopyAsDraw(Recorder *recorder, const SkImage *image, const SkIRect &subset, const SkColorInfo &dstColorInfo, Budgeted budgeted, Mipmapped mipmapped, SkBackingFit backingFit, std::string_view label)
SkISize GetApproxSize(SkISize size)
constexpr SkISize size() const
static constexpr SkIRect MakeSize(const SkISize &size)
bool contains(int32_t x, int32_t y) const