Closed Bug 930468 Opened 11 years ago Closed 11 years ago

Add a Moz2D version of SVGPathData::ConstructPath

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: jwatt, Assigned: jwatt)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

      No description provided.
Attached patch patchSplinter Review
Bas, can you review the use of the Moz2D API in this patch?
Attachment #821668 - Flags: review?
Attachment #821668 - Flags: review? → review?(bas)
Comment on attachment 821668 [details] [diff] [review]
patch

Cameron, can you look at the SVG changes?
Attachment #821668 - Flags: review?(cam)
Comment on attachment 821668 [details] [diff] [review]
patch

Review of attachment 821668 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/svg/content/src/SVGPathData.cpp
@@ +6,5 @@
>  #include "SVGPathData.h"
>  
>  #include "gfx2DGlue.h"
>  #include "gfxPlatform.h"
> +#include "mozilla/gfx/2D.h"

nit: None of this is needed since we now include 2D.h in the header.

@@ +255,5 @@
> +  // coordinates, we double this for |tinyAdvance|:
> +
> +  Matrix currentTransform = aDT->GetTransform();
> +  currentTransform.Invert();
> +  Size tinyAdvance = currentTransform * Size(2.0/256.0, 0.0);

nit: spaces around the / operator and let's use point.

::: content/svg/content/src/SVGPathData.h
@@ +11,5 @@
>  #include "nsIContent.h"
>  #include "nsINode.h"
>  #include "nsIWeakReferenceUtils.h"
> +#include "mozilla/gfx/2D.h"
> +#include "mozilla/RefPtr.h"

nit: You don't need this if you're including 2D.h
Attachment #821668 - Flags: review?(bas) → review+
Depends on: 930516
Depends on: 926258
Attachment #821668 - Flags: review?(cam) → review+
Depends on: 930564
I can't land this patch in its entirety just yet since we need Moz2D path measuring to work, and that isn't working on Mac jut yet. Bug 926258 will fix that.

We end up doing measuring from the path when, for example, we end up under this stack:

  mozilla::gfx::Path::ComputeLength
  gfxPath::GetLength
  mozilla::dom::SVGPathElement::GetPathLengthScale
  GetStrokeDashData
  nsSVGUtils::SetupCairoStrokeGeometry
  nsSVGUtils::SetupCairoStroke
  nsSVGPathGeometryFrame::Render
  nsSVGPathGeometryFrame::PaintSVG
Blocks: 930577
No longer depends on: 926258
I span out the enabling part of the patch into bug 930577 and landed the rest:

https://hg.mozilla.org/integration/mozilla-inbound/rev/075fc0110d9f
Summary: Stop SVGPathData::ToPath from expecting a device space path from Moz2D by adding and using a Moz2D version of SVGPathData::ConstructPath → Add a Moz2D version of SVGPathData::ConstructPath
Blocks: 703159
The WinXP crashes were caused by bug 930516. Relanded:

https://hg.mozilla.org/integration/mozilla-inbound/rev/2b98c52e5e08
https://hg.mozilla.org/mozilla-central/rev/2b98c52e5e08
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: