Closed
Bug 1117869
Opened 8 years ago
Closed 8 years ago
Add move constructors and assignment operators for nsRegion
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: jrmuizel, Assigned: jrmuizel)
References
Details
Attachments
(1 file)
1.49 KB,
patch
|
botond
:
review+
|
Details | Diff | Splinter Review |
This should make things more cheap.
Attachment #8544085 -
Flags: review?(botond)
Updated•8 years ago
|
Assignee: nobody → jmuizelaar
Comment 1•8 years ago
|
||
Comment on attachment 8544085 [details] [diff] [review] Add move constructors and assignment operators for nsRegion Review of attachment 8544085 [details] [diff] [review]: ----------------------------------------------------------------- r+ with the calls to pixman_region32_init fixed. ::: gfx/src/nsRegion.h @@ +61,4 @@ > aRect.width, > aRect.height); } > nsRegion (const nsRegion& aRegion) { pixman_region32_init(&mImpl); pixman_region32_copy(&mImpl,aRegion.Impl()); } > + nsRegion (nsRegion&& aRegion) { mImpl = aRegion->mImpl; pixman_region32_init(&aRegion); } Presumably you meant to call 'pixman_region32_init(&aRegion->mImpl)' here. @@ +61,5 @@ > aRect.width, > aRect.height); } > nsRegion (const nsRegion& aRegion) { pixman_region32_init(&mImpl); pixman_region32_copy(&mImpl,aRegion.Impl()); } > + nsRegion (nsRegion&& aRegion) { mImpl = aRegion->mImpl; pixman_region32_init(&aRegion); } > + nsRegion& operator = (nsRegion&& aRegion) { pixman_region_fini(&mImpl); mImpl = aRegion->mImpl; pixman_region32_init(&aRegion); } And here.
Attachment #8544085 -
Flags: review?(botond) → review+
Assignee | ||
Updated•8 years ago
|
Depends on: cumulative-heap-profiling
![]() |
||
Comment 2•8 years ago
|
||
Jeff, do you have measurements that prompted this change? I'd be interested to see them. Thanks.
Flags: needinfo?(jmuizelaar)
Comment 3•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/92382656739f
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #2) > Jeff, do you have measurements that prompted this change? I'd be interested > to see them. Thanks. Nope. It's just low hanging fruit that I knew we had around. I don't expect it to have a very large change, but every bit helps.
Flags: needinfo?(jmuizelaar)
You need to log in
before you can comment on or make changes to this bug.
Description
•