class GrDirectContext; class GrRecordingContext; class SharedGenerator; class SkBitmap; class SkCachedData; class SkData; class SkPixmap; class SkSurface; enum SkColorType : int; struct SkIRect;
namespace skgpu { namespace graphite { class Recorder; } }
class SkImage_Lazy : public SkImage_Base { public: struct Validator {
Validator(sk_sp<SharedGenerator>, const SkColorType*, sk_sp<SkColorSpace>);
// From SkImage.h bool isValid(GrRecordingContext*) const override;
// From SkImage_Base.h bool onHasMipmaps() const override { // TODO: Should we defer to the generator? The generator interface currently doesn't have // a way to provide content for levels other than via SkImageGenerator::generateTexture(). returnfalse;
} bool onIsProtected() const override;
// Be careful with this. You need to acquire the mutex, as the generator might be shared // among several images.
sk_sp<SharedGenerator> generator() const; protected: virtualbool readPixelsProxy(GrDirectContext*, const SkPixmap&) const { returnfalse; }
private:
class ScopedGenerator;
// Note that this->imageInfo() is not necessarily the info from the generator. It may be // cropped by onMakeSubset and its color type/space may be changed by // onMakeColorTypeAndColorSpace.
sk_sp<SharedGenerator> fSharedGenerator;
// Repeated calls to onMakeColorTypeAndColorSpace will result in a proliferation of unique IDs // and SkImage_Lazy instances. Cache the result of the last successful call. mutable SkMutex fOnMakeColorTypeAndSpaceMutex; mutable sk_sp<SkImage> fOnMakeColorTypeAndSpaceResult; // When the SkImage_Lazy goes away, we will iterate over all the listeners to inform them // of the unique ID's demise. This is used to remove cached textures from GrContext. mutable SkIDChangeListener::List fUniqueIDListeners;
};
// Ref-counted tuple(SkImageGenerator, SkMutex) which allows sharing one generator among N images class SharedGenerator final : public SkNVRefCnt<SharedGenerator> { public: static sk_sp<SharedGenerator> Make(std::unique_ptr<SkImageGenerator> gen);
// This is thread safe. It is a const field set in the constructor. const SkImageInfo& getInfo() const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.