Status: Untriaged
Owner: [email protected]
Labels: Type-Bug Pri-2 OS-All Area-WebKit Area-Compat

New issue 8635 by [email protected]: We don't apply use Pattern's   
TransformationMatrix in SVG (and other places?)
http://code.google.com/p/chromium/issues/detail?id=8635

The test case LayoutTests/svg/custom/pattern-y-offset.svg fails and will
continue to fail until some pretty big changes are made to PatternSkia and  
to
GraphicsContextSkia.

So the above SVG test case defines the following pattern:

     <pattern id="patternUserSpace" patternUnits="userSpaceOnUse"
patternContentUnits="userSpaceOnUse" x="20" y="20" width="50" height="30">
       <rect x="0" y="0" width="50" height="30" fill="blue" stroke="green"/>
     </pattern>

The corresponding WebCore::Patern::m_patternSpaceTransformation member is no
longer the identity matrix, and we do not apply this space transformation in
our implementation of Pattern::createPlatformPattern().

PatternCG.cpp, of the CoreGraphics implementation includes the following  
code
in their Pattern::createPlatformPattern() that we don't:

     TransformationMatrix patternTransform = m_patternSpaceTransformation;
     patternTransform.multiply(userSpaceTransformation);
     patternTransform.scaleNonUniform(1, -1);
     patternTransform.translate(0, -tileRect.height());

...which applies the local transformation matrix, the pattern's  
transformation
matrix and I'm not sure about the rest. Naively adding that code to the
beginning of PatternSkia.cpp's Pattern::createPlatformPattern() and then
setting that as skia's local matrix for the returned SkShader object makes  
LayoutTests/svg/custom/pattern-y-offset.svg render the same as Safari 4, but
introduces crashes in other cases because Skia already has its own  
SkMatrixies
that are sprinkled all over GraphicsContextSkia (and I assume elsewhere).

GraphicsContextSkia has a whole bunch of static isXXXSkiaSafe functions with
comments saying that they're preventing Skia from crashing because  
apparently
skia doesn't check its input. This is probably where the crashes are coming
from when I add a local transformation matrix.

(Note: We used to apply *a* local transformation matrix (though I'm not  
sure it
was the correct one) until http://codereview.chromium.org/17365).

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to