{
bool pass = false;
+ if (!this->__useStableRenderer && alphaConstant >= 255 && !bitmap.__hasMaskingColor)
+ {
+ _Util::LockManager dstLock(*this);
+ SysTryReturnResult(NID_GRP, dstLock.IsValid(), E_OPERATION_FAILED, "The canvas cannot be locked.");
+
+ const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
+
+ {
+ _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
+ _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
+
+ pass = _Pixman::FlipPixmap(dstImage, *pFlippedImage, GetDrawingQuality(), GetCompositeMode(), point.x - clipRect.x, point.y - clipRect.y);
+ }
+ }
+
+ if(!pass)
{
_Util::LockManager dstLock(*this);
SysTryReturnResult(NID_GRP, dstLock.IsValid(), E_OPERATION_FAILED, "The canvas cannot be locked.\n");
return false;
}
+bool ClipPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, pixman_op_t rop, pixman_filter_t filter, pixman_repeat_t repeatMethod, int xDest, int yDest)
+{
+ 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> pPixmanSrc;
+ Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanMsk;
+
+ switch (srcImage.depth)
+ {
+ case 16:
+ 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_SRC)
+ {
+ 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
+ {
+ // 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));
+
+ if (pPixmanMsk == null)
+ {
+ return false;
+ }
+ }
+ }
+ break;
+ default:
+ return false;
+ }
+
+ if (pPixmanSrc)
+ {
+ pixman_image_set_repeat(pPixmanSrc, PIXMAN_REPEAT_NORMAL);
+ pixman_image_composite32(rop, pPixmanSrc, pPixmanMsk, pPixmanDst, 0, 0, 0, 0, xDest, yDest, srcImage.width, srcImage.height);
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
bool ResizePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapScalingQuality scalingQuality)
{
if (dstImage.width <= 0 || dstImage.height <= 0)
return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE);
}
+bool FlipPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest)
+{
+ if (dstImage.width <= 0 || dstImage.height <= 0)
+ {
+ return true;
+ }
+
+ pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(compositeMode);
+ pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality);
+
+ return ClipPixmap(dstImage, srcImage, rop, filter, PIXMAN_REPEAT_REFLECT, xDest, yDest);
+}
+
} // _Pixman
}} // Tizen::Graphics