New tab creation re-renders the tab just obscured

RESOLVED INCOMPLETE

Status

()

Core
Layout: View Rendering
RESOLVED INCOMPLETE
9 years ago
6 years ago

People

(Reporter: Adam Jackson, Unassigned)

Tracking

({perf})

1.9.1 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4) Gecko/20090427 Fedora/3.5-0.20.beta4.fc11 Firefox/3.5b4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4) Gecko/20090427 Fedora/3.5-0.20.beta4.fc11 Firefox/3.5b4

Start firefox, and navigate to some page with excessively tall content; the one in the URL field for this bug will do fine.  Attach to it with gdb, and do:

(gdb) set height 0
(gdb) break XCreatePixmap
Breakpoint 1 at 0x7a9ba7: file CrPixmap.c, line 52.
(gdb) commands
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>if height < 4096
 >cont
 >end
>end

Then create a new tab with control-t, and check out where you break:

Breakpoint 1, XCreatePixmap (dpy=0xb7c0d800, d=249, width=1426, height=23032, depth=24) at CrPixmap.c:52
52	    LockDisplay(dpy);
(gdb) bt
#0  XCreatePixmap (dpy=0xb7c0d800, d=249, width=1426, height=23032, depth=24) at CrPixmap.c:52
#1  0x03071a73 in IA__gdk_pixmap_new (drawable=0xb7c73040, width=1426, height=23032, depth=24) at gdkpixmap-x11.c:175
#2  0x03d11995 in gfxPlatformGtk::CreateOffscreenSurface (this=0xb61afb98, size=@0xbfc20fec, 
    imageFormat=gfxASurface::ImageFormatRGB24) at gfxPlatformGtk.cpp:198
#3  0x03bf7af7 in nsThebesImage::Draw (this=0xaf81be80, aContext=0xaffa5fb0, aUserSpaceToImageSpace=<value optimized out>, 
    aFill=@0xbfc2117c, aPadding=@0xbfc2121c, aSubimage=@0xbfc2125c) at nsThebesImage.cpp:619
#4  0x0355c5e6 in DrawImageInternal(struct nsIRenderingContext *, struct nsIImage *, const nsRect &, const nsRect &, const nsPoint &, const nsRect &, const nsIntSize &, const nsIntRect &) (aRenderingContext=<value optimized out>, 
    aImage=<value optimized out>, aDest=@0xbfc21424, aFill=@0xbfc21414, aAnchor=@0xbfc214ac, aDirty=@0xbfc21474, 
    aImageSize=@0xbfc21324, aInnerRect=@0xbfc21308) at nsLayoutUtils.cpp:2825
#5  0x0355cb20 in nsLayoutUtils::DrawImage (aRenderingContext=0xb0cf2900, aImage=0xafab9040, aDest=@0xbfc21424, 
    aFill=@0xbfc21414, aAnchor=@0xbfc214ac, aDirty=@0xbfc21474) at nsLayoutUtils.cpp:2923
#6  0x03543d1a in nsCSSRendering::PaintBackgroundWithSC (aPresContext=0xb2cc4000, aRenderingContext=@0xb0cf2900, aForFrame=
    0xaffb17fc, aDirtyRect=@0xbfc216c8, aBorderArea=@0xbfc2159c, aColor=@0xaff21a08, aBorder=@0xaffb175c, 
    aUsePrintSettings=1, aBGClipRect=0xbfc215bc) at nsCSSRendering.cpp:1513
#7  0x03543e12 in nsCSSRendering::PaintBackground (aPresContext=0xb2cc4000, aRenderingContext=@0xb0cf2900, 
    aForFrame=0xaffb17fc, aDirtyRect=@0xbfc216c8, aBorderArea=@0xbfc2159c, aUsePrintSettings=1, aBGClipRect=0xbfc215bc)
    at nsCSSRendering.cpp:1190
#8  0x0359f029 in nsDisplayCanvasBackground::Paint (this=0xaf704010, aBuilder=0xbfc216e8, aCtx=0xb0cf2900, 
    aDirtyRect=@0xbfc216c8) at nsHTMLFrame.cpp:449
#9  0x0354d319 in nsDisplayList::Paint (this=0xbfc216e0, aBuilder=0xbfc216e8, aCtx=0xb0cf2900, aDirtyRect=@0xbfc216c8)
    at nsDisplayList.cpp:311
#10 0x03569661 in PresShell::RenderDocument (this=0xb2d65c00, aRect=<value optimized out>, aUntrusted=0, 
    aIgnoreViewportScrolling=1, aBackgroundColor=4294967295, aThebesContext=0xaffa5fb0) at nsPresShell.cpp:5014
