Bug 952977: Convert AutoMaskData to gfx::Matrix4x4 r=nical
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
#include "BufferUnrotate.h" // for BufferUnrotate
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "Layers.h" // for ThebesLayer, Layer, etc
|
||||
#include "gfxMatrix.h" // for gfxMatrix
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "gfxUtils.h" // for gfxUtils
|
||||
#include "mozilla/ArrayUtils.h" // for ArrayLength
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
|
||||
#include "LayersTypes.h"
|
||||
|
||||
struct gfxMatrix;
|
||||
struct nsIntSize;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -34,20 +34,20 @@ public:
|
||||
* been constructed.
|
||||
*/
|
||||
|
||||
void Construct(const gfxMatrix& aTransform,
|
||||
void Construct(const gfx::Matrix& aTransform,
|
||||
gfxASurface* aSurface);
|
||||
|
||||
void Construct(const gfxMatrix& aTransform,
|
||||
void Construct(const gfx::Matrix& aTransform,
|
||||
const SurfaceDescriptor& aSurface);
|
||||
|
||||
/** The returned surface can't escape the scope of |this|. */
|
||||
gfxASurface* GetSurface();
|
||||
const gfxMatrix& GetTransform();
|
||||
const gfx::Matrix& GetTransform();
|
||||
|
||||
private:
|
||||
bool IsConstructed();
|
||||
|
||||
gfxMatrix mTransform;
|
||||
gfx::Matrix mTransform;
|
||||
nsRefPtr<gfxASurface> mSurface;
|
||||
Maybe<AutoOpenSurface> mSurfaceOpener;
|
||||
|
||||
@@ -58,4 +58,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // GFX_AUTOMASKDATA_H_
|
||||
#endif // GFX_AUTOMASKDATA_H_
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
void
|
||||
AutoMaskData::Construct(const gfxMatrix& aTransform,
|
||||
AutoMaskData::Construct(const gfx::Matrix& aTransform,
|
||||
gfxASurface* aSurface)
|
||||
{
|
||||
MOZ_ASSERT(!IsConstructed());
|
||||
@@ -28,7 +28,7 @@ AutoMaskData::Construct(const gfxMatrix& aTransform,
|
||||
}
|
||||
|
||||
void
|
||||
AutoMaskData::Construct(const gfxMatrix& aTransform,
|
||||
AutoMaskData::Construct(const gfx::Matrix& aTransform,
|
||||
const SurfaceDescriptor& aSurface)
|
||||
{
|
||||
MOZ_ASSERT(!IsConstructed());
|
||||
@@ -46,7 +46,7 @@ AutoMaskData::GetSurface()
|
||||
return mSurfaceOpener.ref().Get();
|
||||
}
|
||||
|
||||
const gfxMatrix&
|
||||
const gfx::Matrix&
|
||||
AutoMaskData::GetTransform()
|
||||
{
|
||||
MOZ_ASSERT(IsConstructed());
|
||||
@@ -74,9 +74,9 @@ GetMaskData(Layer* aMaskLayer, AutoMaskData* aMaskData)
|
||||
DebugOnly<bool> maskIs2D = effectiveTransform.CanDraw2D(&transform);
|
||||
NS_ASSERTION(maskIs2D, "How did we end up with a 3D transform here?!");
|
||||
if (surface) {
|
||||
aMaskData->Construct(ThebesMatrix(transform), surface);
|
||||
aMaskData->Construct(transform, surface);
|
||||
} else {
|
||||
aMaskData->Construct(ThebesMatrix(transform), descriptor);
|
||||
aMaskData->Construct(transform, descriptor);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ PaintWithMask(gfxContext* aContext, float aOpacity, Layer* aMaskLayer)
|
||||
aContext->Paint(aOpacity);
|
||||
aContext->PopGroupToSource();
|
||||
}
|
||||
aContext->SetMatrix(mask.GetTransform());
|
||||
aContext->SetMatrix(ThebesMatrix(mask.GetTransform()));
|
||||
aContext->Mask(mask.GetSurface());
|
||||
return;
|
||||
}
|
||||
@@ -112,12 +112,12 @@ FillWithMask(gfxContext* aContext, float aOpacity, Layer* aMaskLayer)
|
||||
aContext->PushGroup(gfxContentType::COLOR_ALPHA);
|
||||
aContext->FillWithOpacity(aOpacity);
|
||||
aContext->PopGroupToSource();
|
||||
aContext->SetMatrix(mask.GetTransform());
|
||||
aContext->SetMatrix(ThebesMatrix(mask.GetTransform()));
|
||||
aContext->Mask(mask.GetSurface());
|
||||
} else {
|
||||
aContext->Save();
|
||||
aContext->Clip();
|
||||
aContext->SetMatrix(mask.GetTransform());
|
||||
aContext->SetMatrix(ThebesMatrix(mask.GetTransform()));
|
||||
aContext->Mask(mask.GetSurface());
|
||||
aContext->NewPath();
|
||||
aContext->Restore();
|
||||
|
||||
@@ -127,7 +127,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
||||
Matrix maskTransform;
|
||||
if (GetMaskData(aMaskLayer, &mask)) {
|
||||
maskSurface = mask.GetSurface();
|
||||
maskTransform = ToMatrix(mask.GetTransform());
|
||||
maskTransform = mask.GetTransform();
|
||||
}
|
||||
|
||||
if (!IsHidden() && !clipExtents.IsEmpty()) {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "BasicImplData.h" // for BasicImplData
|
||||
#include "BasicLayers.h" // for BasicLayerManager
|
||||
#include "gfx3DMatrix.h" // for gfx3DMatrix
|
||||
#include "gfxPoint.h" // for gfxPoint
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/gfx/BasePoint.h" // for BasePoint
|
||||
|
||||
Reference in New Issue
Block a user