Bug 4755
| Summary: | "CGContext*: invalid context" messages dumped to the console (may indicate a performance hit) | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | mitz |
| Component: | Layout and Rendering | Assignee: | Darin Adler <darin> |
| Status: | VERIFIED FIXED | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | 420+ | ||
| Hardware: | Mac | ||
| OS: | OS X 10.4 | ||
mitz
After running Safari for a while, it starts dumping "invalid context" error messages from various
CGContext routines to the console. Once it's in "dumping errors" state, merely switching Safari to the
background and bringing it back to the foreground will generate a few of these messages.
Setting a breakpoint at CGPostError gives backtraces like this:
#0 0x9048e008 in CGPostError ()
#1 0x903cca0c in CGContextClipToRect ()
#2 0x937cad04 in +[NSBezierPath clipRect:] ()
#3 0x01624a30 in QPainter::addClip (this=0xbfffe304, rect=@0xbfffdf48) at WebCore/kwq/
KWQPainter.mm:762
#4 0x017f6c18 in setClip (p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, clipRect=@0xbfffdf48) at
WebCore/khtml/rendering/render_layer.cpp:846
#5 0x017fbae8 in khtml::RenderLayer::paintLayer (this=0xbc6c63c, rootLayer=0xbf8b4fc,
p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, haveTransparency=false, selectionOnly=false,
paintingRoot=0x0) at WebCore/khtml/rendering/render_layer.cpp:904
#6 0x017fbf58 in khtml::RenderLayer::paintLayer (this=0xbf3da1c, rootLayer=0xbf8b4fc,
p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, haveTransparency=false, selectionOnly=false,
paintingRoot=0x0) at WebCore/khtml/rendering/render_layer.cpp:963
#7 0x017fbf58 in khtml::RenderLayer::paintLayer (this=0xbf8b4fc, rootLayer=0xbf8b4fc,
p=0xbfffe304, paintDirtyRect=@0xbfffe2f4, haveTransparency=false, selectionOnly=false,
paintingRoot=0x0) at WebCore/khtml/rendering/render_layer.cpp:963
#8 0x017fc038 in khtml::RenderLayer::paint (this=0xbf8b4fc, p=0xbfffe304,
damageRect=@0xbfffe2f4, selectionOnly=false, paintingRoot=0x0) at WebCore/khtml/rendering/
render_layer.cpp:835
#9 0x015f4478 in KWQKHTMLPart::paint (this=0x70f3200, p=0xbfffe304, rect=@0xbfffe2f4) at
WebCore/kwq/KWQKHTMLPart.mm:1171
#10 0x015f5050 in KWQKHTMLPart::setDisplaysWithFocusAttributes (this=0x70f3200, flag=true) at
WebCore/kwq/KWQKHTMLPart.mm:3752
#11 0x01656b9c in -[WebCoreBridge setDisplaysWithFocusAttributes:] (self=0xba9d580,
_cmd=0x90a30150, flag=1 '\001') at WebCore/kwq/WebCoreBridge.mm:1385
#12 0x00371cbc in -[WebHTMLView(WebHTMLViewFileInternal) updateFocusState] (self=0xc31a820,
_cmd=0x4061cc) at WebKit/WebView.subproj/WebHTMLView.m:633
#13 0x0037d914 in -[WebHTMLView windowDidBecomeKey:] (self=0xc31a820, _cmd=0x90a3df80,
notification=0xb821720) at WebKit/WebView.subproj/WebHTMLView.m:2490
#14 0x928d7838 in _nsnote_callback ()
#15 0x90785558 in __CFXNotificationPost ()
#16 0x9077d634 in _CFXNotificationPostNotification ()
#17 0x928c1c40 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#18 0x936df76c in -[NSWindow becomeKeyWindow] ()
#19 0x00017238 in ?? ()
#20 0x937328fc in _NXShowKeyAndMain ()
#21 0x936d8190 in -[NSWindow sendEvent:] ()
#22 0x0001d558 in ?? ()
#23 0x93681734 in -[NSApplication sendEvent:] ()
#24 0x0001a530 in ?? ()
#25 0x93678b70 in -[NSApplication run] ()
#26 0x93769658 in NSApplicationMain ()
In all cases that I checked of this, the CGContextRef that was passed was a 0 which was coming from
[[NSGraphicsContext currentContext] graphicsPort] or such.
While I can't see that rendering is affected by this, maybe it indicates that everything is being rendered
twice, once in "nowhere" and once in the window.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Darin Adler
The patch attached to bug 4274 will fix this.