RESOLVED WONTFIX 21244
rectangle fill with IntRect
https://bugs.webkit.org/show_bug.cgi?id=21244
Summary rectangle fill with IntRect
Ariya Hidayat
Reported 2008-09-30 11:07:49 PDT
For doing a rectangle fill, there is only GraphicsContext::fillRect(FloatRect). In some painting system, e.g. the Qt port of WebKit, optimization can be made if e.g. the rectangle is pixel-aligned. Solution: introduce GraphicsContext::fillRect(IntRect). Default implementation will just wrap the FloatRect version.
Attachments
introduce GraphicsContext::fillRect(IntRect) (4.46 KB, patch)
2008-09-30 11:10 PDT, Ariya Hidayat
no flags
Detect pixel-aligned rect (2.88 KB, patch)
2008-09-30 11:52 PDT, Ariya Hidayat
eric: review-
Ariya Hidayat
Comment 1 2008-09-30 11:10:51 PDT
Created attachment 23945 [details] introduce GraphicsContext::fillRect(IntRect)
Simon Fraser (smfr)
Comment 2 2008-09-30 11:24:43 PDT
Why not just test if (rect == FloatRect(enclosingIntRect(rect)) inside your fillRect implementation?
Ariya Hidayat
Comment 3 2008-09-30 11:52:22 PDT
Created attachment 23947 [details] Detect pixel-aligned rect Another variant of the patch, no need for GraphicsContext::fillRect(IntRect). Just specialize handling of IntRect inside GraphicsContext::fillRect(FloatRect).
Eric Seidel (no email)
Comment 4 2008-09-30 14:47:49 PDT
Comment on attachment 23947 [details] Detect pixel-aligned rect Please review the webkit coding style: http://webkit.org/coding/coding-style.htm and correct the errors in this patch. Otherwise this looks fine. I'd rather see "enclosing" called "enclosingRect" since it's a rect. :) I'm surprised Qt doesn't do this internally already. CoreGraphics on mac os x certainly does. IMO this seems like a hack around deficiencies in the Qt API. r- for the coding style violations.
Ariya Hidayat
Comment 5 2008-10-07 04:16:32 PDT
I decide to fix Qt instead. So I close this bug.
Note You need to log in before you can comment on or make changes to this bug.