src/hbservers/hbthemeserver/hbsgimageiconprocessor_p.cpp
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 5 627c4a0fd0e7
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
    34 #include <VG/openvg.h>
    34 #include <VG/openvg.h>
    35 #include <cmath>
    35 #include <cmath>
    36 
    36 
    37 
    37 
    38 
    38 
    39 static HbNvgEngine nvgEngine;
       
    40 HbSgImageRenderer* HbSgimageIconProcessor::sgImageRenderer = HbSgImageRenderer::global();
    39 HbSgImageRenderer* HbSgimageIconProcessor::sgImageRenderer = HbSgImageRenderer::global();
    41 
    40 
    42 struct HbSgImageClosure
    41 struct HbSgImageClosure
    43 {
    42 {
    44     static inline void cleanup(RSgImage *sgImage)
    43     static inline void cleanup(RSgImage *sgImage)
   325     if (!topLeft.isNull()) {
   324     if (!topLeft.isNull()) {
   326         vgTranslate(topLeft.x(), topLeft.y());
   325         vgTranslate(topLeft.x(), topLeft.y());
   327     }
   326     }
   328 
   327 
   329     NvgAspectRatioSettings settings = mapKeyAspectRatioToNvgAspectRatio(aspectRatioMode);
   328     NvgAspectRatioSettings settings = mapKeyAspectRatioToNvgAspectRatio(aspectRatioMode);
   330     nvgEngine.setPreserveAspectRatio(settings.nvgAlignStatusAndAspectRatio, settings.type);
   329     sgImageRenderer->nvgEngine()->setPreserveAspectRatio(settings.nvgAlignStatusAndAspectRatio, settings.type);
   331     nvgEngine.enableMirroring(mirrored);
   330     sgImageRenderer->nvgEngine()->enableMirroring(mirrored);
   332 
   331 
   333     HbNvgEngine::HbNvgErrorType errorType = nvgEngine.drawNvg(byteArray, size);
   332     HbNvgEngine::HbNvgErrorType errorType = sgImageRenderer->nvgEngine()->drawNvg(byteArray, size);
   334     return errorType == HbNvgEngine::NvgErrNone;
   333     return errorType == HbNvgEngine::NvgErrNone;
   335 }
   334 }
   336 
   335