Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skresources::ResourceProvider Class Reference

#include <SkResources.h>

Inheritance diagram for skresources::ResourceProvider:
SkRefCnt SkRefCntBase skresources::FileResourceProvider skresources::ResourceProviderProxyBase skresources::CachingResourceProvider skresources::DataURIResourceProviderProxy

Public Member Functions

virtual sk_sp< SkDataload (const char[], const char[]) const
 
virtual sk_sp< ImageAssetloadImageAsset (const char[], const char[], const char[]) const
 
virtual sk_sp< ExternalTrackAssetloadAudioAsset (const char[], const char[], const char[])
 
virtual sk_sp< SkDataloadFont (const char[], const char[]) const
 
virtual sk_sp< SkTypefaceloadTypeface (const char[], const char[]) const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Detailed Description

ResourceProvider is an interface that lets rich-content modules defer loading of external resources (images, fonts, etc.) to embedding clients.

Definition at line 150 of file SkResources.h.

Member Function Documentation

◆ load()

virtual sk_sp< SkData > skresources::ResourceProvider::load ( const char  [],
const char  [] 
) const
inlinevirtual

Load a generic resource (currently only nested animations) specified by |path| + |name|, and return as an SkData.

Reimplemented in skresources::FileResourceProvider, and skresources::ResourceProviderProxyBase.

Definition at line 156 of file SkResources.h.

157 {
158 return nullptr;
159 }

◆ loadAudioAsset()

virtual sk_sp< ExternalTrackAsset > skresources::ResourceProvider::loadAudioAsset ( const char  [],
const char  [],
const char  [] 
)
inlinevirtual

Load an external audio track specified by |path|/|name|/|id|.

Reimplemented in skresources::ResourceProviderProxyBase.

Definition at line 174 of file SkResources.h.

176 {
177 return nullptr;
178 }

◆ loadFont()

virtual sk_sp< SkData > skresources::ResourceProvider::loadFont ( const char  [],
const char  [] 
) const
inlinevirtual

DEPRECATED: implement loadTypeface() instead.

Load an external font and return as SkData.

Parameters
namefont name ("fName" Lottie property)
urlweb font URL ("fPath" Lottie property)

– Note –

This mechanism assumes monolithic fonts (single data blob). Some web font providers may serve multiple font blobs, segmented for various unicode ranges, depending on user agent capabilities (woff, woff2). In that case, the embedder would need to advertise no user agent capabilities when fetching the URL, in order to receive full font data.

Reimplemented in skresources::ResourceProviderProxyBase.

Definition at line 195 of file SkResources.h.

196 {
197 return nullptr;
198 }

◆ loadImageAsset()

virtual sk_sp< ImageAsset > skresources::ResourceProvider::loadImageAsset ( const char  [],
const char  [],
const char  [] 
) const
inlinevirtual

Load an image asset specified by |path| + |name|, and returns the corresponding ImageAsset proxy.

Reimplemented in skresources::FileResourceProvider, and skresources::ResourceProviderProxyBase.

Definition at line 165 of file SkResources.h.

167 {
168 return nullptr;
169 }

◆ loadTypeface()

virtual sk_sp< SkTypeface > skresources::ResourceProvider::loadTypeface ( const char  [],
const char  [] 
) const
inlinevirtual

Load an external font and return as SkTypeface.

Parameters
namefont name
urlweb font URL

Reimplemented in skresources::ResourceProviderProxyBase.

Definition at line 206 of file SkResources.h.

207 {
208 return nullptr;
209 }

The documentation for this class was generated from the following file: