Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GrTexture Class Referenceabstract
Inheritance diagram for GrTexture:
GrSurface GrGpuResource GrIORef< GrGpuResource >

Public Types

typedef void * ReleaseCtx
 
typedef void(* ReleaseProc )(ReleaseCtx)
 

Public Member Functions

GrTextureasTexture () override
 
const GrTextureasTexture () const override
 
virtual GrBackendObject getTextureHandle () const =0
 Return the native ID or handle to the texture, depending on the platform. More...
 
virtual void textureParamsModified ()=0
 This function indicates that the texture parameters (wrap mode, filtering, ...) have been changed externally to Skia.
 
virtual void setRelease (ReleaseProc proc, ReleaseCtx ctx)=0
 
GrTexturePriv texturePriv ()
 Access methods that are only to be used within Skia code. More...
 
const GrTexturePriv texturePriv () const
 
- Public Member Functions inherited from GrSurface
int width () const
 Retrieves the width of the surface.
 
int height () const
 Retrieves the height of the surface.
 
SkRect getBoundsRect () const
 Helper that gets the width and height of the surface as a bounding rectangle.
 
GrSurfaceOrigin origin () const
 
GrPixelConfig config () const
 Retrieves the pixel config specified when the surface was created. More...
 
virtual GrRenderTargetasRenderTarget ()
 
virtual const GrRenderTargetasRenderTarget () const
 
GrSurfacePriv surfacePriv ()
 Access methods that are only to be used within Skia code. More...
 
const GrSurfacePriv surfacePriv () const
 
- Public Member Functions inherited from GrGpuResource
bool wasDestroyed () const
 Tests whether a object has been abandoned or released. More...
 
const GrContextgetContext () const
 Retrieves the context that owns the object. More...
 
GrContextgetContext ()
 
size_t gpuMemorySize () const
 Retrieves the amount of GPU memory used by this resource in bytes. More...
 
UniqueID uniqueID () const
 Gets an id that is unique for this GrGpuResource object. More...
 
const GrUniqueKeygetUniqueKey () const
 Returns the current unique key for the resource. More...
 
CacheAccess cacheAccess ()
 
const CacheAccess cacheAccess () const
 
ResourcePriv resourcePriv ()
 
const ResourcePriv resourcePriv () const
 
void abandon ()
 Removes references to objects in the underlying 3D API without freeing them. More...
 
virtual void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 Dumps memory usage information for this GrGpuResource to traceMemoryDump. More...
 
- Public Member Functions inherited from GrIORef< GrGpuResource >
void ref () const
 
void unref () const
 
void validate () const
 

Protected Member Functions

 GrTexture (GrGpu *, const GrSurfaceDesc &, GrSLType samplerType, GrSamplerParams::FilterMode highestFilterMode, bool wasMipMapDataProvided)
 
- Protected Member Functions inherited from GrSurface
bool hasPendingRead () const
 
bool hasPendingWrite () const
 
bool hasPendingIO () const
 
 GrSurface (GrGpu *gpu, const GrSurfaceDesc &desc)
 
void onRelease () override
 Overridden to free GPU resources in the backend API. More...
 
void onAbandon () override
 Overridden to abandon any internal handles, ptrs, etc to backend API resources. More...
 
- Protected Member Functions inherited from GrGpuResource
void registerWithCache (SkBudgeted)
 
void registerWithCacheWrapped ()
 
 GrGpuResource (GrGpu *)
 
GrGpu * getGpu () const
 
void didChangeGpuMemorySize () const
 This entry point should be called whenever gpuMemorySize() should report a different size. More...
 
virtual void setMemoryBacking (SkTraceMemoryDump *, const SkString &) const
 Allows subclasses to add additional backing information to the SkTraceMemoryDump. More...
 
- Protected Member Functions inherited from GrIORef< GrGpuResource >
bool isPurgeable () const
 
bool internalHasPendingRead () const
 
bool internalHasPendingWrite () const
 
bool internalHasPendingIO () const
 
bool internalHasRef () const
 

Private Types

enum  MipMapsStatus { kNotAllocated_MipMapsStatus, kAllocated_MipMapsStatus, kValid_MipMapsStatus }
 
typedef GrSurface INHERITED
 

Private Member Functions

void computeScratchKey (GrScratchKey *) const override
 Called by the registerWithCache if the resource is available to be used as scratch. More...
 
size_t onGpuMemorySize () const override
 
void dirtyMipMaps (bool mipMapsDirty)
 

Private Attributes

GrSLType fSamplerType
 
GrSamplerParams::FilterMode fHighestFilterMode
 
MipMapsStatus fMipMapsStatus
 
int fMaxMipMapLevel
 
SkDestinationSurfaceColorMode fMipColorMode
 

Friends

class GrTexturePriv
 

Additional Inherited Members

- Static Public Member Functions inherited from GrSurface
static size_t WorstCaseSize (const GrSurfaceDesc &desc, bool useNextPow2=false)
 
static size_t ComputeSize (GrPixelConfig config, int width, int height, int colorSamplesPerPixel, bool hasMIPMaps, bool useNextPow2=false)
 
- Static Public Member Functions inherited from GrGpuResource
static uint32_t CreateUniqueID ()
 
- Protected Types inherited from GrIORef< GrGpuResource >
enum  CntType
 

Member Function Documentation

GrTexture* GrTexture::asTexture ( )
inlineoverridevirtual
Returns
the texture associated with the surface, may be null.

Reimplemented from GrSurface.

void GrTexture::computeScratchKey ( GrScratchKey ) const
overrideprivatevirtual

Called by the registerWithCache if the resource is available to be used as scratch.

Resource subclasses should override this if the instances should be recycled as scratch resources and populate the scratchKey with the key. By default resources are not recycled as scratch.

Reimplemented from GrGpuResource.

virtual GrBackendObject GrTexture::getTextureHandle ( ) const
pure virtual

Return the native ID or handle to the texture, depending on the platform.

e.g. on OpenGL, return the texture ID.

GrTexturePriv GrTexture::texturePriv ( )
inline

Access methods that are only to be used within Skia code.


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