Closed Bug 689504 Opened 13 years ago Closed 2 years ago

Reflow + thebesLayer content repaint happening all the time while rendering morphing cubes

Categories

(Core :: Layout, defect)

x86
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: romaxa, Unassigned)

References

()

Details

Attachments

(1 file)

Checked optofile for morphing cubes and found that we repainting thebesLayer content on every cubes motion...: #16 0x3baacd48 in _cairo_image_surface_fill (abstract_surface=0x436da8d0, op=CAIRO_OPERATOR_OVER, source=0xaec0bf18, path=0x3c36100c, fill_rule=CAIRO_FILL_RULE_WINDING, tolerance=-0.56250028610229497, antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0xaec0be88) at gfx/cairo/cairo/src/cairo-image-surface.c:3759 #17 0x3bac1ac4 in _cairo_surface_fill (surface=0x436da8d0, op=CAIRO_OPERATOR_OVER, source=0xaec0bf18, path=0x3c36100c, fill_rule=CAIRO_FILL_RULE_WINDING, tolerance=-0.56250028610229497, antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0xaec0c020) at gfx/cairo/cairo/src/cairo-surface.c:2348 #18 0x3baa5e6c in _cairo_gstate_fill (gstate=0x3c360eb0, path=0x3c36100c) at gfx/cairo/cairo/src/cairo-gstate.c:1290 #19 0x3ba9adcc in _moz_cairo_fill_preserve (cr=0x3c360d38) at gfx/cairo/cairo/src/cairo.c:2459 #20 0x3afd8ac8 in nsCSSRendering::PaintGradient (aPresContext=<value optimized out>, aRenderingContext=<value optimized out>, aGradient=<value optimized out>, aDirtyRect=<value optimized out>, aOneCellArea=..., aFillArea=...) at layout/base/nsCSSRendering.cpp:2223 #21 0x3afd8c18 in ImageRenderer::Draw (this=0xaec0c598, aPresContext=0x419d7800, aRenderingContext=..., aDest=..., aFill=..., aAnchor=..., aDirty=...) ---Type <return> to continue, or q <return> to quit--- at layout/base/nsCSSRendering.cpp:4173 #22 0x3afd9e90 in nsCSSRendering::PaintBackgroundWithSC (aPresContext=0x419d7800, aRenderingContext=<value optimized out>, aForFrame=0x4363b048, aDirtyRect=<value optimized out>, aBorderArea=..., aBackgroundSC=0x3afd9f94, aBorder=..., aFlags=1130607008, aBGClipRect=0x4363b0a0) at layout/base/nsCSSRendering.cpp:2453 #23 0x3afd9f94 in nsCSSRendering::PaintBackground (aPresContext=0x419d7800, aRenderingContext=..., aForFrame=0x4363b048, aDirtyRect=..., aBorderArea=..., aFlags=4, aBGClipRect=0x0) at layout/base/nsCSSRendering.cpp:1490 #24 0x3b01d564 in nsButtonFrameRenderer::PaintBorderAndBackground (this=0x4363b090, aPresContext=0x419d7800, aRenderingContext=..., aDirtyRect=..., aRect=..., aBGFlags=4) at layout/forms/nsButtonFrameRenderer.cpp:270 #25 0x3b01d608 in nsDisplayButtonBorderBackground::Paint (this=0x4394c650, aBuilder=0xaec0d6e0, aCtx=0x4313ca40) at layout/forms/nsButtonFrameRenderer.cpp:185 #26 0x3afbe6d4 in mozilla::FrameLayerBuilder::DrawThebesLayer (aLayer=<value optimized out>, aContext=0x419233e0, aRegionToDraw=<value optimized out>, aRegionToInvalidate=<value optimized out>, aCallbackData=0xaec0d6e0) at layout/base/FrameLayerBuilder.cpp:2143 #27 0x3ba332fc in mozilla::layers::BasicThebesLayer::PaintBuffer (this=0x406bc360, aContext=0xffffff70, aRegionToDraw=<value optimized out>, aExtendedRegionToDraw=..., aRegionToInvalidate=..., aDidSelfCopy=0, aCallback=0xffffffff, aCallbackData=0xaec0d6e0) at gfx/layers/basic/BasicLayers.cpp:555 ---Type <return> to continue, or q <return> to quit--- #28 0x3ba3b670 in mozilla::layers::BasicShadowableThebesLayer::PaintBuffer (this=0xffffff2c, aContext=0xffffff70, aRegionToDraw=..., aExtendedRegionToDraw=..., aRegionToInvalidate=..., aDidSelfCopy=0, aCallback=0x3afbe108 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, aCallbackData=0xaec0d6e0) at gfx/layers/basic/BasicLayers.cpp:2273 #29 0x3ba39d20 in mozilla::layers::BasicThebesLayer::PaintThebes (this=0x406bc360, aContext=0x41923270, aCallback=0x3afbe108 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, aCallbackData=0xaec0d6e0, aReadback=0x1) at gfx/layers/basic/BasicLayers.cpp:739 #30 0x3ba3a2d8 in mozilla::layers::BasicLayerManager::PaintLayer (this=0x406cd400, aTarget=0x41923270, aLayer=0x406bc360, aCallback=<value optimized out>, aCallbackData=0xaec0d6e0, aReadback=0xaec0d3a0) at gfx/layers/basic/BasicLayers.cpp:1891 #31 0x3ba3a33c in mozilla::layers::BasicLayerManager::PaintLayer (this=0x406cd400, aTarget=0x41923270, aLayer=0x406b4220, aCallback=<value optimized out>, aCallbackData=0xaec0d6e0, aReadback=0x0) at gfx/layers/basic/BasicLayers.cpp:1903 #32 0x3ba3ade0 in mozilla::layers::BasicLayerManager::EndTransactionInternal (this=0x406cd400, aCallback=0x3afbe108 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, aCallbackData=0xaec0d6e0, aFlags=<value optimized out>) at gfx/layers/basic/BasicLayers.cpp:1616 #33 0x3ba3ae6c in mozilla::layers::BasicShadowLayerManager::EndTransaction (this=0xffffff2c, aCallback=0xffffff70, aCallbackData=0xaec0adb8, aFlags=514932) at gfx/layers/basic/BasicLayers.cpp:3262 ---Type <return> to continue, or q <return> to quit--- #34 0x3afe5918 in nsDisplayList::PaintForFrame (this=0xaec0dab0, aBuilder=0xaec0d6e0, aCtx=<value optimized out>, aForFrame=0x43150430, aFlags=2931873504) at layout/base/nsDisplayList.cpp:627 #35 0x3afe5998 in nsDisplayList::PaintRoot (this=<value optimized out>, aBuilder=0xffffff70, aCtx=<value optimized out>, aFlags=<value optimized out>) at layout/base/nsDisplayList.cpp:538 #36 0x3affcc54 in nsLayoutUtils::PaintFrame (aRenderingContext=<value optimized out>, aFrame=0x43150430, aDirtyRegion=<value optimized out>, aBackstop=<value optimized out>, aFlags=260) at layout/base/nsLayoutUtils.cpp:1697 #37 0x3b0147c0 in PresShell::Paint (this=0x406b4380, aViewToPaint=<value optimized out>, aWidgetToPaint=<value optimized out>, aDirtyRegion=..., aIntDirtyRegion=..., aPaintDefaultBackground=993272380, aWillSendDidPaint=0) at layout/base/nsPresShell.cpp:5382 #38 0x3b34223c in nsViewManager::RenderViews (this=0x5, aView=<value optimized out>, aWidget=<value optimized out>, aRegion=<value optimized out>, aIntRegion=..., aPaintDefaultBackground=0, aWillSendDidPaint=0) at view/src/nsViewManager.cpp:416 #39 0x3b34232c in nsViewManager::Refresh (this=0x41939d40, aView=0x4060d970, aWidget=0x4064c5c0, aRegion=..., aUpdateFlags=1) at view/src/nsViewManager.cpp:391 #40 0x3b343410 in nsViewManager::DispatchEvent (this=0x41939d40, aEvent=0xaec0de18, aView=0x4060d970, aStatus=<value optimized out>) at view/src/nsViewManager.cpp:894 #41 0x3b33fc94 in HandleEvent (aEvent=0xaec0de18) at view/src/nsView.cpp:159 ---Type <return> to continue, or q <return> to quit---
Tested with patches from bug 524925, and it seems that those patches are fixing half of repaints for 3d transforms
Component: DOM: CSS Object Model → Layout
QA Contact: style-system → layout
Depends on: 524925
Here is one more paint backtrace which is happening on morphing-cubes even with patches from bug 524925 applied: 10 0x3ba9b90c in _moz_cairo_fill_preserve (cr=0x3c361308) at gfx/cairo/cairo/src/cairo.c:2459 #11 0x3afb2690 in nsRenderingContext::FillRect (this=0x4312f2c0, aRect=...) ---Type <return> to continue, or q <return> to quit--- at gfx/src/nsRenderingContext.cpp:366 #12 0x3b05e9d8 in nsDisplayCanvasBackground::Paint (this=0x44a0b810, aBuilder=0xaeafd6e0, aCtx=0x4312f2c0) at layout/generic/nsCanvasFrame.cpp:261 #13 0x3afbeb54 in mozilla::FrameLayerBuilder::DrawThebesLayer (aLayer=<value optimized out>, aContext=0x42b727c0, aRegionToDraw=<value optimized out>, aRegionToInvalidate=<value optimized out>, aCallbackData=0xaeafd6e0)
Not 100% sure, but it seems like some morphing cubes elements disappeared or not re-painted correctly with patches from bug 524925
Still see lot of reflow for this test using latest m-c, also http://romaxa.info/css3d/poster/poster-circle.html - very very slow
Attached file callgraph oprofile (deleted) —
I took latest m-c with patch from cjones (http://hg.mozilla.org/users/cjones_mozilla.com/mcmq/file/6d862bfdd1e7/invalid) + patches from 719177 And still see each poster circle plane repainted on each frame
Try to reduce the test case as much as you can. That helps roc and his team identifying the cause.
http://romaxa.info/tests/Carousel1.html - minimized testcase. Change hint backtraces: #0 nsCSSFrameConstructor::ProcessRestyledFrames (this=0x4298ea00, aChangeList=...) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:7990 #1 0x3aff34a4 in nsCSSFrameConstructor::RestyleElement (this=0x4298ea00, aElement=<value optimized out>, aPrimaryFrame=0x43b28908, aMinHint=0, aRestyleTracker=..., aRestyleDescendants=false) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:8091 #2 0x3afe1d3c in mozilla::css::RestyleTracker::ProcessOneRestyle (this=0x4298eb40, aElement=0x4, aRestyleHint=<value optimized out>, aChangeHint=0) at /home/rootfslayout/base/RestyleTracker.cpp:157 #3 0x3afe23b0 in mozilla::css::RestyleTracker::DoProcessRestyles (this=0x4298eb40) at /home/rootfslayout/base/RestyleTracker.cpp:242 #4 0x3aff33f4 in nsCSSFrameConstructor::ProcessPendingRestyles (this=0x4298ea00) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:11664 #0 DoApplyRenderingChangeToTree (aFrame=0x43b28908, aFrameManager=0x4298ea00, aChange=2560) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:7691 #1 0x3aff30b0 in ApplyRenderingChangeToTree (this=0x4298ea00, aChangeList=...) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:7747 #2 nsCSSFrameConstructor::ProcessRestyledFrames (this=0x4298ea00, aChangeList=...) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:7990 #3 0x3aff34a4 in nsCSSFrameConstructor::RestyleElement (this=0x4298ea00, aElement=<value optimized out>, aPrimaryFrame=0x43b28908, aMinHint=0, aRestyleTracker=..., aRestyleDescendants=false) at /home/rootfslayout/base/nsCSSFrameConstructor.cpp:8091 #4 0x3afe1d3c in mozilla::css::RestyleTracker::ProcessOneRestyle (this=0x4298eb40, aElement=0x4298ea00, aRestyleHint=<value optimized out>, aChangeHint=0) at /home/rootfslayout/base/RestyleTracker.cpp:157 #5 0x3afe23b0 in mozilla::css::RestyleTracker::DoProcessRestyles (this=0x4298eb40)
Ok I've found two problems which are causing perf problems with morphing cubes: 1) when animation reach window edges we have thebes layers resizing problem and re-invalidation - sounds like nsDisplayTransform::ShouldPrerenderTransformedContent does not work very well 2) after attempts to fit animation into view and avoid problem 1), I got another problem that with certain layout resolution values like: 1.08506429 - we again have extra invalidations coming from somewhere else.
Hmm, somehow not able to reproduce problem with resolution, but problem with thebesLayer cropping easily visible on http://romaxa.info/tests/morphing-cubes1.html
On more observation: with reduced poster-circle testcase I've found that while frame haz z value < 0 then it does not repaint thebes layer, when it is coming to the front (z > relative 0) it start invalidations
tracked down reflow calls, and found that main reason here is scrollFrame resizing nsGfxScrollFrameInner::UpdateOverflow ->nsGfxScrollFrame.cpp:3329
Ok, so summary here is: 1) nsGfxScrollFrameInner::UpdateOverflow - causing invalidate and thebesRepaint 2) Complex transforms like poster circle make nsDisplayTransform::ShouldPrerenderTransformedContent not working 3) With some certain conditions we churning ThebesLayers even if whole CSS3 animation scene inside visible view area.
Severity: normal → S3

I can't find direct archives of any of these test cases.

However I'm pretty sure this bug is about this test case from an old WebKit blogpost, which performs well now.

Closing.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: