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)
+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;
pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality);
- pixman_transform_t transform;
- pixman_transform_init_identity(&transform);
- pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(-(xDest-0.5)), pixman_double_to_fixed(-(yDest-0.5)));
-
- return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE);
-}
-
-bool CopyPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, int wDest, int hDest)
-{
- if (dstImage.width <= 0 || dstImage.height <= 0)
+ switch (rop)
{
- return true;
- }
-
- pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(compositeMode);
-
- pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality);
-
- pixman_transform_t transform;
- pixman_transform_init_identity(&transform);
-
- pixman_region32_t clipRect, dstRect;
- pixman_region32_init_rect (&clipRect, xDest, yDest, wDest, hDest);
- pixman_region32_init_rect (&dstRect, 0, 0, dstImage.width, dstImage.height);
- pixman_region32_intersect (&dstRect, &clipRect, &dstRect);
+ case PIXMAN_OP_CLEAR:
+ case PIXMAN_OP_SRC:
+ {
+ int dstX1 = int(floor(xDest));
+ int dstX2 = int(ceil(xDest + srcImage.width));
+ int dstY1 = int(floor(yDest));
+ int dstY2 = int(ceil(yDest + srcImage.height));
+
+ Tizen::Graphics::_Util::Pixmap dstImageSub = dstImage.GetSubBitmap(dstX1, dstY1, dstX2 - dstX1, dstY2 - dstY1);
+ Tizen::Graphics::_Util::Pixmap srcImageSub = srcImage.GetSubBitmap((dstX1 >= 0) ? 0 : -dstX1, (dstY1 >= 0) ? 0 : -dstY1, srcImage.width, srcImage.height);
+
+ pixman_transform_t transform;
+ pixman_transform_init_identity(&transform);
+ pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(dstX1 -(xDest - 0.5)), pixman_double_to_fixed(dstY1 -(yDest - 0.5)));
+ return CompositePixmap(dstImageSub, srcImageSub, rop, filter, transform, PIXMAN_REPEAT_NONE);
+ }
+ default:
+ {
+ pixman_transform_t transform;
+ pixman_transform_init_identity(&transform);
+ pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(-(xDest - 0.5)), pixman_double_to_fixed(-(yDest - 0.5)));
- return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE, dstRect);
+ return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE);
+ }
+ }
}
bool ScalePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode)
pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(compositeMode);
pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality);
- pixman_transform_t transform = Tizen::Graphics::_Pixman::GetTransform(srcImage.width, srcImage.height, xDest-0.5, yDest-0.5, wDest, hDest);
-
- pixman_region32_t dstRect;
- pixman_region32_init_rect (&dstRect, 0, 0, dstImage.width, dstImage.height);
-
- return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE, dstRect);
-}
-
-bool ScalePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, int wDest, int hDest)
-{
- if (dstImage.width <= 0 || dstImage.height <= 0)
+ switch (rop)
{
- return true;
- }
+ case PIXMAN_OP_CLEAR:
+ case PIXMAN_OP_SRC:
+ {
+ int dstX1 = int(floor(xDest));
+ int dstY1 = int(floor(yDest));
+ int dstX2 = int(ceil(xDest + wDest));
+ int dstY2 = int(ceil(yDest + hDest));
- pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(compositeMode);
- pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality);
+ Tizen::Graphics::_Util::Pixmap dstImageSub = dstImage.GetSubBitmap(dstX1, dstY1, dstX2 - dstX1, dstY2 - dstY1);
+ Tizen::Graphics::_Util::Pixmap srcImageSub = srcImage.GetSubBitmap((dstX1 >= 0) ? 0 : int(-dstX1 * srcImage.width / wDest), (dstY1 >= 0) ? 0 : int(-dstY1 * srcImage.height / hDest), srcImage.width, srcImage.height);
- pixman_transform_t transform = Tizen::Graphics::_Pixman::GetTransform(srcImage.width, srcImage.height, dstImage.width, dstImage.height);
+ pixman_transform_t transform = Tizen::Graphics::_Pixman::GetTransform(srcImage.width, srcImage.height, (xDest - 0.5) - dstX1, (yDest - 0.5) - dstY1, wDest, hDest);
- pixman_region32_t clipRect, dstRect;
- pixman_region32_init_rect (&clipRect, xDest, yDest, wDest, hDest);
- pixman_region32_init_rect (&dstRect, 0, 0, dstImage.width, dstImage.height);
- pixman_region32_intersect (&dstRect, &clipRect, &dstRect);
+ return CompositePixmap(dstImageSub, srcImageSub, rop, filter, transform, PIXMAN_REPEAT_NONE);
+ }
+ default:
+ {
+ pixman_transform_t transform = Tizen::Graphics::_Pixman::GetTransform(srcImage.width, srcImage.height, xDest - 0.5, yDest - 0.5, wDest, hDest);
- return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE, dstRect);
+ return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE);
+ }
+ }
}
bool RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, double degree, double xPivot, double yPivot)