Closed
Bug 1293970
Opened 8 years ago
Closed 8 years ago
Avoid canvas copy-on-write in CanvasRenderingContext2D::PutImageData and DrawWindow
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, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review |
PutImageData and DrawWindow are similar to FillRect in that they may cover the entire canvas. If it is the case, we can call EnsureTarget with a covered rect parameter the same way we do with FillRect to avoid copying the front buffer.
Assignee | ||
Comment 1•8 years ago
|
||
Assignee | ||
Comment 2•8 years ago
|
||
Comment on attachment 8780387 [details] [diff] [review]
set covered rect parameter to EnsureTarget
I set the covered rect parameter to EnsureTarget in DrawWindow and PutImageData.
Attachment #8780387 -
Attachment description: wip → set covered rect parameter to EnsureTarget
Attachment #8780387 -
Flags: review?(nical.bugzilla)
Reporter | ||
Comment 3•8 years ago
|
||
Comment on attachment 8780387 [details] [diff] [review]
set covered rect parameter to EnsureTarget
Review of attachment 8780387 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/canvas/CanvasRenderingContext2D.cpp
@@ +5641,5 @@
>
> + // The canvas spec says that the current path, transformation matrix, shadow attributes,
> + // global alpha, the clipping region, and global composition operator must not affect the
> + // getImageData() and putImageData() methods.
> + const gfx::Rect putRect(dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height);
nit: you can do const gfx::Rect ptRect(dirtyRect); to avoid the hassle of repeating each member.
Attachment #8780387 -
Flags: review?(nical.bugzilla) → review+
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Nicolas Silva [:nical] from comment #3)
> Comment on attachment 8780387 [details] [diff] [review]
> set covered rect parameter to EnsureTarget
>
> Review of attachment 8780387 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/canvas/CanvasRenderingContext2D.cpp
> @@ +5641,5 @@
> >
> > + // The canvas spec says that the current path, transformation matrix, shadow attributes,
> > + // global alpha, the clipping region, and global composition operator must not affect the
> > + // getImageData() and putImageData() methods.
> > + const gfx::Rect putRect(dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height);
>
> nit: you can do const gfx::Rect ptRect(dirtyRect); to avoid the hassle of
> repeating each member.
Okay!
Assignee | ||
Comment 5•8 years ago
|
||
Rebase and address nical's comments.
Attachment #8780387 -
Attachment is obsolete: true
Assignee | ||
Comment 6•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ec2202e9607b
Avoid copy in CanvasRenderingContext2D::PutImageData and DrawWindow. r=nical
Keywords: checkin-needed
Comment 8•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 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
•