Closed Bug 1371037 Opened 7 years ago Closed 7 years ago

Enable record and replay of ClientPaintedLayers on 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, 2 obsolete files)

Just as a starting point.

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

This is just (1)
Assignee: nobody → mchang
Whiteboard: gfx-noted
Essentially a import of [1] for record/replay of client painted layers. Lots of duplicated code to get content client correct. This is fixed up in part 2.

[1] http://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp#28
Attachment #8875464 - Flags: review?(dvander)
Attachment #8875465 - Flags: review?(dvander)
Comment on attachment 8875465 [details] [diff] [review]
Refactor ClientPaintedLayers from duplicate code

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

::: gfx/layers/client/ClientPaintedLayer.cpp
@@ +305,3 @@
>      RefPtr<DrawEventRecorderMemory> recorder = RecordPaintedLayer();
>      if (recorder) {
> +      EnsureContentClient();

Do you need to check the return value here, and below too?
Attachment #8875465 - Flags: review?(dvander) → review+
Comment on attachment 8875464 [details] [diff] [review]
Record / Replay ClientPaintLayers

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

::: gfx/layers/client/ClientPaintedLayer.cpp
@@ +120,5 @@
>  
> +bool
> +ClientPaintedLayer::CanRecordLayer(ReadbackProcessor* aReadback)
> +{
> +  if (!gfxPrefs::OffMainThreadPainting()) {

Until bug 1369542 lands, could you make this:

>   if (!Preferences::GetBool("layers.omtp.enabled", false))

And drop the new entry in gfxPrefs?

@@ +125,5 @@
> +    return false;
> +  }
> +
> +  // Make life easier for debugging for now.
> +  if (!XRE_IsContentProcess()) {

(And after bug 1369549, testing for whether a paint thread exists can subsume both these checks.)
Attachment #8875464 - Flags: review?(dvander) → review+
Attached patch Rolled up patchSplinter Review
Carrying r+, updated with feedback from dvander. Also rebased on master + updated patches from dependent bugs.
Attachment #8875464 - Attachment is obsolete: true
Attachment #8875465 - Attachment is obsolete: true
Attachment #8876915 - Flags: review+
Blocks: 1372441
Blocks: 1372739
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/03e899794f41
Support for record and replay of ClientPaintedLayers on the main thread. r=dvander
Backout by archaeopteryx@coole-files.de:
https://hg.mozilla.org/mozilla-central/rev/0ef3bfc9f4b8
Backed out changeset 03e899794f41 for merge conflict with bug 1368386. r=backout a=backout
Backout by archaeopteryx@coole-files.de:
https://hg.mozilla.org/mozilla-central/rev/90436b206b3d
Backed out changeset 03e899794f41 for merge conflict with bug 1368386, v2. r=backout a=backout
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/77538e36a462
Support for record and replay of ClientPaintedLayers on the main thread. r=dvander
Try again after resolved merge conflict - https://treeherder.mozilla.org/#/jobs?repo=try&revision=4982ee803bad66e8fab494ff0148506ecad280dc
Flags: needinfo?(mchang)
https://hg.mozilla.org/mozilla-central/rev/77538e36a462
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: