Dali 3D User Interface Engine
List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Attributes
Dali::Internal::SceneGraph::TextureCache Class Reference

Caches textures. More...

#include <texture-cache.h>

Inheritance diagram for Dali::Internal::SceneGraph::TextureCache:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::SceneGraph::TextureCache:
Collaboration graph
[legend]

Public Member Functions

 TextureCache (RenderQueue &renderQueue, PostProcessResourceDispatcher &postProcessDispatcher, Context &context)
 Constructor. More...
 
 ~TextureCache ()
 Destructor. More...
 
void CreateTexture (ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, bool clearPixels)
 Creates a new empty texture object with the given dimensions. More...
 
void AddBitmap (ResourceId id, Integration::BitmapPtr bitmap)
 Add a bitmap to the texture cache. More...
 
void AddNativeImage (ResourceId id, NativeImageInterfacePtr nativeImage)
 Add a native image to the texture cache. More...
 
void AddFrameBuffer (ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat)
 Create a framebuffer texture and add it to the texture cache. More...
 
void AddFrameBuffer (ResourceId id, NativeImageInterfacePtr nativeImage)
 Create a framebuffer texture and add it to the texture cache. More...
 
void CreateGlTexture (ResourceId id)
 Create GL texture eagerly right now instead of waiting for first use. More...
 
void UpdateTexture (ResourceId id, Integration::BitmapPtr bitmap)
 Update the texture with a newly loaded bitmap. More...
 
void UpdateTexture (ResourceId id, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset)
 Update the texture with a newly loaded bitmap. More...
 
void UpdateTexture (ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset)
 Update the part of a texture with a newly loaded bitmap May be called from Update thread. More...
 
void UpdateTexture (ResourceId id, PixelDataPtr pixelData, std::size_t xOffset, std::size_t yOffset)
 Update the texture with a pixel buffer. More...
 
void UpdateTextureArea (ResourceId id, const RectArea &area)
 Update the area of the texture from the associated bitmap. More...
 
void DiscardTexture (ResourceId id)
 Discard texture associated with resource ID. More...
 
void BindTexture (Texture *texture, ResourceId id, GLenum target, TextureUnit textureunit)
 Bind a texture. More...
 
TextureGetTexture (ResourceId id)
 Get the texture associated with the resource ID May be a texture or a framebuffer. More...
 
BitmapTextureGetBitmapTexture (ResourceId id)
 Get the bitmaptexture associated with the resource ID. More...
 
FrameBufferTextureGetFramebuffer (ResourceId id)
 Get the framebuffer texture associated with the resource ID Used for writing to the framebuffer. More...
 
void AddObserver (ResourceId id, TextureObserver *observer)
 Add a texture observer. More...
 
void RemoveObserver (ResourceId id, TextureObserver *observer)
 Remove a texture observer. More...
 
void GlContextDestroyed ()
 Reset all textures. More...
 
void SetDiscardBitmapsPolicy (ResourcePolicy::Discardable policy)
 Set whether textures should retain or discard their bitmaps after upload to GL. More...
 
ResourcePolicy::Discardable GetDiscardBitmapsPolicy ()
 Get the discard policy. More...
 
- Public Member Functions inherited from Dali::Internal::SceneGraph::TextureCacheDispatcher
 TextureCacheDispatcher (RenderQueue &renderQueue)
 Constructor. More...
 
virtual ~TextureCacheDispatcher ()
 Virtual destructor; TextureCacheDispatcher is a base class. More...
 
void SetBufferIndices (const SceneGraphBuffers *bufferIndices)
 mRenderQueue needs the update buffer index when any of the dispatch methods are called. More...
 

Protected Member Functions

virtual void DispatchCreateTexture (ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, bool clearPixels)
 Dispatch a message to create an empty texture and add it to the texture cache. More...
 
virtual void DispatchCreateTextureForBitmap (ResourceId id, Integration::Bitmap *bitmap)
 Dispatch a message to add a texture for bitmap. More...
 
