Closed Bug 623485 Opened 14 years ago Closed 14 years ago

Scroll indicators for content scrolling regress scrolling speed from 55FPS -> 50 (SW) 22 (EGL HW)

Categories

(Firefox for Android Graveyard :: Panning/Zooming, defect)

ARM
Linux
defect
Not set
normal

Tracking

(fennec2.0b4+)

RESOLVED FIXED
Tracking Status
fennec 2.0b4+ ---

People

(Reporter: romaxa, Assigned: romaxa)

References

()

Details

(Keywords: perf)

Attachments

(7 files)

I found that enabled scroll indicators are making fennec scrolling a bit slower in software rendering mode and much slower in EGL rendering mode Software 55->50 FPS drop Hardware 55->21 FPS drop.
Blocks: 606672
Keywords: perf
(In reply to comment #0) > I found that enabled scroll indicators are making fennec scrolling a bit slower > in software rendering mode and much slower in EGL rendering mode > > Software 55->50 FPS drop > Hardware 55->21 FPS drop. We knowingly took the regression in software because it was small enough and the feature was wanted. The slow down in EGL is surprising, we should dig into that.
Ok, I see two problems here: 1) on maemo6 I see lot of "status == LOCAL_GL_FRAMEBUFFER_COMPLETE" (this is EGL backend problem, I'll check that) 2) sounds like scroll indicators layer created incorrectly, not cached and updated too often a) Every 2-3 scroll movements/paints, we create new TextureImage 6x54 (vertical) and/or 451x6 (horizontal) scrolling indicator b) In zoomed state on scroll we create big texture sz[766,440], and on each scroll event we update small region of that Texture(Layer). which is really wrong. it means we create big transparent ThebesLayer and repainting scrollbars on that layer on each scroll event... c) On each scroll paint we update scroll indicators layer.... this is totally wrong, indicators should be created on dragStart, painted in own layer and while scrolling only Texture Blit on GPU should happen.
So EGL specific slowness is - caused by wrong combination of TextureImageEGL ctor, TextureImageEGL::Resize, SetBlitFramebufferForDestTexture. Also Updating/uploading GL data into GPU on each scroll event very very bad thing. 2) a) b) c) cause slowness also for software rendering.
for fixing 2) I think we should move scroll indicators into separate image layer.. and make sure that layout does not do anything wrong by recognizing it as fixed positioned frames. not sure yet how to specify that scroll indicator should be ImageLayer... roc: could you advice any hits?
> Hardware 55->21 FPS drop. Do we know what this looks like on Android?
would be nice if someone could test exact FPS number with this patch.
Are these indicators in XUL? We have a XUL attribute layers="true" that forces the element into its own layer.
> the element into its own layer. Interesting, scrollindicators according to bug 461843 fix are "box" xul elements... but without layers="true"... I'll try that.
tried to setup layer="true" attr for scroll box, and that did not make any difference.. scroll indicators still updated on each paint. - <box id="vertical-scroller" class="scroller" orient="vertical" right="2" top="0"/> + <box id="vertical-scroller" class="scroller" orient="vertical" right="2" top="0" layer="true"/> - <box id="horizontal-scroller" class="scroller" orient="horizontal" left="0" bottom="2"/> + <box id="horizontal-scroller" class="scroller" orient="horizontal" left="0" bottom="2" layer="true"/>
Attached file Dump paint list output
backtraces are different but in both cases we do repaint scrollindicator xull box on each motion event
break in ThebesLayerBuilder::InvalidateThebesLayerContents to see why we're doing that
Attachment #505365 - Attachment mime type: application/zip → application/x-jar
Ok , back2.txt and back3.txt are related to our xul box frame with layer="true"
OK, so during scrolling we reflowing the scrollindicators and making them dirty with NS_FRAME_IS_DIRTY. You need to figure out what is causing them to have NS_FRAME_IS_DIRTY set.
tracking-fennec: --- → ?
Ok, we do change scroll indicator position with SetTop call... and that cause force layer reflow.
Should I just check that if size attribute (w | h) not changed and frame has layer flag then ignore DIRTY set for that frame?
Can you use transforms to position the indicator instead?
Assignee: nobody → romaxa
tracking-fennec: ? → 2.0+
Comment on attachment 506918 [details] [diff] [review] Use transforms to move scrollbar Nice. My patch for this is almost identical.I would just drop the local "str" and set MozTransform directly. Works well in my testing too.
Comment on attachment 506918 [details] [diff] [review] Use transforms to move scrollbar Oleg - I am happy to take this patch if you see an improvement
Thanks, I'll try it asap.
Comment on attachment 506918 [details] [diff] [review] Use transforms to move scrollbar Cool, this patch fixes all the problems. I think we should push it ASAP.
Attachment #506918 - Flags: feedback+
Attachment #506918 - Flags: review?(21)
Comment on attachment 506918 [details] [diff] [review] Use transforms to move scrollbar >diff --git a/chrome/content/browser.js b/chrome/content/browser.js >- if (scaleX) >- this._horizontalScrollbar.left = contentScroll.x * scaleX; >+ if (scaleX) { >+ this._horizontalScrollbar.style.MozTransform = "translateX(" + Math.round(contentScroll.x * scaleX) + "px)"; >+ } Nit: remove the {} > if (scaleY) { > const SCROLLER_MARGIN = 2; >- this._verticalScrollbar.top = contentScroll.y * scaleY; >+ let y = Math.round(contentScroll.y * scaleY); > > // right scrollbar is out of view when showing the left sidebar, > // the 'solution' for now is to reposition it if needed >+ let x; You can just let x = 0; here and remove the else case I can fix that when landing.
Attachment #506918 - Flags: review?(21) → review+
Also SCROLLER_MARGIN seems unuseful now. I want to wait for this afternoon to know if we want that for b4 or not before landing.
OK - Let's land the transform patch for beta 4
tracking-fennec: 2.0+ → 2.0b4+
(In reply to comment #30) > I've landed Ben's patch: http://hg.mozilla.org/mobile-browser/rev/bc006e989f9d > > Is there anything else to do for this bug? nope. sounds like this fixed the performance problem.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
yes, with this I see only texture composition to GPU, no updates, no repaints
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: