void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op, BlendMode blendOp)
{
    if (paintingDisabled())
        return;

    cairo_operator_t cairo_op;
    if (blendOp == BlendModeNormal)
        cairo_op = toCairoOperator(op);
    else
        cairo_op = toCairoOperator(blendOp);

    cairo_set_operator(platformContext()->cr(), cairo_op);
}
void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op)
{
    if (paintingDisabled())
        return;

    cairo_set_operator(platformContext()->cr(), toCairoOperator(op));
}
void GraphicsContext::setCompositeOperation(CompositeOperator op)
{
    if (paintingDisabled())
        return;

    cairo_set_operator(m_data->cr, toCairoOperator(op));
}
void Image::drawPattern(GraphicsContext& context, const FloatRect& tileRect, const AffineTransform& patternTransform,
    const FloatPoint& phase, ColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendOp)
{
    RefPtr<cairo_surface_t> surface = nativeImageForCurrentFrame();
    if (!surface) // If it's too early we won't have an image yet.
        return;

    cairo_t* cr = context.platformContext()->cr();
    cairo_operator_t cairoOp;
    if (blendOp == BlendModeNormal)
        cairoOp = toCairoOperator(op);
    else
        cairoOp = toCairoOperator(blendOp);
    drawPatternToCairoContext(cr, surface.get(), IntSize(size()), tileRect, patternTransform, phase, cairoOp, destRect);

    if (imageObserver())
        imageObserver()->didDraw(this);
}
void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const AffineTransform& patternTransform,
                        const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator op, const FloatRect& destRect)
{
    cairo_surface_t* image = nativeImageForCurrentFrame();
    if (!image) // If it's too early we won't have an image yet.
        return;

    cairo_t* cr = context->platformContext()->cr();
    drawPatternToCairoContext(cr, image, size(), tileRect, patternTransform, phase, toCairoOperator(op), destRect);

    if (imageObserver())
        imageObserver()->didDraw(this);
}
Beispiel #6
0
void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const AffineTransform& patternTransform,
                        const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator op, const FloatRect& destRect)
{
    cairo_surface_t* image = nativeImageForCurrentFrame();
    if (!image) // If it's too early we won't have an image yet.
        return;

    cairo_t* cr = context->platformContext()->cr();
    drawPatternToCairoContext(cr, image, size(), tileRect, patternTransform, phase, toCairoOperator(op), destRect);

    if (imageObserver())
        imageObserver()->didDraw(this);

//+EAWebKitChange
//5/30/2012
#if ENABLE(IMAGE_COMPRESSION)
    // Check if this is a compressed surface.
    const void* pCompressedSurfaceUserData = cairo_surface_get_user_data (image, (cairo_user_data_key_t*) ImageCompressionGetUserDataKey());
    if (pCompressedSurfaceUserData)
        cairo_surface_destroy(image);
#endif
//-EAWebKitChange
}