Bug 18779

Summary: REGRESSION(31916-31981): CanvasRenderingContext2D::drawImage no longer respects the srcRect
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: DOMAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: hyatt, oliver
Priority: P1 Keywords: HasReduction, Regression
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test case
none
Fix the argument reversal. timothy: review+

Description Oliver Hunt 2008-04-28 02:45:14 PDT
While trying to find the cause of another bug i found that we no longer drawImage correctly in the Canvas

The issue appears to be that we no longer respect the srcRect (or at least not correctly)

My money's on http://trac.webkit.org/changeset/31961
Comment 1 Oliver Hunt 2008-04-28 02:50:49 PDT
Created attachment 20863 [details]
Test case

This test case uses two canvases, in the invisible rect it draws a green square on a red background.  It then draws the portion of that canvas into the other canvas, scaled to fill the entire canvas.  In r31916 and before this works correctly, now the resultant image is a scaled down copy almost as though dst and src rects were reversed, although a quick tour down debugging lane would seem to imply that that is not the case.  In fact it would appear that it may be Image::draw that is not handling the scaling correctly.
Comment 2 Dave Hyatt 2008-04-28 10:42:30 PDT
Created attachment 20871 [details]
Fix the argument reversal.

Will land test case from bug.
Comment 3 Dave Hyatt 2008-04-28 11:18:48 PDT
Fixed in r32651.