Closed Bug 771219 Opened 12 years ago Closed 12 years ago

Tile base progressive painting

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: BenWa, Assigned: BenWa)

References

Details

Attachments

(4 files, 6 obsolete files)

Tile base progressive painting is a pre-requisite for priority tiled base drawing. The design is:
- Validate the buffer in groups of tiles (1,3,9).
- Send the progress as individual transactions.
- Have the compositor receive these transactions, upload and present it as it arrives.
- If the layers are not fully painted repeat the transaction imediate rather then discarding the display list.

The benefits are:
- Tiles start appearing much faster to user.
- The compositor can start to upload while content is still drawing tiles.
- We COULD (this needs another bug) abort painting between the group of tiles safely if we decide that we're no longer painting something useful.
- This provides a pre-requesite for efficient drawing at high and low resolution. This is required to replace the screenshot.
I know we discussed this patch before. Whats the most representative way to measure the performance impact of this patch? If needed I can make this change android only.
Assignee: nobody → bgirard
Status: NEW → ASSIGNED
Attachment #639390 - Flags: review?(roc)
Attached patch Repeatable transaction (obsolete) — Splinter Review
Attachment #639393 - Flags: review?(ajuma)
Attached patch Use Repeatable Transaction (obsolete) — Splinter Review
Attachment #639412 - Flags: review?(ajuma)
Attached patch Use Repeatable Transaction (obsolete) — Splinter Review
Forgot the mResolution changes
Attachment #639412 - Attachment is obsolete: true
Attachment #639412 - Flags: review?(ajuma)
Attachment #639417 - Flags: review?(ajuma)
Comment on attachment 639393 [details] [diff] [review]
Repeatable transaction

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

::: gfx/layers/basic/BasicLayerManager.cpp
@@ +974,5 @@
>    ForwardTransaction();
>    if (mShadowTarget) {
>      ShadowLayerForwarder::ShadowDrawToTarget(mShadowTarget);
>      mShadowTarget = nsnull;
>    }

When we have a repeat transaction, we shouldn't call ShadowDrawToTarget right away (since this will cause an incomplete draw to the target). Instead, we should wait until no further repeating is needed, and then call ShadowDrawToTarget. (So, essentially, move the code above to an 'else' case of the code below.)
Attachment #639393 - Flags: review?(ajuma)
Comment on attachment 639417 [details] [diff] [review]
Use Repeatable Transaction

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

Nice work!

::: gfx/layers/basic/BasicTiledThebesLayer.cpp
@@ +244,5 @@
> +    //             user interaction events.
> +    int paintTileStartX = mTiledBuffer.RoundDownToTileEdge(rect->x);
> +    int paintTileStartY = mTiledBuffer.RoundDownToTileEdge(rect->y);
> +
> +    nsIntRegion maxPaint(nsIntRect(paintTileStartX, paintTileStartY, 768, 768));

Use 3*GetTileLength() instead of 768.
Attachment #639417 - Flags: review?(ajuma) → review+
Blocks: check2
Comment on attachment 639390 [details] [diff] [review]
Copy the displaylist for repeating paints

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

I think instead of this, at the end of DrawThebesLayer you can re-get the ThebesLayerItemsEntry and just swap the elements back into place.
It should also be documented somewhere that it's OK to call DrawThebesLayer more than once.
Talos results are looking great:
Changeset f5dd704b112f

http://graphs.mozilla.org/graph.html#tests=[[204,23,20]]&sel=none&displayrange=7&datatype=running

I'm seeing some bad results in dhtml:
First run was +100%, modified run was +8%
http://graphs.mozilla.org/graph.html#tests=[[19,23,20]]

I think we're pushing pixels to the screen faster, uploading in parallel but overall we block the main thread for longer so I expect Talos to reflect this. I'm going to land this with a pref since it's easy to maintain a non progressive paint code path.
Attachment #639390 - Attachment is obsolete: true
Attachment #639390 - Flags: review?(roc)
Attachment #639725 - Flags: review?(roc)
Attachment #639725 - Attachment is obsolete: true
Attachment #639725 - Flags: review?(roc)
Attachment #639727 - Flags: review?(ajuma)
Comment on attachment 639725 [details] [diff] [review]
Restore the display items

Made the wrong patch obsolete.
Attachment #639725 - Attachment is obsolete: false
Attachment #639725 - Flags: review?(roc)
Carry forward r=ajuma
Attachment #639393 - Attachment is obsolete: true
Attachment #639417 - Attachment is obsolete: true
Attachment #639739 - Flags: review+
Attached patch Add a prefSplinter Review
I didn't add this to the pref.js on purpose.
Attachment #639741 - Flags: review?(ajuma)
Attachment #639727 - Flags: review?(ajuma) → review+
Attachment #639741 - Flags: review?(ajuma) → review+
I'm going to be landing this pref'ed off shortly. The reason is because it will overplay the talos improvement. This is because the first progressive paint we update the viewport and this makes the front end and the Talos measurement think that we're done painting the page when we've only done a single tile.

The solution is to compute the region that we have painted and pass that to the front end.
Looks like this was breaking opt R2 and R3 as well.
Leaving open based on comments 15 and 17.
Depends on: 775848
Blocks: 783368
Blocks: 794130
Blocks: 794465
Blocks: 794200
Blocks: 796107
Blocks: 796117
Depends on: 796939
Attached patch Turn this on by default (obsolete) — Splinter Review
Hoping to land this by default on Friday.
Attachment #667135 - Attachment is obsolete: true
Blocks: 796939
No longer depends on: 796939
Attached patch Turn this on by default (obsolete) — Splinter Review
Blocks: 797187
Blocks: 749062
Depends on: 800475
Depends on: 800041
Depends on: 800944
Depends on: 800483
Comment on attachment 667148 [details] [diff] [review]
Turn this on by default

Tracked in bug 795259
Attachment #667148 - Attachment is obsolete: true
This feature is working, moving to track the blocking work over to bug 795259.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 803390
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: