The default bug view has changed. See this FAQ.

Speed up Canvas putImageData() without filling gfxImageSurface with zeros

RESOLVED FIXED in mozilla19

Status

()

Core
Canvas: 2D
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Tetsuro Kato (tete), Assigned: Tetsuro Kato (tete))

Tracking

Trunk
mozilla19
x86_64
Windows 7
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 670021 [details] [diff] [review]
Patch for putImageData rv1.0

Because GfxImageSurface are created with the argument value of aClear "true" in the following two functions, those gfxImageSurface are filled with zeros by memset.
nsCanvasRenderingContext2DAzure::PutImageData_explicit()
nsCanvasRenderingContext2D::PutImageData_explicit()

But we set a value to every pixel in the gfxImageSurface right after that, so filling the gfxImageSurface with zeros seems to be waste of CPU cycles.
(Assignee)

Updated

5 years ago
Attachment #670021 - Flags: review?(jmuizelaar)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 670021 [details] [diff] [review]
Patch for putImageData rv1.0

Looks great to me.
Attachment #670021 - Flags: review?(jmuizelaar) → review+
Keywords: checkin-needed
I don't see any Try results here, so I've triggered a run. I'll push it if it's green.

https://tbpl.mozilla.org/?tree=Try&rev=b8bd135fa1a6

Thanks for the patch, Tete! One request - to make life easier for those checking in on your behalf, please make sure that your future patches follow the guidelines below. Thanks!
https://developer.mozilla.org/en-US/docs/Creating_a_patch_that_can_be_checked_in
Assignee: nobody → tete009+bugzilla
(Assignee)

Comment 3

5 years ago
Ryan, thank you for letting me know the document. I'll read it carefully so that I can create my patches according to the guidelines. Thank you!
Looks green. Thanks again!

https://hg.mozilla.org/integration/mozilla-inbound/rev/8766ced01b38
Flags: in-testsuite-
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8766ced01b38
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.