Bug 20973 - [Qt] SVG patterns are missing
: [Qt] SVG patterns are missing
Status: RESOLVED FIXED
: WebKit
WebKit Qt
: 528+ (Nightly build)
: PC All
: P2 Normal
Assigned To:
:
: Qt
:
:
  Show dependency treegraph
 
Reported: 2008-09-21 11:33 PST by
Modified: 2008-09-27 15:51 PST (History)


Attachments
SVGPattern (4.02 KB, patch)
2008-09-21 11:37 PST, Dirk Schulze
darin: review+
Review Patch | Details | Formatted Diff | Diff
SVGPattern (3.98 KB, patch)
2008-09-22 08:37 PST, Dirk Schulze
eric: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-09-21 11:33:16 PST
Qt lacks of SVG pattern support.
------- Comment #1 From 2008-09-21 11:37:48 PST -------
Created an attachment (id=23629) [details]
SVGPattern

This patch adds svg pattern support. Only texts are not supported (like on gradients).
------- Comment #2 From 2008-09-21 13:44:05 PST -------
(From update of attachment 23629 [details])
+    PassRefPtr<Pattern> pattern;
+    pattern = Pattern::create(tile()->image(), true, true);

This is an inefficient idiom. It's more efficient to initialize on the same line the variable is defined on. But also the local variable should be RefPtr, not PassRefPtr. See <http://webkit.org/coding/RefPtr.html> for guidelines.

+    QBrush brush(pattern.get()->createPlatformPattern(affine));

No need for the call to get() here. You can just use the -> operator normally with smart pointers.

r=me as-is, but I suggest making those two refinements.
------- Comment #3 From 2008-09-22 08:37:04 PST -------
Created an attachment (id=23651) [details]
SVGPattern

Forgot to add QPainter and changed PassRefPtr to RefPtr.
------- Comment #4 From 2008-09-22 13:25:34 PST -------
(From update of attachment 23651 [details])
r=me
------- Comment #5 From 2008-09-27 15:51:34 PST -------
Landed as r37006.