Closed Bug 625478 Opened 12 years ago Closed 12 years ago

First paint timestamp is broken on OSX and Android

Categories

(Toolkit :: Startup and Profile System, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mossop, Assigned: taras.mozilla)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 522375 attempts to report when the first paint happened but it doesn't work on OSX or Android.
I think this is because the first paint time is captured in the view manager for an NS_DID_PAINT event. We don't send NS_DID_PAINT events in all platforms.
Taras, see comment 1.
(In reply to comment #1)
> I think this is because the first paint time is captured in the view manager
> for an NS_DID_PAINT event. We don't send NS_DID_PAINT events in all platforms.

Is there a better place to hook into?
I think in nsViewManager::RenderViews after the mObserver->Paint call should be a good place.
Attached patch better firstpaint hook (obsolete) — Splinter Review
Assignee: nobody → tglek
Attachment #503647 - Flags: review?(tnikkel)
Comment on attachment 503647 [details] [diff] [review]
better firstpaint hook

>@@ -447,6 +447,8 @@ void nsViewManager::RenderViews(nsView *
>     mObserver->Paint(displayRoot, aView, aWidget, region, aIntRegion,
>                      aPaintDefaultBackground, aWillSendDidPaint);
>   }
>+  if (!gFirstPaintTimestamp)
>+    gFirstPaintTimestamp = PR_Now();
> }

Nit: you might want to put this inside the "if (mObserver)" block, if we don't call Paint then we aren't painting anything at all. r+ with that change.
Attachment #503647 - Flags: review?(tnikkel) → review+
Attachment #503647 - Attachment is obsolete: true
Attachment #503660 - Flags: approval2.0?
Attachment #503660 - Flags: approval2.0? → approval2.0+
http://hg.mozilla.org/mozilla-central/rev/fc57718d8a48
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.