Bug 39225 - [Qt] Repeat pattern should start from origin
Summary: [Qt] Repeat pattern should start from origin
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P3 Normal
Assignee: qi
URL:
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2010-05-17 09:50 PDT by qi
Modified: 2010-06-16 21:15 PDT (History)
4 users (show)

See Also:


Attachments
patch (3.79 KB, patch)
2010-05-17 10:19 PDT, qi
kenneth: review-
Details | Formatted Diff | Diff
patch2 (3.82 KB, patch)
2010-05-17 10:26 PDT, qi
no flags Details | Formatted Diff | Diff
patch3 (6.38 KB, patch)
2010-06-09 07:41 PDT, qi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description qi 2010-05-17 09:50:33 PDT
Failed on: 
http://philip.html5.org/tests/canvas/suite/tests/2d.pattern.paint.norepeat.coord3.html
http://philip.html5.org/tests/canvas/suite/tests/2d.pattern.paint.repeaty.coord1.html

Based on spec:
Patterns must be painted so that the top left of the first image is anchored at the origin of the coordinate space,
and images are then repeated horizontally to the left and right (if the repeat-x string was specified) or vertically
up and down (if the repeat-y string was specified) or in all four directions all over the canvas (if the repeat string
was specified).

Current implementation is start from top left of the rect instead of the origin of the coordinate.
Comment 1 qi 2010-05-17 10:19:07 PDT
Created attachment 56247 [details]
patch

Paint repeat pattern directly instead of using brush.

QtBrush always paint pattern from top left of the rectangle. We need to paint pattern from origin, but only paint the part inside of the rectangle.
Comment 2 WebKit Review Bot 2010-05-17 10:22:38 PDT
Attachment 56247 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/ChangeLog:7:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:9:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:10:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:11:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:12:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:13:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 6 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Kenneth Rohde Christiansen 2010-05-17 10:25:01 PDT
Comment on attachment 56247 [details]
patch


> +        Patterns must be painted so that the top left of the first image 
> +	is anchored at the origin of the coordinate space, and images are 
> +	then repeated horizontally to the left and right (if the repeat-x 
> +	string was specified) or vertically up and down (if the repeat-y 
> +	string was specified) or in all four directions all over the canvas 
> +	(if the repeat string was specified).

There is something wrong with the indentation of the above.

Missing test.

r- for the above.
Comment 4 qi 2010-05-17 10:26:55 PDT
Created attachment 56248 [details]
patch2

fix style check issue
Comment 5 Eric Seidel (no email) 2010-05-20 00:57:31 PDT
Comment on attachment 56248 [details]
patch2

I would have put this new code in a new function.  Maybe a static inline if I was concerned about performance.
Comment 6 qi 2010-06-09 07:41:04 PDT
Created attachment 58245 [details]
patch3

1. Created a new function for draw repeat pattern
2. Remove 3 test cases from Skipped.
Comment 7 Laszlo Gombos 2010-06-16 18:54:31 PDT
Comment on attachment 58245 [details]
patch3

lgtm, r+.
Comment 8 WebKit Commit Bot 2010-06-16 21:15:17 PDT
Comment on attachment 58245 [details]
patch3

Clearing flags on attachment: 58245

Committed r61303: <http://trac.webkit.org/changeset/61303>
Comment 9 WebKit Commit Bot 2010-06-16 21:15:22 PDT
All reviewed patches have been landed.  Closing bug.