Closed
Bug 1293968
Opened 9 years ago
Closed 9 years ago
Avoid calling EnsureTarget in CanvasRenderingContext2D::GetImageBuffer
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla51
| Tracking | Status | |
|---|---|---|
| firefox51 | --- | fixed |
People
(Reporter: nical, Assigned: ethlin)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
|
1.99 KB,
patch
|
nical
:
review+
|
Details | Diff | Splinter Review |
GetImageBuffer needs to access a snapshot of the canvas without retaining it, we could easily avoid calling EnsureTarget in most case by doing something like:
if (mTarget) {
snapshot = mTargetSnapshot()
} else if (mBufferProvider) {
snapshot = mBufferProvider->BorrowSnapshot();
} else {
//fallback to EnsureTarget, should rarely happen though.
}
// .. do things with the snapshot
if (!mTarget && mBufferProvider) {
mBufferProvider->ReturnSnapsht(snapshot.forget());
}
This way we can avoid triggering a copy of the canvas if the first command issued to the canvas in a frame is a snapshot.
| Reporter | ||
Updated•9 years ago
|
Whiteboard: [gfx-noted]
| Assignee | ||
Comment 2•9 years ago
|
||
Try to avoid calling EnsureTarget in GetImageBuffer.
Attachment #8780403 -
Flags: review?(nical.bugzilla)
| Reporter | ||
Updated•9 years ago
|
Attachment #8780403 -
Flags: review?(nical.bugzilla) → review+
| Assignee | ||
Comment 3•9 years ago
|
||
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a868ef45569
Avoid calling EnsureTarget in CanvasRenderingContext2D::GetImageBuffer. r=nical
Keywords: checkin-needed
Comment 5•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•