src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.cpp
changeset 23 e6ad4ef83b23
parent 21 4633027730f5
child 28 b7da29130b0e
equal deleted inserted replaced
21:4633027730f5 23:e6ad4ef83b23
   126         isIconCreated = renderSvgToPixmap(iconPath);
   126         isIconCreated = renderSvgToPixmap(iconPath);
   127     } else if (iconType == "PIC") {
   127     } else if (iconType == "PIC") {
   128         isIconCreated = renderPicToPixmap(iconPath);
   128         isIconCreated = renderPicToPixmap(iconPath);
   129     } else if (iconType == "NVG") {
   129     } else if (iconType == "NVG") {
   130 #if defined (HB_NVG_CS_ICON)    
   130 #if defined (HB_NVG_CS_ICON)    
   131 		isIconCreated = renderNvgToPixmap(iconPath);
   131         isIconCreated = renderNvgToPixmap(iconPath);
   132 #endif //HB_NVG_CS_ICON
   132 #endif //HB_NVG_CS_ICON
   133     } else {
   133     } else {
   134         isIconCreated = renderOtherFormatsToPixmap(iconPath);
   134         isIconCreated = renderOtherFormatsToPixmap(iconPath);
   135     }
   135     }
   136     if (isIconCreated) {
   136     if (isIconCreated) {
   265     if (!iconKey.size.isValid()) {
   265     if (!iconKey.size.isValid()) {
   266         return isIconCreated;
   266         return isIconCreated;
   267     }
   267     }
   268 
   268 
   269     HbIconSource *source = HbThemeServerUtils::getIconSource(iconPath);
   269     HbIconSource *source = HbThemeServerUtils::getIconSource(iconPath);
   270     pixmap = *source->pixmap();
   270     pixmap = QPixmap::fromImage(*source->image());
   271 
   271 
   272     if (pixmap.isNull()) {
   272     if (pixmap.isNull()) {
   273         return isIconCreated;
   273         return isIconCreated;
   274     }
   274     }
   275 
   275 
   306         }
   306         }
   307     }
   307     }
   308     isIconCreated = true;
   308     isIconCreated = true;
   309 
   309 
   310     // Delete original pixmap if its size is large
   310     // Delete original pixmap if its size is large
   311     source->deletePixmapIfLargerThan(PIXMAP_SIZE_LIMIT);
   311     source->deleteImageIfLargerThan(IMAGE_SIZE_LIMIT);
   312 
   312 
   313     return isIconCreated;
   313     return isIconCreated;
   314 }
   314 }
   315 
   315 
   316 
   316 
   364 
   364 
   365                 QPixmap pixmap = QPixmap::fromImage((image));            
   365                 QPixmap pixmap = QPixmap::fromImage((image));            
   366                 painter.drawPixmap(multiPieceIconParams.multiPartIconData.targets[i].topLeft(), pixmap, pixmap.rect());
   366                 painter.drawPixmap(multiPieceIconParams.multiPartIconData.targets[i].topLeft(), pixmap, pixmap.rect());
   367             }
   367             }
   368 #if defined (HB_NVG_CS_ICON)
   368 #if defined (HB_NVG_CS_ICON)
   369 		}
   369         }
   370 #endif
   370 #endif
   371     }
   371     }
   372 
   372 
   373     painter.end();
   373     painter.end();
   374     if (multiPieceIconParams.mirrored) {
   374     if (multiPieceIconParams.mirrored) {
   493     }
   493     }
   494     
   494     
   495     //Copy the data from the surface
   495     //Copy the data from the surface
   496     err = VGICopyToTarget(format, stride, imageBuffer, 0, NULL, VGI_COPY_TRANSPARENT_PIXELS); 
   496     err = VGICopyToTarget(format, stride, imageBuffer, 0, NULL, VGI_COPY_TRANSPARENT_PIXELS); 
   497 #ifdef __DEBUG    
   497 #ifdef __DEBUG    
   498 	qDebug() << "error code for VGICopyToTarget()"<< err;
   498     qDebug() << "error code for VGICopyToTarget()"<< err;
   499 #endif
   499 #endif
   500     //Get Pixmap from the Qimage.
   500     //Get Pixmap from the Qimage.
   501     pixmap = QPixmap::fromImage(img);
   501     pixmap = QPixmap::fromImage(img);
   502     isIconCreated = true;    
   502     isIconCreated = true;    
   503         
   503