Closed Bug 1372441 Opened 7 years ago Closed 7 years ago

Enable replay of ClientPaintedLayers off the main thread

Categories

(Core :: Graphics, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: mchang, Assigned: mchang)

References

Details

(Whiteboard: gfx-noted)

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1371037 +++

From where we were before:

1) we record/replay on the main thread for a client painted layer. Right now, we're using DrawTargetRecording which copies everything and also paints everything while recording, so it's super slow. But it's a known working recorder for now.
2) Ship this to the paint thread!
3) Stop using DrawTargetRecording and make sure DrawTargetCapture works

Bug 1371037 was (1). This is (2)!
Comment on attachment 8876951 [details] [diff] [review]
Replay contents on the paint thread

Review of attachment 8876951 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/PaintThread.cpp
@@ +18,4 @@
>  StaticAutoPtr<PaintThread> PaintThread::sSingleton;
>  
> +void
> +PaintThread::Release() {}

nit:

PaintThread::Release()
{
}

@@ +33,5 @@
>  bool
>  PaintThread::Init()
>  {
>    MOZ_ASSERT(NS_IsMainThread());
>    nsresult rv = NS_NewNamedThread("PaintThread", getter_AddRefs(PaintThread::sSingleton->mThread));

Can you change this to just mThread?

@@ +42,5 @@
>  
> +  nsCOMPtr<nsIRunnable> paintInitTask =
> +    NewRunnableMethod(this, &PaintThread::InitOnPaintThread);
> +
> +  SyncRunnable::DispatchToThread(PaintThread::sSingleton->mThread, paintInitTask);

Same here, no need to go through the singleton, we have |this|.

@@ +83,5 @@
>    PaintThread::sSingleton->mThread->AsyncShutdown();
>  }
>  
> +bool
> +PaintThread::IsInPaintThread()

nit: I think we usually say "IsOn" instead of "IsIn"

::: gfx/layers/PaintThread.h
@@ +12,5 @@
>  
>  namespace mozilla {
> +namespace gfx {
> +  class DrawEventRecorderMemory;
> +  class DrawTarget;

nit: we usually don't indent for forward declarations like this
Attachment #8876951 - Flags: review?(dvander) → review+
Blocks: 1372739
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/88eeeaeab920
Enable replay of ClientPaintedLayers off the main thread. r=dvander
https://hg.mozilla.org/mozilla-central/rev/88eeeaeab920
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Blocks: 1379322
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: