Skip the content initialization for DrawTarget if the content will be replaced soon

ASSIGNED
Assigned to

Status

()

Core
Graphics
P3
normal
ASSIGNED
a year ago
2 months ago

People

(Reporter: jerry, Assigned: jerry)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

In [1], we create a DrawTarget and copy another surface on it. In this case, we don't need to have the initial value for that DrawTarget.

This bug try to create a new api CreateSimilarDrawTargetWithSurfaceData(), and skip the initial operation if possible.

[1]
https://hg.mozilla.org/mozilla-central/annotate/51377a64158941f89ed73f388ae437cfa494c030/dom/canvas/CanvasRenderingContext2D.cpp#l4372
Created attachment 8838018 [details] [diff] [review]
create a DrawTarget with the existing Surface data.

MozReview-Commit-ID: KCWemfPo14A
Attachment #8838018 - Flags: review?(bas)
Created attachment 8838019 [details] [diff] [review]
DrawTargetD2D1::CreateSimilarDrawTargetWithSurfaceData() impl.

MozReview-Commit-ID: CLdYEo1HDzC
Attachment #8838019 - Flags: review?(bas)
Do we have an example case where this speeds things up?  It'd be good to track the improvement.
Unless we get an answer to Milan's question I'm going to unflag these patches for review? I'm willing to believe this is a good change for sure, but I'd like to see some data backing it up.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.