virtual void DispatchCreateTextureForNativeImage (ResourceId id, NativeImageInterfacePtr nativeImage)
 Dispatch a message to add a native image to the texture cache May be called from Update thread. More...
 
virtual void DispatchCreateGlTexture (ResourceId id)
 Create GL texture for native image resource. More...
 
virtual void DispatchCreateTextureForFrameBuffer (ResourceId id, unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferFormat)
  More...
 
virtual void DispatchCreateTextureForFrameBuffer (ResourceId id, NativeImageInterfacePtr nativeImage)
  More...
 
virtual void DispatchUpdateTexture (ResourceId id, Integration::Bitmap *bitmap)
 Dispatch a message to update the texture. More...
 
virtual void DispatchUpdateTexture (ResourceId id, Integration::BitmapPtr bitmap, std::size_t xOffset, std::size_t yOffset)
 Dispatch a message to update the texture. More...
 
virtual void DispatchUpdateTexture (ResourceId destId, ResourceId srcId, std::size_t xOffset, std::size_t yOffset)
 Dispatch a message to update the texture. More...
 
virtual void DispatchUpdateTexture (ResourceId destId, PixelDataPtr srcId, std::size_t xOffset, std::size_t yOffset)
 Dispatch a message to update the texture. More...
 
virtual void DispatchUpdateTextureArea (ResourceId id, const RectArea &area)
 Dispatch a message to update the texture area May be called from the Update thread. More...
 
virtual void DispatchDiscardTexture (ResourceId id)
 Dispatch a message to discard a texture May be called from Update thread. More...
 

Private Types

typedef std::vector
< TextureObserver * > 
TextureObservers
 
typedef TextureObservers::iterator TextureObserversIter
 
typedef std::map< ResourceId,
TextureObservers
TextureResourceObservers
 
typedef
TextureResourceObservers::iterator 
TextureResourceObserversIter
 

Private Attributes

PostProcessResourceDispatchermPostProcessResourceDispatcher
 
ContextmContext
 
TextureContainer mTextures
 
TextureContainer mFramebufferTextures
 
TextureResourceObservers mObservers
 
ResourcePolicy::Discardable mDiscardBitmapsPolicy
 

Additional Inherited Members

- Protected Attributes inherited from Dali::Internal::SceneGraph::TextureCacheDispatcher
RenderQueuemRenderQueue
 
const SceneGraphBuffersmSceneGraphBuffers
 

Detailed Description

Caches textures.

Owned by Render Thread

Definition at line 72 of file texture-cache.h.

Member Typedef Documentation

Definition at line 330 of file texture-cache.h.

typedef TextureObservers::iterator Dali::Internal::SceneGraph::TextureCache::TextureObserversIter
private

Definition at line 331 of file texture-cache.h.

Definition at line 333 of file texture-cache.h.

typedef TextureResourceObservers::iterator Dali::Internal::SceneGraph::TextureCache::TextureResourceObserversIter
private

Definition at line 334 of file texture-cache.h.

Constructor & Destructor Documentation

Dali::Internal::SceneGraph::TextureCache::TextureCache ( RenderQueue renderQueue,
PostProcessResourceDispatcher postProcessDispatcher,
Context context 
)

Constructor.

Parameters
[in]renderQueueQueue to use for dispatching messages to this object
[in]postProcessDispatcherDispatcher for resource post processing requests
[in]contextGL Context

Definition at line 77 of file texture-cache.cpp.

Dali::Internal::SceneGraph::TextureCache::~TextureCache ( )

Destructor.

Definition at line 87 of file texture-cache.cpp.

Member Function Documentation

void Dali::Internal::SceneGraph::TextureCache::AddBitmap ( ResourceId  id,
Integration::BitmapPtr  bitmap 
)

Add a bitmap to the texture cache.

Parameters
[in]idResource Id of the bitmap
[in]bitmapThe bitmap

Definition at line 103 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::IntrusivePtr< T >::Get(), GetDiscardBitmapsPolicy(), mContext, mTextures, and Dali::Internal::TextureFactory::NewBitmapTexture().

