33 for (
const auto&
device : other->fLinkedDevices) {
43 fLinkedDevices.push_back(std::move(
device));
56 if (!fLinkedDevices.empty()) {
62 if (
device->isScratchDevice()) {
75 recorder->
priv().
add(std::move(deviceDrawTask));
99 if (
device->recorder() == recorder) {
104 device->flushPendingWorkToRecorder();
116 if (emptyCount == fLinkedDevices.size()) {
117 fLinkedDevices.clear();
125 if (!fLinkedDevices.empty()) {
132 if (emptyCount == fLinkedDevices.size()) {
133 fLinkedDevices.clear();
138 return emptyCount > 0;
146 std::string_view label)
const {
148 budgeted, mipmapped, backingFit, std::move(label));
155 const Image* img =
static_cast<const Image*
>(baseImage);
161 const Image_YUVA* img =
static_cast<const Image_YUVA*
>(baseImage);
162 return img->proxyView(0).proxy();
172 if (this->
bounds() == subset &&
173 (!requiredProps.
fMipmapped || this->hasMipmaps()) &&
174 !this->isDynamic()) {
180 std::string label = proxy->
label();
182 label =
"ImageSubsetTexture";
210 std::string label = proxy->
label();
212 label =
"ImageMakeCTandCSTexture";
214 label +=
"_CTandCSConversion";
232 SKGPU_LOG_W(
"Cannot convert Graphite-backed image to Ganesh");
239 SKGPU_LOG_W(
"Cannot convert Graphite-backed image to Ganesh");
249 SKGPU_LOG_W(
"Cannot use Ganesh async API with Graphite-backed image, use API on Context");
262 SKGPU_LOG_W(
"Cannot use Ganesh async API with Graphite-backed image, use API on Context");
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SKGPU_LOG_W(fmt,...)
sk_sp< T > sk_ref_sp(T *obj)
virtual GrImageContext * context() const
virtual Type type() const =0
const SkImageInfo & imageInfo() const
SkAlphaType alphaType() const
void(ReadPixelsContext, std::unique_ptr< const AsyncReadResult >) ReadPixelsCallback
void recordDependency(sk_sp< Task >)
Image_Base(const SkImageInfo &info, uint32_t uniqueID)
void linkDevice(sk_sp< Device >)
void onAsyncRescaleAndReadPixels(const SkImageInfo &, SkIRect srcRect, RescaleGamma, RescaleMode, ReadPixelsCallback, ReadPixelsContext) const override
sk_sp< SkImage > onMakeSubset(Recorder *, const SkIRect &, RequiredProperties) const override
sk_sp< SkImage > makeColorTypeAndColorSpace(Recorder *, SkColorType targetCT, sk_sp< SkColorSpace > targetCS, RequiredProperties) const override
void notifyInUse(Recorder *, DrawContext *drawContext) const
virtual sk_sp< Image > copyImage(Recorder *, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit, std::string_view label) const
sk_sp< SkImage > onMakeColorTypeAndColorSpace(SkColorType, sk_sp< SkColorSpace >, GrDirectContext *) const override
void linkDevices(const Image_Base *)
void onAsyncRescaleAndReadPixelsYUV420(SkYUVColorSpace, bool readAlpha, sk_sp< SkColorSpace >, SkIRect srcRect, SkISize dstSize, RescaleGamma, RescaleMode, ReadPixelsCallback, ReadPixelsContext) const override
const TextureProxyView & textureProxyView() const
void addPendingRead(const TextureProxy *)
TextureProxy * proxy() const
const char * label() const
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
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)