/* *Thisclassprovidesacentralizedlocationforclientstoperformanycachingofimages *theydesire.WheneverGraphiteencountersanSkImagewhichisnotGraphite-backed *itwillcallImageProvider::findOrCreate.Theclient'sderivedversionofthisclassshould *returnaGraphite-backedversionoftheprovidedSkImagethatmeetsthespecified *requirements. * *Skiarequiresthat'findOrCreate'returnaGraphite-backedimagethatpreservesthe *dimensionsandalphatypeoftheoriginalimage.Thebitdepthofthe *individualchannelscanchange(e.g.,4444->8888isallowed)aswellasthechannels-as *longasthereturnedimagehasasupersetoftheoriginalimage'schannels *(e.g.,565->8888opaqueisallowed). * *Wrtmipmapping,thereturnedimagecanhavedifferentmipmapsettingsthanrequested.If *mipmappingwasrequestedbutnotreturned,thesamplinglevelwillbereducedtolinear. *Iftherequirementsarenotmetbythereturnedimage(modulotheflexibilitywrtmipmapping) *Graphitewilldropthedraw. * *AllreturnedimagesmustbebackedbytexturesthathaveaTopLeftorigin.IfSkiaisusedto *createthetexture(e.g.usingmakeTextureImage)thenthisisalwaysguaranteed.Iftheclient *returnsatexturetheycreatedthemselvesandwrappedinSkia,theymustensurethattexturehas *aTopLeftorigin. * *Note:bydefault,Graphitewillnotperformanycachingofimages * *Threadingconcerns: *IfthesameImageProviderisgiventomultipleRecordersitisuptothe *clienttohandleanyrequiredthreadsynchronization.Thisisnotlimitedtojust *restrictingaccesstowhatevermapaderivedclassmayhavebutextendstoensuring *thatanimagecreatedononeRecorderhashaditscreationworksubmittedbeforeit *isusedbyanyworksubmittedbyanotherRecording.Pleasenote,thisrequirement *(rethesubmissionofcreationworkandimageusageondifferentthreads)iscommontoall *graphiteSkImagesandisn'tuniquetoSkImagesreturnedbytheImageProvider. * *TODO(b/240996632):adddocumentationreshutdownorder. *TODO(b/240997067):addunittests
*/ class SK_API ImageProvider : public SkRefCnt { public: // If the client's derived class already has a Graphite-backed image that has the same // contents as 'image' and meets the requirements, then it can be returned. // makeTextureImage can always be called to create an acceptable Graphite-backed image // which could then be cached. virtual sk_sp<SkImage> findOrCreate(Recorder* recorder, const SkImage* image,
SkImage::RequiredProperties) = 0;
};
} // namespace skgpu::graphite
#endif// skgpu_graphite_ImageProvider_DEFINED
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-30)
¤
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.