Referenced by DispatchCreateTextureForBitmap().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::AddFrameBuffer ( ResourceId  id,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
RenderBuffer::Format  bufferFormat 
)

Create a framebuffer texture and add it to the texture cache.

Parameters
[in]idResource Id of the native image
[in]widthWidth of the framebuffer
[in]heightHeight of the framebuffer
[in]pixelFormatPixel format of the framebuffer
[in]bufferFormatRenderbuffer format of the framebuffer

Definition at line 120 of file texture-cache.cpp.

References DALI_LOG_INFO, mContext, mFramebufferTextures, and Dali::Internal::TextureFactory::NewFrameBufferTexture().

Referenced by DispatchCreateTextureForFrameBuffer().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::AddFrameBuffer ( ResourceId  id,
NativeImageInterfacePtr  nativeImage 
)

Create a framebuffer texture and add it to the texture cache.

Parameters
[in]idResource Id of the native image
[in]nativeImageThe NativeImage

Definition at line 130 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::NativeImageInterface::GetHeight(), Dali::NativeImageInterface::GetWidth(), mContext, mFramebufferTextures, and Dali::Internal::TextureFactory::NewFrameBufferTexture().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::AddNativeImage ( ResourceId  id,
NativeImageInterfacePtr  nativeImage 
)

Add a native image to the texture cache.

Parameters
[in]idResource Id of the native image
[in]nativeImageThe native image

TODO - currently a new Texture is created even if we reuse the same NativeImage

Definition at line 111 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::IntrusivePtr< T >::Get(), mContext, mTextures, and Dali::Internal::TextureFactory::NewNativeImageTexture().

Referenced by DispatchCreateTextureForNativeImage().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::AddObserver ( ResourceId  id,
TextureObserver observer 
)

Add a texture observer.

Should be called in render thread

Parameters
[in]idThe resource id to watch
[in]observerThe observer to add

Definition at line 384 of file texture-cache.cpp.

References mObservers.

void Dali::Internal::SceneGraph::TextureCache::BindTexture ( Texture texture,
ResourceId  id,
GLenum  target,
TextureUnit  textureunit 
)

Bind a texture.

On the first call, the texture will copy it's pixel data to an OpenGL texture. If it's a BitmapTexture, then it will also trigger SignalUpdated to be sent on the event thread object.

Parameters
[in]texturepointer to the texture
[in]idResource id of texture
[in]target(e.g. GL_TEXTURE_2D)
[in]textureunitto use

Definition at line 303 of file texture-cache.cpp.

References Dali::Internal::Texture::Bind(), Dali::Internal::SceneGraph::PostProcessResourceDispatcher::DispatchPostProcessRequest(), mPostProcessResourceDispatcher, Dali::Internal::Texture::UpdateOnCreate(), and Dali::Internal::ResourcePostProcessRequest::UPLOADED.

