Bug 77784

Summary: Canvas-into-canvas drawing should respect backing store scale ratio
Product: WebKit Reporter: Tim Horton <thorton>
Component: CanvasAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, dglazkov, eoconnor, mdelaney7, mitz, simon.fraser, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
mitz: review+, webkit.review.bot: commit-queue-
revised patch
gyuyoung.kim: commit-queue-
revised patch (which actually builds!) mitz: review+

Description Tim Horton 2012-02-03 14:44:12 PST
When drawing between two canvases where the backing store scale ratio is not 1, using the ctx.drawImage(otherCanvas, 0, 0) form of drawImage() doesn't respect the scale ratio.

<rdar://problem/10549729>

I have a patch.
Comment 1 Tim Horton 2012-02-03 14:45:26 PST
Created attachment 125419 [details]
patch
Comment 2 mitz 2012-02-03 14:49:57 PST
Comment on attachment 125419 [details]
patch

Makes sense
Comment 3 Tim Horton 2012-02-03 15:03:18 PST
(In reply to comment #2)
> (From update of attachment 125419 [details])
> Makes sense

Only mostly... there's one mistake: the destination rect should be equal to the source rect, not the size of the destination canvas. I *did* have that right last time; gotta stop second-guessing. r=you with that change?
Comment 4 WebKit Review Bot 2012-02-03 17:29:19 PST
Comment on attachment 125419 [details]
patch

Attachment 125419 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11424456

New failing tests:
fast/canvas/canvas-composite-canvas.html
canvas/philip/tests/2d.fillStyle.parse.current.removed.html
Comment 5 mitz 2012-02-03 18:47:59 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 125419 [details] [details])
> > Makes sense
> 
> Only mostly... there's one mistake: the destination rect should be equal to the source rect, not the size of the destination canvas. I *did* have that right last time; gotta stop second-guessing. r=you with that change?

I was going to say yes, but what's this failure the EWS bot is reporting?
Comment 6 Tim Horton 2012-02-03 18:49:12 PST
(In reply to comment #5)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (From update of attachment 125419 [details] [details] [details])
> > > Makes sense
> > 
> > Only mostly... there's one mistake: the destination rect should be equal to the source rect, not the size of the destination canvas. I *did* have that right last time; gotta stop second-guessing. r=you with that change?
> 
> I was going to say yes, but what's this failure the EWS bot is reporting?

I'm going to double check in a minute, but I'm willing to bet that *is* the failure the EWS bot is reporting. For some reason I didn't hit that when running the tests locally, though, so I have to figure out how to get it to fail!
Comment 7 mitz 2012-02-03 18:57:27 PST
Could you post the corrected version of the patch to see what the bit thinks about it?
Comment 8 Tim Horton 2012-02-03 19:00:42 PST
Created attachment 125463 [details]
revised patch

Sure, let's see what EWS says.
Comment 9 Gyuyoung Kim 2012-02-03 19:03:33 PST
Comment on attachment 125463 [details]
revised patch

Attachment 125463 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/11421531
Comment 10 Early Warning System Bot 2012-02-03 19:03:49 PST
Comment on attachment 125463 [details]
revised patch

Attachment 125463 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11416605
Comment 11 Tim Horton 2012-02-03 19:05:18 PST
Created attachment 125465 [details]
revised patch (which actually builds!)

Ugh, I undo'd a little too far.
Comment 12 Tim Horton 2012-02-03 22:44:43 PST
Landed in http://trac.webkit.org/changeset/106729; thanks, Dan!