X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-factory-cache.cpp;h=03f31dec407a8b0ba5e63e02608875dbc201052c;hb=e2916ba0e2e9c92f2254d19f0890589cf77b2221;hp=248270b454cfe37f6b07a55e80206a01e657b736;hpb=1894ecb2c5bdcb91549d9da9d8301d0a753c5492;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/visual-factory-cache.cpp b/dali-toolkit/internal/visuals/visual-factory-cache.cpp index 248270b..03f31de 100644 --- a/dali-toolkit/internal/visuals/visual-factory-cache.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-cache.cpp @@ -17,11 +17,11 @@ // CLASS HEADER #include "visual-factory-cache.h" -// EXTERNAL HEADER +// EXTERNAL INCLUDES #include #include -// INTERNAL HEADER +// INTERNAL INCLUDES #include #include #include @@ -52,6 +52,11 @@ VisualFactoryCache::~VisualFactoryCache() Geometry VisualFactoryCache::GetGeometry( GeometryType type ) { + if( !mGeometry[type] && type == QUAD_GEOMETRY ) + { + mGeometry[type] = CreateQuadGeometry(); + } + return mGeometry[type]; } @@ -150,16 +155,6 @@ bool VisualFactoryCache::CleanRendererCache( const std::string& key ) return false; } -void VisualFactoryCache::CacheWireframeRenderer( Renderer& renderer ) -{ - mWireframeRenderer = renderer; -} - -Renderer VisualFactoryCache::GetWireframeRenderer() -{ - return mWireframeRenderer; -} - Geometry VisualFactoryCache::CreateQuadGeometry() { const float halfWidth = 0.5f; @@ -197,6 +192,11 @@ ImageAtlasManagerPtr VisualFactoryCache::GetAtlasManager() return mAtlasManager; } +NPatchLoader& VisualFactoryCache::GetNPatchLoader() +{ + return mNPatchLoader; +} + SvgRasterizeThread* VisualFactoryCache::GetSVGRasterizationThread() { if( !mSvgRasterizeThread ) @@ -284,49 +284,6 @@ Geometry VisualFactoryCache::CreateGridGeometry( Uint16Pair gridSize ) return geometry; } -Geometry VisualFactoryCache::CreateBatchQuadGeometry( Vector4 texCoords ) -{ - const float halfWidth = 0.5f; - const float halfHeight = 0.5f; - struct QuadVertex { - QuadVertex( const Vector2& vertexPosition, const Vector2& vertexTexCoords ) - : position( vertexPosition ), - texCoords( vertexTexCoords ) - {} - Vector2 position; - Vector2 texCoords; - }; - - // special case, when texture takes whole space - if( texCoords == Vector4::ZERO ) - { - texCoords = Vector4(0.0f, 0.0f, 1.0f, 1.0f); - } - - QuadVertex quadVertexData[6] = - { - QuadVertex( Vector2(-halfWidth, -halfHeight ), Vector2(texCoords.x, texCoords.y) ), - QuadVertex( Vector2( halfWidth, -halfHeight ), Vector2(texCoords.z, texCoords.y) ), - QuadVertex( Vector2(-halfWidth, halfHeight ), Vector2(texCoords.x, texCoords.w) ), - QuadVertex( Vector2( halfWidth, -halfHeight ), Vector2(texCoords.z, texCoords.y) ), - QuadVertex( Vector2(-halfWidth, halfHeight ), Vector2(texCoords.x, texCoords.w) ), - QuadVertex( Vector2( halfWidth, halfHeight ), Vector2(texCoords.z, texCoords.w) ), - }; - - Property::Map vertexFormat; - vertexFormat[ "aPosition" ] = Property::VECTOR2; - vertexFormat[ "aTexCoord" ] = Property::VECTOR2; - PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat ); - vertexBuffer.SetData( quadVertexData, 6 ); - - // create geometry as normal, single quad - Geometry geometry = Geometry::New(); - geometry.AddVertexBuffer( vertexBuffer ); - geometry.SetType( Geometry::TRIANGLES ); - - return geometry; -} - Image VisualFactoryCache::GetBrokenVisualImage() { return ResourceImage::New( BROKEN_VISUAL_IMAGE_URL );