#11 0x03706078 in nsCanvasRenderingContext2D::DrawWindow (this=0xb0bced00, aWindow=0xb7bf7270, aX=0, aY=0, aW=864, aH=486, 
    aBGColor=@0xbfc21d0c, flags=<value optimized out>) at nsCanvasRenderingContext2D.cpp:3404
#12 0x03cd2dbb in NS_InvokeByIndex_P () from /usr/lib/xulrunner-1.9.1/libxul.so
#13 0x033d0a25 in XPCWrappedNative::CallMethod (ccx=@0xbfc21c9c, mode=XPCWrappedNative::CALL_METHOD)
    at xpcwrappednative.cpp:2424
#14 0x033d89de in XPC_WN_CallMethod (cx=0xb5309400, obj=0xb2c3c5a0, argc=6, argv=0xaf85f0d0, vp=0xbfc21dd8)
    at xpcwrappednativejsops.cpp:1587
#15 0x0039b15e in js_Invoke (cx=0xb5309400, argc=6, vp=0xaf85f0c8, flags=2) at jsinterp.cpp:1313
#16 0x0038d664 in js_Interpret (cx=0xb5309400) at jsinterp.cpp:5024
#17 0x0039b1bf in js_Invoke (cx=0xb5309400, argc=3, vp=0xaf85f020, flags=0) at jsinterp.cpp:1331
#18 0x0039b502 in js_InternalInvoke (cx=0xb5309400, obj=0xb5317000, fval=-1294691936, flags=0, argc=3, argv=0xaffb5bcc, 
    rval=0xbfc221f4) at jsinterp.cpp:1389
#19 0x00364766 in JS_CallFunctionValue (cx=0xb5309400, obj=0xb5317000, fval=-1294691936, argc=3, argv=0xaffb5bc0, 
    rval=0xbfc221f4) at jsapi.cpp:5296
#20 0x0381e63d in nsJSContext::CallEventHandler (this=0xb54e1b20, aTarget=0xb7bf5260, aScope=0xb5317000, 
    aHandler=0xb2d491a0, aargv=0xaffb6f84, arv=0xbfc222f4) at nsJSEnvironment.cpp:2002
#21 0x03834c12 in nsGlobalWindow::RunTimeout (this=0xb7bf5260, aTimeout=0xb0b95cc0) at nsGlobalWindow.cpp:7757
#22 0x03834fee in nsGlobalWindow::TimerCallback (aTimer=0xaffd1a30, aClosure=0xb0b95cc0) at nsGlobalWindow.cpp:8091
#23 0x03cc86b0 in nsTimerImpl::Fire (this=0xaffd1a30) at nsTimerImpl.cpp:420
#24 0x03cc8778 in nsTimerEvent::Run (this=0xaf70b0e0) at nsTimerImpl.cpp:512
#25 0x03cc5a5c in nsThread::ProcessNextEvent (this=0xb7c82c40, mayWait=1, result=0xbfc2242c) at nsThread.cpp:510
#26 0x03c91fb3 in NS_ProcessNextEvent_P (thread=0xb7c0d800, mayWait=1) at nsThreadUtils.cpp:227
#27 0x03be58a6 in nsBaseAppShell::Run (this=0xb7b2c600) at nsBaseAppShell.cpp:170
#28 0x03a8a3a4 in nsAppStartup::Run (this=0xb77aaee0) at nsAppStartup.cpp:192
#29 0x033a15d2 in XRE_main (argc=1, argv=0xbfc25b54, aAppData=0xb7c21900) at nsAppRunner.cpp:3279
#30 0x08049b05 in main (argc=1, argv=0xbfc25b54) at nsXULStub.cpp:383

This is wasted effort, and in particular wasted CPU effort for large pages, since basically no GPU can accelerate drawing past about 8192 pixels on an axis.  Unfortunately at this point I'm out of my depth, it looks like this is running from a timer from the chrome layer but it's not immediately obvious where that's getting set up or why.

Reproducible: Always




Fedora 11 preview.  Happened to show up quite spectacularly due to an X bug where we got caching setup extremely wrong for the huge pixmap thus created, causing extremely slow rendering where the server would appear to stall for upwards of five seconds.  Fixing that bug makes it merely a hiccup, but it's still pretty unpleasant.
Component: General → Layout: View Rendering
Keywords: perf
Product: Firefox → Core
QA Contact: general → layout.view-rendering
Version: unspecified → 1.9.1 Branch
(Reporter)

Comment 1

9 years ago
The summary is slightly misleading, this also happens when switching from one already-open tab to another.

Comment 2

6 years ago
Adam can you still reproduce?
Whiteboard: [closeme 2012-04-25]

Comment 3

6 years ago
Resolved per whiteboard
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2012-04-25]
You need to log in before you can comment on or make changes to this bug.