Bug 952977: Convert GetEffectiveTransform to gfx::Matrix4x4 r=nical

This commit is contained in:
David Zbarsky
2014-01-24 17:49:19 -08:00
parent b325701220
commit a54742d02b
26 changed files with 188 additions and 75 deletions

View File

@@ -160,7 +160,8 @@ public:
// transform.
bool Setup2DTransform()
{
const gfx3DMatrix& effectiveTransform = mLayer->GetEffectiveTransform();
gfx3DMatrix effectiveTransform;
To3DMatrix(mLayer->GetEffectiveTransform(), effectiveTransform);
// Will return an identity matrix for 3d transforms.
return effectiveTransform.CanDraw2D(&mTransform);
}
@@ -403,7 +404,9 @@ MarkLayersHidden(Layer* aLayer, const nsIntRect& aClipRect,
// global coordinate system.
if (aLayer->GetParent()) {
gfxMatrix tr;
if (aLayer->GetParent()->GetEffectiveTransform().CanDraw2D(&tr)) {
gfx3DMatrix effectiveTransform;
gfx::To3DMatrix(aLayer->GetParent()->GetEffectiveTransform(), effectiveTransform);
if (effectiveTransform.CanDraw2D(&tr)) {
// Clip rect is applied after aLayer's transform, i.e., in the coordinate
// system of aLayer's parent.
TransformIntRect(cr, tr, ToInsideIntRect);
@@ -422,7 +425,9 @@ MarkLayersHidden(Layer* aLayer, const nsIntRect& aClipRect,
if (!aLayer->AsContainerLayer()) {
gfxMatrix transform;
if (!aLayer->GetEffectiveTransform().CanDraw2D(&transform)) {
gfx3DMatrix effectiveTransform;
gfx::To3DMatrix(aLayer->GetEffectiveTransform(), effectiveTransform);
if (!effectiveTransform.CanDraw2D(&transform)) {
data->SetHidden(false);
return;
}
@@ -483,7 +488,9 @@ ApplyDoubleBuffering(Layer* aLayer, const nsIntRect& aVisibleRect)
// global coordinate system.
if (aLayer->GetParent()) {
gfxMatrix tr;
if (aLayer->GetParent()->GetEffectiveTransform().CanDraw2D(&tr)) {
gfx3DMatrix effectiveTransform;
gfx::To3DMatrix(aLayer->GetParent()->GetEffectiveTransform(), effectiveTransform);
if (effectiveTransform.CanDraw2D(&tr)) {
NS_ASSERTION(!tr.HasNonIntegerTranslation(),
"Parent can only have an integer translation");
cr += nsIntPoint(int32_t(tr.x0), int32_t(tr.y0));
@@ -983,7 +990,8 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
temp->Paint();
}
#endif
const gfx3DMatrix& effectiveTransform = aLayer->GetEffectiveTransform();
gfx3DMatrix effectiveTransform;
gfx::To3DMatrix(aLayer->GetEffectiveTransform(), effectiveTransform);
nsRefPtr<gfxASurface> result =
Transform3D(untransformedDT->Snapshot(), aTarget, bounds,
effectiveTransform, destRect);