#include "svg-rasterize-thread.h"
// INTERNAL INCLUDES
-#include "nanosvg/nanosvgrast.h"
-#include "svg-renderer.h"
-
-namespace
-{
-const std::string TEXTURE_UNIFORM_NAME = "sTexture";
-}
+#include <dali-toolkit/third-party/nanosvg/nanosvgrast.h>
+#include <dali-toolkit/internal/controls/renderers/svg/svg-renderer.h>
namespace Dali
{
float scaleY = static_cast<float>( mHeight ) / mParsedSvg->height;
float scale = scaleX < scaleY ? scaleX : scaleY;
unsigned int bufferStride = mWidth*Pixel::GetBytesPerPixel( Pixel::RGBA8888 );
+ unsigned int bufferSize = bufferStride * mHeight;
- unsigned char* buffer = new unsigned char [bufferStride*mHeight];
+ unsigned char* buffer = new unsigned char [bufferSize];
nsvgRasterize(rasterizer, mParsedSvg, 0.f,0.f,scale,
buffer, mWidth, mHeight,
bufferStride );
- mPixelData = Dali::PixelData::New( buffer, mWidth, mHeight, Pixel::RGBA8888, Dali::PixelData::DELETE_ARRAY );
+ mPixelData = Dali::PixelData::New( buffer, bufferSize, mWidth, mHeight, Pixel::RGBA8888, Dali::PixelData::DELETE_ARRAY );
}
}
return mSvgRenderer.Get();
}
-PixelDataPtr RasterizingTask::GetPixelData() const
+PixelData RasterizingTask::GetPixelData() const
{
return mPixelData;
}
wasEmpty = mRasterizeTasks.empty();
if( !wasEmpty && task != NULL)
{
- // Remove the tasks with the same material.
- // Older task which waiting to rasterize and apply the svg to the same material is expired.
+ // Remove the tasks with the same renderer.
+ // Older task which waiting to rasterize and apply the svg to the same renderer is expired.
for( std::vector< RasterizingTaskPtr >::iterator it = mRasterizeTasks.begin(), endIt = mRasterizeTasks.end(); it != endIt; ++it )
{
if( (*it) && (*it)->GetSvgRenderer() == task->GetSvgRenderer() )