Closed
Bug 1293968
Opened 8 years ago
Closed 8 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
(Blocks 1 open bug)
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
(deleted),
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•8 years ago
|
Whiteboard: [gfx-noted]
Assignee | ||
Comment 2•8 years ago
|
||
Try to avoid calling EnsureTarget in GetImageBuffer.
Attachment #8780403 -
Flags: review?(nical.bugzilla)
Reporter | ||
Updated•8 years ago
|
Attachment #8780403 -
Flags: review?(nical.bugzilla) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Updated•8 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•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Assignee | ||
Updated•8 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•