Closed Bug 516931 Opened 15 years ago Closed 15 years ago

WebKit uses CGContextFillRect whereas we use CGContextFillPath

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: joelr, Unassigned)

References

Details

Attachments

(1 file)

Related to bug 424715, i.e. us taking longer on the JS raytracing benchmark.

Would it matter that WebKit uses CGContextFillRect whereas we use
CGContextFillPath? 

I have a hunch that the former is much faster. I'll see if I can switch Cairo
to CGContextFillRect and time it.

I don't see WebKit filling paths at all, e.g.

WebKit:

1) WebCore::RenderBox::paintFillLayer() -> CGContextFillRect

    0.0%    42.6%    WebCore                                           
WebCore::RenderBox::paintFillLayer(WebCore::RenderObject::PaintInfo const&,
WebCore::Color const&, WebCore::FillLayer const*, int, int, int, int,
WebCore::CompositeOperator)
    1.0%    42.4%    WebCore                                            
WebCore::RenderBoxModelObject::paintFillLayerExtended(WebCore::RenderObject::PaintInfo
const&, WebCore::Color const&, WebCore::FillLayer const*, int, int, int, int,
WebCore::InlineFlowBox*, WebCore::CompositeOperator)
    0.3%    40.1%    WebCore                                             
WebCore::GraphicsContext::fillRect(WebCore::FloatRect const&, WebCore::Color
const&)
    0.2%    27.9%    CoreGraphics                                              
CGContextFillRect

Firefox:

1) nsCSSRendering::PaintBackground() results in a CGContextFillPath

    0.0%    16.5%    XUL                                                       
 nsCSSRendering::PaintBackground(nsPresContext*, nsIRenderingContext&,
nsIFrame*, nsRect const&, nsRect const&, unsigned int, nsRect*)
    0.6%    16.0%    XUL                                                       
  nsCSSRendering::PaintBackgroundWithSC(nsPresContext*, nsIRenderingContext&,
nsIFrame*, nsRect const&, nsRect const&, nsStyleBackground const&,
nsStyleBorder const&, unsigned int, nsRect*)
    0.0%    12.6%    XUL                                                       
   _moz_cairo_fill_preserve
    0.1%    12.6%    XUL                                                       
    _cairo_gstate_fill
    0.0%    12.4%    XUL                                                       
     _cairo_surface_fill
    0.1%    12.1%    XUL                                                       
      _cairo_quartz_surface_fill
    0.0%    5.8%    CoreGraphics                                               
               CGContextFillPath

2) PaintBackgroundLayer seems to trigger a path fill as well.

    0.0%    0.0%    XUL                                                        
 PaintBackgroundLayer(nsPresContext*, nsIRenderingContext&, nsIFrame*, unsigned
int, nsRect const&, nsRect const&, nsRect const&, nsStyleBackground const&,
nsStyleBackground::Layer const&)
    0.0%    0.0%    XUL                                                        
 _cairo_path_fixed_fini
    0.0%    0.0%    XUL                                                        
 gfxContext::Rectangle(gfxRect const&, int)
    0.0%    0.0%    XUL                                                        
 gfxContext::NewPath()
    0.0%    0.0%    XUL                                                        
 gfxContext::Fill()
Blocks: 424715
The ray tracing benchmark [1] takes 323-326s without my "optimization" and 340s with it.

Not much of an optimization, I suppose.

[1] http://nontroppo.org/timer/progressive_raytracer.html
Yikes. Yeah, let's not do that. :)
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
I stepped through this at one point -- FillRect internally just creates a path and calls FillPath.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: