mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 952977: Switch GeneratePath to gfx::Matrix r=nical
This commit is contained in:
parent
59faaf84bd
commit
4611bb78dd
@ -5,7 +5,6 @@
|
||||
|
||||
// Keep in (case-insensitive) order:
|
||||
#include "gfxContext.h"
|
||||
#include "gfxMatrix.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
@ -484,7 +483,7 @@ nsSVGImageFrame::ReflowSVG()
|
||||
gfxSize scaleFactors = GetCanvasTM(FOR_OUTERSVG_TM).ScaleFactors(true);
|
||||
bool applyScaling = fabs(scaleFactors.width) >= 1e-6 &&
|
||||
fabs(scaleFactors.height) >= 1e-6;
|
||||
gfxMatrix scaling;
|
||||
Matrix scaling;
|
||||
if (applyScaling) {
|
||||
scaling.Scale(scaleFactors.width, scaleFactors.height);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "SVGGraphicsElement.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
@ -248,7 +249,7 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
|
||||
nsRefPtr<gfxContext> tmpCtx =
|
||||
new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
|
||||
|
||||
GeneratePath(tmpCtx, canvasTM);
|
||||
GeneratePath(tmpCtx, ToMatrix(canvasTM));
|
||||
gfxPoint userSpacePoint =
|
||||
tmpCtx->DeviceToUser(gfxPoint(PresContext()->AppUnitsToGfxUnits(aPoint.x),
|
||||
PresContext()->AppUnitsToGfxUnits(aPoint.y)));
|
||||
@ -411,7 +412,7 @@ nsSVGPathGeometryFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
|
||||
nsRefPtr<gfxContext> tmpCtx =
|
||||
new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
|
||||
|
||||
GeneratePath(tmpCtx, ThebesMatrix(aToBBoxUserspace));
|
||||
GeneratePath(tmpCtx, aToBBoxUserspace);
|
||||
tmpCtx->IdentityMatrix();
|
||||
|
||||
// Be careful when replacing the following logic to get the fill and stroke
|
||||
@ -607,7 +608,7 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
||||
autoSaveRestore.SetContext(gfx);
|
||||
}
|
||||
|
||||
GeneratePath(gfx, GetCanvasTM(FOR_PAINTING, aTransformRoot));
|
||||
GeneratePath(gfx, ToMatrix(GetCanvasTM(FOR_PAINTING, aTransformRoot)));
|
||||
|
||||
// We used to call gfx->Restore() here, since for the
|
||||
// SVGAutoRenderState::CLIP case it is important to leave the fill rule
|
||||
@ -636,7 +637,7 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
||||
|
||||
gfxContextAutoSaveRestore autoSaveRestore(gfx);
|
||||
|
||||
GeneratePath(gfx, GetCanvasTM(FOR_PAINTING, aTransformRoot));
|
||||
GeneratePath(gfx, ToMatrix(GetCanvasTM(FOR_PAINTING, aTransformRoot)));
|
||||
|
||||
gfxTextContextPaint *contextPaint =
|
||||
(gfxTextContextPaint*)aContext->GetUserData(&gfxTextContextPaint::sUserDataKey);
|
||||
@ -656,7 +657,7 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
||||
|
||||
void
|
||||
nsSVGPathGeometryFrame::GeneratePath(gfxContext* aContext,
|
||||
const gfxMatrix &aTransform)
|
||||
const Matrix &aTransform)
|
||||
{
|
||||
if (aTransform.IsSingular()) {
|
||||
aContext->IdentityMatrix();
|
||||
@ -664,7 +665,7 @@ nsSVGPathGeometryFrame::GeneratePath(gfxContext* aContext,
|
||||
return;
|
||||
}
|
||||
|
||||
aContext->MultiplyAndNudgeToIntegers(aTransform);
|
||||
aContext->MultiplyAndNudgeToIntegers(ThebesMatrix(aTransform));
|
||||
|
||||
// Hack to let SVGPathData::ConstructPath know if we have square caps:
|
||||
const nsStyleSVG* style = StyleSVG();
|
||||
|
@ -98,7 +98,7 @@ protected:
|
||||
NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return false; }
|
||||
|
||||
protected:
|
||||
void GeneratePath(gfxContext *aContext, const gfxMatrix &aTransform);
|
||||
void GeneratePath(gfxContext *aContext, const Matrix &aTransform);
|
||||
|
||||
private:
|
||||
enum { eRenderFill = 1, eRenderStroke = 2 };
|
||||
|
Loading…
Reference in New Issue
Block a user