Closed Bug 1186274 Opened 9 years ago Closed 8 years ago

nsDisplayCanvasBackgroundColor can take 30+ ms to paint

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox42 --- affected

People

(Reporter: mchang, Assigned: mchang)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

While scrolling engadget.com with APZ and e10s enabled on a retina macbook pro, I can get 20ms+ to render at [1]. This doesn't show up at all on Windows with a GPU.

The rect we're filling is quite large as well:

devPxRect is (0.000000, -32254.000000) (2880.000000, 49176.000000)
Draw target size: 3072, 3840
Transform is: [1.000000, 0.000000] [0.000000, 1.000000] [0.000000, 254.000000]
Total time: 21.682419

The call tree through instruments looks like:

Running Time	Self (ms)		Symbol Name
469.0ms  100.0%	0.0	 	nsDisplayCanvasBackgroundColor::Paint(nsDisplayListBuilder*, nsRenderingContext*)
469.0ms  100.0%	0.0	 	 mozilla::gfx::DrawTargetTiled::FillRect(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::Pattern const&, mozilla::gfx::DrawOptions const&)
468.0ms   99.7%	0.0	 	  mozilla::gfx::DrawTargetCG::FillRect(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::Pattern const&, mozilla::gfx::DrawOptions const&)
459.0ms   97.8%	1.0	 	   CGContextFillRects
457.0ms   97.4%	0.0	 	    ripc_DrawRects
445.0ms   94.8%	1.0	 	     ripc_Render
439.0ms   93.6%	0.0	 	      RIPLayerBltShape
438.0ms   93.3%	1.0	 	       argb32_mark
437.0ms   93.1%	1.0	 	        CGBlt_fillBytes
404.0ms   86.1%	404.0	 	         _platform_memset_pattern8$VARIANT$Unknown
32.0ms    6.8%	32.0	 	         _platform_memset_pattern16$VARIANT$Unknown

Setting tile sizes to 1024x1024 makes it 4x faster, but can still take up quite a bit of time. The times it takes very long are usually when the draw target size is > 2880 by 1800, the resolution of the retina display. It might be the problem of just the first draw to a large surface is slow.

Somehow, see if we can make this faster. It looks similar to the profiles I see of scrolling bugzilla and the background gradient. 

[1] https://dxr.mozilla.org/mozilla-central/source/layout/generic/nsCanvasFrame.cpp?from=nsDisplayCanvasBackgroundColor::Paint&case=true#339
Blocks: paint-fast
Mason, it's been a year since this was looked at. Is performance getting any better?
Flags: needinfo?(mchang)
Keywords: perf
(In reply to Anthony Hughes (:ashughes) [GFX][QA][Mentor] from comment #1)
> Mason, it's been a year since this was looked at. Is performance getting any
> better?

Not sure, I haven't taken a look at it in a long time. Skia should have helped but not sure with this case. I'll close as WFM, and reopen if need be.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(mchang)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.