Bug 18779 - REGRESSION(31916-31981): CanvasRenderingContext2D::drawImage no longer respects the srcRect
Summary: REGRESSION(31916-31981): CanvasRenderingContext2D::drawImage no longer respec...
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Dave Hyatt
Keywords: HasReduction, Regression
Depends on:
Reported: 2008-04-28 02:45 PDT by Oliver Hunt
Modified: 2008-04-28 11:18 PDT (History)
2 users (show)

See Also:

Test case (588 bytes, text/html)
2008-04-28 02:50 PDT, Oliver Hunt
no flags Details
Fix the argument reversal. (554 bytes, patch)
2008-04-28 10:42 PDT, Dave Hyatt
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.