Closed
Bug 869611
Opened 12 years ago
Closed 12 years ago
Stop reflowing in nsSVGPathGeometryFrame::NotifySVGChanged when transforms change
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: jwatt, Assigned: jwatt)
References
(Blocks 1 open bug)
Details
(Keywords: perf)
Attachments
(2 files)
4.61 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
649 bytes,
text/html
|
Details |
Right now nsSVGPathGeometryFrame::NotifySVGChanged schedules a reflow of itself without checking aFlags. This means that when aFlags is just set to TRANSFORM_CHANGED (i.e. a transform changed on an ancestor of the frame) it is unnecessarily reflowing. This is preventing us from benefiting from layers when transforms are animating on ancestors, which is a huge waste.
The only reason for us to reflow for a change on an ancestor at this point in the code is if the element's geometry has a percentage value that is resolved against the nearest coordinate context. (Note that we don't need to update the frames overflow rects for TRANSFORM_CHANGED since its only if the frame's _own_ transform changes that we need to do that.) I'll add some logic to expose that information and knock up a patch to make use of it.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #746579 -
Flags: review?(dholbert)
Assignee | ||
Comment 2•12 years ago
|
||
Further 5x speed-up on bug 852588 (Santa's Workshop).
Comment 3•12 years ago
|
||
Comment on attachment 746579 [details] [diff] [review]
patch
Generally looks good.
> bool
>+nsSVGPathGeometryElement::GeometryDependsOnCoordCtx() const
>+{
>+ // Check the nsSVGLength2 attribute
I think this wants to be "attributes" (plural)?
>+ LengthAttributesInfo info = const_cast<nsSVGPathGeometryElement*>(this)->GetLengthInfo();
The const / const_cast dance here is a bit hacky & seems unnecessary. There's only one caller, and it doesn't have a const-restricted pointer, so no need for this method to be const.
r=me with that
Attachment #746579 -
Flags: review?(dholbert) → review+
Comment 4•12 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #3)
> >+ LengthAttributesInfo info = const_cast<nsSVGPathGeometryElement*>(this)->GetLengthInfo();
>
> The const / const_cast dance here is a bit hacky & seems unnecessary.
> There's only one caller, and it doesn't have a const-restricted pointer, so
> no need for this method to be const.
Alternately, I think GetLengthInfo() can probably be made to be a const method. I'll give that a shot right now over in bug 869679... If you'd like to keep GeometryDependsOnCoordCtx as const and layer this on top of that bug (without the need for the hacky const_cast anymore), that's fine too. (assuming bug 869679 works out)
Comment 5•12 years ago
|
||
(Actually, disregard comment 4 -- GetLengthInfo can't be converted to const, as I just noted in bug 869679 comment 1, though we could probably add an alternate const version if it's useful enough. I'm not going to bother with that myself, but you may want to if you'd really like GeometryDependsOnCoordCtx to be const. :))
Comment 6•12 years ago
|
||
Here's a reduced testcase from the the "svg/as-image" reftests that currently fail, in builds with the patch applied.
This testcase is actually taken from the *reference* case (img-height-slice-1-ref.html) because that's what changes rendering when this patch is applied. (So that's for SVG in <embed>, not for SVG-as-an-image.)
Assignee | ||
Comment 7•12 years ago
|
||
Thanks, Daniel. This is actually fixed by my latest patch in bug 869781.
Comment 8•12 years ago
|
||
woot!
Assignee | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Assignee | ||
Comment 11•11 years ago
|
||
This more than doubled the performance of the Santa's Workshop demo (bug 852588) for me. Not too surprising really.
Assignee | ||
Comment 12•11 years ago
|
||
This sped up the IE Test Drive Helicopter demo quite substantially; for me it went from 15-20 "fps" to 30-35 "fps".
Blocks: 608495
You need to log in
before you can comment on or make changes to this bug.
Description
•