}
else
{
- premultipliedSrcImage.reset(srcImage.GetPremultipliedPixmap());
+ bool pass = false;
+ bool isInternalSolutionEnable = !((dstImage.width == srcImage.width) && (dstImage.height == srcImage.height) && pixman_transform_is_identity(&transform));
- if (premultipliedSrcImage.get())
+ if (isInternalSolutionEnable)
{
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, premultipliedSrcImage->width, premultipliedSrcImage->height, (uint32_t*)premultipliedSrcImage->pBitmap, premultipliedSrcImage->bytesPerLine));
- }
- else
- {
- // slow but it does not create additional buffer
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_x8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
- pPixmanMsk.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
+ premultipliedSrcImage.reset(srcImage.GetPremultipliedPixmap());
- if (pPixmanMsk == null)
+ if (premultipliedSrcImage.get())
{
- return false;
+ pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, premultipliedSrcImage->width, premultipliedSrcImage->height, (uint32_t*)premultipliedSrcImage->pBitmap, premultipliedSrcImage->bytesPerLine));
+ pass = true;
}
}
- }
- break;
- default:
- return false;
- }
-
- if (pPixmanSrc)
- {
- pixman_image_set_transform(pPixmanSrc, &transform);
- if (pPixmanMsk)
- {
- pixman_image_set_transform(pPixmanMsk, &transform);
- }
-
- pixman_image_set_filter(pPixmanSrc, filter, NULL, 0);
- pixman_image_set_repeat(pPixmanSrc, repeatMethod);
-
- if (rop == PIXMAN_OP_COPY)
- {
- rop = PIXMAN_OP_SRC;
- }
-
- pixman_image_composite32(pixman_op_t(rop), pPixmanSrc, pPixmanMsk, pPixmanDst, 0, 0, 0, 0, 0, 0, dstImage.width, dstImage.height);
-
- return true;
- }
- }
-
- return false;
-}
-
-bool __CompositePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, int rop, pixman_filter_t filter, pixman_transform_t transform, pixman_repeat_t repeatMethod, pixman_region32_t resultRect)
-{
- Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanDst;
-
- switch (dstImage.depth)
- {
- case 16:
- pPixmanDst.Bind(pixman_image_create_bits(PIXMAN_r5g6b5, dstImage.width, dstImage.height, (uint32_t*)dstImage.pBitmap, dstImage.bytesPerLine));
- break;
- case 32:
- pPixmanDst.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, dstImage.width, dstImage.height, (uint32_t*)dstImage.pBitmap, dstImage.bytesPerLine));
- break;
- default:
- return false;
- }
-
- if (pPixmanDst)
- {
- std::auto_ptr<Tizen::Graphics::_Util::Pixmap> premultipliedSrcImage;
-
- Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanMsk;
- Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanSrc;
-
- switch (srcImage.depth)
- {
- case 16:
- // color key is not supporting
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_r5g6b5, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
- break;
- case 32:
- if (srcImage.isPremultiplied || rop == PIXMAN_OP_COPY)
- {
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
- }
- else
- {
- premultipliedSrcImage.reset(srcImage.GetPremultipliedPixmap());
-
- if (premultipliedSrcImage.get())
- {
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, premultipliedSrcImage->width, premultipliedSrcImage->height, (uint32_t*)premultipliedSrcImage->pBitmap, premultipliedSrcImage->bytesPerLine));
- }
- else
+ if (!pass)
{
// slow but it does not create additional buffer
pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_x8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
pixman_image_set_filter(pPixmanSrc, filter, NULL, 0);
pixman_image_set_repeat(pPixmanSrc, repeatMethod);
- pixman_image_set_clip_region32 (pPixmanDst, &resultRect);
-
if (rop == PIXMAN_OP_COPY)
{
rop = PIXMAN_OP_SRC;