[Webkit-unassigned] [Bug 66114] Computing world-space transform for LayerChromium and CCLayerImpl

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 16 10:04:58 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66114





--- Comment #8 from Adrienne Walker <enne at google.com>  2011-08-16 10:04:58 PST ---
(From update of attachment 103999)
View in context: https://bugs.webkit.org/attachment.cgi?id=103999&action=review

> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:1087
> +        // FIXME: A more correct and efficient way to do this would be to transform
> +        //        a simple unit vector in the z-axis, instead of mapQuad.
> +        //        However, at this time there is no TransformationMatrix routine to transform mathematical
> +        //        vectors (where the 4th matrix column does not "translate" the vector, unlike points)

I don't understand this comment.

The normal of the layer in untransformed space is the z-axis (0, 0, 1, 0).  Multiplying that by a TransformationMatrix t into screen space gives you the vector (t.m13(), t.m23(), t.m33(), t.m43()).  To check if that vector is backfacing with respect to some plane, take the dot product of the normal of that plane with that vector.  In this case, we care about the xy plane, so the normal is the z-axis again.  Taking the dot product of these two vectors gives you the scalar quantity t.m33(), which if it's less than zero implies that the layer is backfacing with respect to the xy plane in screen space.

Is my math wrong here? You should just be able to simplify all of this with a "layer->worldSpaceDrawTransform().m33() < 0" test?

> Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h:223
> +    TransformationMatrix m_worldSpaceDrawTransform;

Bikeshedding nit: I know what you mean by "world space", but I don't think that's a useful term here.  It's also not a draw transform, because we're not drawing with it.  I think "screen space" or "device space" makes more sense to me.  Maybe jamesr has a preference here.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list