Closed Bug 1293968 Opened 8 years ago Closed 8 years ago

Avoid calling EnsureTarget in CanvasRenderingContext2D::GetImageBuffer

Categories

(Core :: Graphics, defect)

defect
Not set
normal

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)

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.
Whiteboard: [gfx-noted]
I'll work on this too.
Assignee: nobody → ethlin
Attached patch avoid calling EnsureTarget (deleted) — Splinter Review
Try to avoid calling EnsureTarget in GetImageBuffer.
Attachment #8780403 - Flags: review?(nical.bugzilla)
Attachment #8780403 - Flags: review?(nical.bugzilla) → review+
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
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Blocks: 1001069
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: