Bug 15721 - [CAIRO] Image transformations are broken
: [CAIRO] Image transformations are broken
Status: RESOLVED FIXED
: WebKit
New Bugs
: 523.x (Safari 3)
: All All
: P2 Normal
Assigned To:
: http://www.netzgesta.de/reflex/
: Cairo
:
:
  Show dependency treegraph
 
Reported: 2007-10-27 01:34 PST by
Modified: 2008-08-18 06:38 PST (History)


Attachments
CompositeOperator (1.36 KB, patch)
2008-06-16 14:23 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-10-27 01:34:40 PST
The transformed images at http://www.netzgesta.de/reflex/ do not render properly.

The culprit is probably incorrect pattern usage in the ImageCairo tiled drawing functions.
------- Comment #1 From 2008-06-10 09:36:06 PST -------
This seems fixed by now, probably should close this one...
------- Comment #2 From 2008-06-15 13:07:22 PST -------
(In reply to comment #1)
> This seems fixed by now, probably should close this one...

What about the backgrounds? They are all black.
Some reflections are rendered wrong (Reflections are missing if a image is transformed and the reflection is translated).
------- Comment #3 From 2008-06-16 07:53:06 PST -------
The black background is a problem of the CompositeOperator.
If you hardcode the CompositeOperator, the background is transparent:

-    if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))
-         context->setCompositeOperation(CompositeCopy);
-     else
-        context->setCompositeOperation(op);
+    cairo_set_operator(cr, CAIRO_OPERATOR_OVER);

For every single step the background is transparent.
Only the last operation takes a wrong CompositeOperator. Thats why the background is black. 
------- Comment #4 From 2008-06-16 14:23:43 PST -------
Created an attachment (id=21745) [details]
CompositeOperator

Is the if-clause in ImageCairo.cpp still necessary?

    if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))
         context->setCompositeOperation(CompositeCopy);
     else
        context->setCompositeOperation(op);

Other implementations don't change the CompositeOperator. And in this case it causes the black background. Why is it there?
------- Comment #5 From 2008-06-21 12:29:17 PST -------
(In reply to comment #2)
> Some reflections are rendered wrong (Reflections are missing if a image is
> transformed and the reflection is translated).

It could be a problem of path and clip in GraphicsContext.
------- Comment #6 From 2008-06-21 13:41:45 PST -------
Do http://developer.mozilla.org/samples/canvas-tutorial/5_4_canvas_scale.html and the wrong reflection of images with borders base on the same problem? 

Both are drawn with canvas and on both, parts of the drawing, is filled with the stroke-color of a line/border.
------- Comment #7 From 2008-06-28 08:13:44 PST -------
The main problem is solved. The problem with the borders is a problem with canvas. strokeStyle and fillStyle are saved to the same source pattern. 

I would mark this bug as a duplication of https://bugs.webkit.org/show_bug.cgi?id=19789 now.
------- Comment #8 From 2008-08-18 06:38:20 PST -------
Wrong border problem is fixed with https://bugs.webkit.org/show_bug.cgi?id=20405