Closed
Bug 1074842
Opened 10 years ago
Closed 10 years ago
Don't copy DrawTargetCG data into the snapshot if the DrawTarget goes away
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: mstange, Assigned: mstange)
Details
Attachments
(1 file, 2 obsolete files)
5.46 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
There are a few places where we're using snapshots like this:
> TemporaryRef<SourceSurface> GetSomeSurface()
> {
> RefPtr<DrawTarget> dt = CreateDT();
> dt->DoSomething();
> return dt->Snapshot();
> }
>
> RefPtr<SourceSurface> surf = GetSomeSurface();
If dt is a DrawTargetCG, this pattern always results in an unnecessary copy when the DrawTarget is destroyed at the end of GetSomeSurface(). We should instead move the ownership of the DT's data into the snapshot.
I've encountered this problem in nsFilterInstance::BuildSourcePaint, nsFilterInstance::BuildSourceImage, and AdjustedTargetForFilter::DoSourcePaint.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8497510 -
Flags: review?(bas)
Assignee | ||
Comment 2•10 years ago
|
||
using mfbt Swap() instead of std::swap
Attachment #8497510 -
Attachment is obsolete: true
Attachment #8497510 -
Flags: review?(bas)
Attachment #8497512 -
Flags: review?(bas)
Assignee | ||
Comment 3•10 years ago
|
||
this one actually builds
Attachment #8497512 -
Attachment is obsolete: true
Attachment #8497512 -
Flags: review?(bas)
Attachment #8497544 -
Flags: review?(bas)
Comment 4•10 years ago
|
||
Comment on attachment 8497544 [details] [diff] [review] v3 Stealing review from Bas to Jeff.
Attachment #8497544 -
Flags: review?(bas) → review?(jmuizelaar)
Comment 5•10 years ago
|
||
Comment on attachment 8497544 [details] [diff] [review] v3 Review of attachment 8497544 [details] [diff] [review]: ----------------------------------------------------------------- Do any other backends suffer from this same problem?
Attachment #8497544 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 6•10 years ago
|
||
I just looked at DrawTargetSkia and DrawTargetCairo: Both don't call MarkChanged() from their destructor, so I don't really know how they handle this case at all. Maybe the skia and cairo objects handle it correctly internally?
Assignee | ||
Comment 7•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2d37465635cb
https://hg.mozilla.org/mozilla-central/rev/2d37465635cb
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•