Referenced by Dali::Internal::Render::Renderer::BindTextures(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::CreateGlTexture ( ResourceId  id)

Create GL texture eagerly right now instead of waiting for first use.

Parameters
[in]idThe resource id corresponding to the texture.

Definition at line 140 of file texture-cache.cpp.

References mTextures.

Referenced by DispatchCreateGlTexture().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::CreateTexture ( ResourceId  id,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
bool  clearPixels 
)

Creates a new empty texture object with the given dimensions.

Parameters
[in]widthThe width (pixels)
[in]heightThe height (pixels)
[in]pixelFormatThe pixel format
[in]clearPixelsTrue if the pixel data should be cleared first

Definition at line 91 of file texture-cache.cpp.

References DALI_LOG_INFO, GetDiscardBitmapsPolicy(), mContext, mTextures, and Dali::Internal::TextureFactory::NewBitmapTexture().

Referenced by DispatchCreateTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DiscardTexture ( ResourceId  id)

Discard texture associated with resource ID.

Parameters
[in]idResource Id of the texture

Definition at line 241 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::Internal::ResourcePostProcessRequest::DELETED, Dali::Internal::SceneGraph::PostProcessResourceDispatcher::DispatchPostProcessRequest(), mFramebufferTextures, mObservers, mPostProcessResourceDispatcher, mTextures, and Dali::Internal::TextureObserver::TextureDiscarded().

Referenced by DispatchDiscardTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchCreateGlTexture ( ResourceId  id)
protectedvirtual
void Dali::Internal::SceneGraph::TextureCache::DispatchCreateTexture ( ResourceId  id,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
bool  clearPixels 
)
protectedvirtual

Dispatch a message to create an empty texture and add it to the texture cache.

May be called from Update thread

Parameters
[in]idResource Id of the texture
[in]widthWidth of the texture
[in]heightHeight of the texture
[in]pixelFormatPixel format of the texture
[in]clearPixelsTrue if the data should be cleared to 0 on creation

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 452 of file texture-cache.cpp.

References CreateTexture(), Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, and Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchCreateTextureForBitmap ( ResourceId  id,
Integration::Bitmap bitmap 
)
protectedvirtual

Dispatch a message to add a texture for bitmap.

May be called from Update thread

Parameters
[in]idResource Id of the bitmap
[in]bitmapThe bitmap

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 471 of file texture-cache.cpp.

References AddBitmap(), Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, and Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchCreateTextureForFrameBuffer ( ResourceId  id,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
RenderBuffer::Format  bufferFormat 
)
protectedvirtual
void Dali::Internal::SceneGraph::TextureCache::DispatchCreateTextureForFrameBuffer ( ResourceId  id,
NativeImageInterfacePtr  nativeImage 
)
protectedvirtual
void Dali::Internal::SceneGraph::TextureCache::DispatchCreateTextureForNativeImage ( ResourceId  id,
NativeImageInterfacePtr  nativeImage 
)
protectedvirtual

Dispatch a message to add a native image to the texture cache May be called from Update thread.

Parameters
[in]idResource Id of the native image
[in]nativeImageThe native image

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 486 of file texture-cache.cpp.

References AddNativeImage(), Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, and Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchDiscardTexture ( ResourceId  id)
protectedvirtual
void Dali::Internal::SceneGraph::TextureCache::DispatchUpdateTexture ( ResourceId  id,
Integration::Bitmap bitmap 
)
protectedvirtual

Dispatch a message to update the texture.

May be called from Update thread

Parameters
[in]idResource Id of the texture
[in]bitmapThe updated bitmap

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 546 of file texture-cache.cpp.

References Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot(), and UpdateTexture().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchUpdateTexture ( ResourceId  id,
Integration::BitmapPtr  bitmap,
std::size_t  xOffset,
std::size_t  yOffset 
)
protectedvirtual

Dispatch a message to update the texture.

May be called from Update thread

Parameters
[in]idResource Id of the texture
[in]bitmapThe updated bitmap

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 561 of file texture-cache.cpp.

References Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot(), and UpdateTexture().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchUpdateTexture ( ResourceId  destId,
ResourceId  srcId,
std::size_t  xOffset,
std::size_t  yOffset 
)
protectedvirtual

Dispatch a message to update the texture.

May be called from Update thread

Parameters
[in]idResource Id of the texture
[in]bitmapThe updated bitmap

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 576 of file texture-cache.cpp.

References Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot(), and UpdateTexture().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchUpdateTexture ( ResourceId  destId,
PixelDataPtr  srcId,
std::size_t  xOffset,
std::size_t  yOffset 
)
protectedvirtual

Dispatch a message to update the texture.

May be called from Update thread

Parameters
[in]idResource Id of the texture
[in]bitmapThe updated bitmap

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 591 of file texture-cache.cpp.

References Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot(), and UpdateTexture().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::DispatchUpdateTextureArea ( ResourceId  id,
const RectArea area 
)
protectedvirtual

Dispatch a message to update the texture area May be called from the Update thread.

Parameters
[in]idResource Id of the texture
[in]areaThe area of the bitmap that has changed

Implements Dali::Internal::SceneGraph::TextureCacheDispatcher.

Definition at line 606 of file texture-cache.cpp.

References Dali::Internal::SceneGraph::SceneGraphBuffers::GetUpdateBufferIndex(), Dali::Internal::SceneGraph::TextureCacheDispatcher::mRenderQueue, Dali::Internal::SceneGraph::TextureCacheDispatcher::mSceneGraphBuffers, Dali::Internal::SceneGraph::RenderQueue::ReserveMessageSlot(), and UpdateTextureArea().

Here is the call graph for this function:

BitmapTexture * Dali::Internal::SceneGraph::TextureCache::GetBitmapTexture ( ResourceId  id)

Get the bitmaptexture associated with the resource ID.

Parameters
[in]idResource Id of the texture
Returns
The texture or NULL

Definition at line 345 of file texture-cache.cpp.

References Dali::IntrusivePtr< T >::Get(), and mTextures.

Referenced by UpdateTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

ResourcePolicy::Discardable Dali::Internal::SceneGraph::TextureCache::GetDiscardBitmapsPolicy ( )

Get the discard policy.

Returns
The discard policy.

Definition at line 442 of file texture-cache.cpp.

References mDiscardBitmapsPolicy.

Referenced by AddBitmap(), and CreateTexture().

Here is the caller graph for this function:

FrameBufferTexture * Dali::Internal::SceneGraph::TextureCache::GetFramebuffer ( ResourceId  id)

Get the framebuffer texture associated with the resource ID Used for writing to the framebuffer.

Parameters
[in]idResource Id of the framebuffer
Returns
the framebuffer

Definition at line 362 of file texture-cache.cpp.

References DALI_ASSERT_DEBUG, DALI_LOG_INFO, Dali::IntrusivePtr< T >::Get(), and mFramebufferTextures.

Referenced by Dali::Internal::SceneGraph::RenderManager::DoRender().

Here is the call graph for this function:

Here is the caller graph for this function:

Texture * Dali::Internal::SceneGraph::TextureCache::GetTexture ( ResourceId  id)

Get the texture associated with the resource ID May be a texture or a framebuffer.

Parameters
[in]idResource Id of the texture
Returns
NULL if the GL resource hasn't yet been created, or a valid pointer if it has.

Definition at line 313 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::IntrusivePtr< T >::Get(), mFramebufferTextures, and mTextures.

Referenced by Dali::Internal::Render::Renderer::BindTextures(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::GlContextDestroyed ( )

Reset all textures.

This method is called when context is or has been deleted.

Definition at line 429 of file texture-cache.cpp.

References Dali::Internal::SceneGraph::anonymous_namespace{texture-cache.cpp}::GlContextDestroyed(), mFramebufferTextures, and mTextures.

Referenced by Dali::Internal::SceneGraph::RenderManager::ContextDestroyed().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::RemoveObserver ( ResourceId  id,
TextureObserver observer 
)

Remove a texture observer.

Should be called in render thread

Parameters
[in]idThe resource id to stop watching
[in]observerThe observer to remove

Definition at line 412 of file texture-cache.cpp.

References mObservers.

void Dali::Internal::SceneGraph::TextureCache::SetDiscardBitmapsPolicy ( ResourcePolicy::Discardable  policy)

Set whether textures should retain or discard their bitmaps after upload to GL.

Parameters
[in]policyWhether to retain or discard bitmaps

Definition at line 435 of file texture-cache.cpp.

References DALI_LOG_INFO, mDiscardBitmapsPolicy, and Dali::ResourcePolicy::OWNED_DISCARD.

void Dali::Internal::SceneGraph::TextureCache::UpdateTexture ( ResourceId  id,
Integration::BitmapPtr  bitmap 
)

Update the texture with a newly loaded bitmap.

Parameters
[in]idResource Id of the bitmap
[in]bitmapThe bitmap

Definition at line 155 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::Internal::SceneGraph::PostProcessResourceDispatcher::DispatchPostProcessRequest(), Dali::IntrusivePtr< T >::Get(), mPostProcessResourceDispatcher, mTextures, and Dali::Internal::ResourcePostProcessRequest::UPLOADED.

Referenced by DispatchUpdateTexture(), and UpdateTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::TextureCache::UpdateTexture ( ResourceId  id,
Integration::BitmapPtr  bitmap,
std::size_t  xOffset,
std::size_t  yOffset 
)

Update the texture with a newly loaded bitmap.

Parameters
[in]idResource Id of the bitmap
[in]bitmapThe bitmap
[in]xOffsetSpecifies an offset in the x direction within the texture
[in]yOffsetSpecifies an offset in the y direction within the texture

Definition at line 174 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::Internal::SceneGraph::PostProcessResourceDispatcher::DispatchPostProcessRequest(), Dali::IntrusivePtr< T >::Get(), mPostProcessResourceDispatcher, mTextures, and Dali::Internal::ResourcePostProcessRequest::UPLOADED.

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::UpdateTexture ( ResourceId  destId,
ResourceId  srcId,
std::size_t  xOffset,
std::size_t  yOffset 
)

Update the part of a texture with a newly loaded bitmap May be called from Update thread.

Parameters
[in]destIdThe ID of the texture to update
[in]srcIdThe resource ID of the source bitmap
[in]xOffsetSpecifies an offset in the x direction within the texture
[in]yOffsetSpecifies an offset in the y direction within the texture

Definition at line 192 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::Internal::BitmapTexture::GetBitmap(), GetBitmapTexture(), and UpdateTexture().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::UpdateTexture ( ResourceId  id,
PixelDataPtr  pixelData,
std::size_t  xOffset,
std::size_t  yOffset 
)

Update the texture with a pixel buffer.

Parameters
[in]idResource Id of the bitmap
[in]pixelDataThe pixel data
[in]xOffsetSpecifies an offset in the x direction within the texture
[in]yOffsetSpecifies an offset in the y direction within the texture

Definition at line 205 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::Internal::SceneGraph::PostProcessResourceDispatcher::DispatchPostProcessRequest(), Dali::IntrusivePtr< T >::Get(), mPostProcessResourceDispatcher, mTextures, and Dali::Internal::ResourcePostProcessRequest::UPLOADED.

Here is the call graph for this function:

void Dali::Internal::SceneGraph::TextureCache::UpdateTextureArea ( ResourceId  id,
const RectArea area 
)

Update the area of the texture from the associated bitmap.

Parameters
[in]idResource Id of the bitmap
[in]areaThe area of the bitmap that has changed

Definition at line 223 of file texture-cache.cpp.

References DALI_LOG_INFO, Dali::Internal::SceneGraph::PostProcessResourceDispatcher::DispatchPostProcessRequest(), mPostProcessResourceDispatcher, mTextures, and Dali::Internal::ResourcePostProcessRequest::UPLOADED.

Referenced by DispatchUpdateTextureArea().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Context& Dali::Internal::SceneGraph::TextureCache::mContext
private

Definition at line 326 of file texture-cache.h.

Referenced by AddBitmap(), AddFrameBuffer(), AddNativeImage(), and CreateTexture().

ResourcePolicy::Discardable Dali::Internal::SceneGraph::TextureCache::mDiscardBitmapsPolicy
private

Definition at line 337 of file texture-cache.h.

Referenced by GetDiscardBitmapsPolicy(), and SetDiscardBitmapsPolicy().

TextureContainer Dali::Internal::SceneGraph::TextureCache::mFramebufferTextures
private
TextureResourceObservers Dali::Internal::SceneGraph::TextureCache::mObservers
private

Definition at line 336 of file texture-cache.h.

Referenced by AddObserver(), DiscardTexture(), and RemoveObserver().

PostProcessResourceDispatcher& Dali::Internal::SceneGraph::TextureCache::mPostProcessResourceDispatcher
private

Definition at line 325 of file texture-cache.h.

Referenced by BindTexture(), DiscardTexture(), UpdateTexture(), and UpdateTextureArea().

TextureContainer Dali::Internal::SceneGraph::TextureCache::mTextures
private

The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali