Summary: | [WK2] PageViewportController.cpp is supposed to be a generic WebKit2 file but only works with Qt port. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Hugo Parente Lima <hugo.lima> | ||||||||
Component: | WebKit2 | Assignee: | Hugo Parente Lima <hugo.lima> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | abecsi, cmarcelo, kenneth, menard, noam, vestbo, webkit.review.bot, zoltan | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | All | ||||||||||
Attachments: |
|
Description
Hugo Parente Lima
2012-10-02 12:14:26 PDT
Created attachment 166730 [details]
Patch
Comment on attachment 166730 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166730&action=review Better to use FloatSize::scale explicitly > Source/WebCore/platform/graphics/FloatSize.h:188 > +inline FloatSize operator/(const FloatSize& a, const float& b) const float& -> float (In reply to comment #2) > (From update of attachment 166730 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=166730&action=review > > Better to use FloatSize::scale explicitly Ok, I'll do that. > > Source/WebCore/platform/graphics/FloatSize.h:188 > > +inline FloatSize operator/(const FloatSize& a, const float& b) > > const float& -> float So, if I'm goin to use FloatSize::scale, operator/ will disappear from this patch. Created attachment 166927 [details]
Patch
Comment on attachment 166927 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166927&action=review > Source/WebCore/platform/graphics/FloatSize.h:100 > + FloatSize scaledTo(float s) const how about scaledSize > Source/WebKit2/UIProcess/PageViewportController.cpp:148 > + if (FloatRect(clampedPos, m_viewportSize.scaledTo(1 / m_effectiveScale)).intersects(coveredRect)) { You're making the same calculation over and over... how about creating a function PageViewportController::viewportSizeInContentsCoordinates that would return that calculation? That way you also don't need a function... (In reply to comment #5) > (From update of attachment 166927 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=166927&action=review > > > Source/WebCore/platform/graphics/FloatSize.h:100 > > + FloatSize scaledTo(float s) const > > how about scaledSize I used scaledTo to follow the same convention used in this file, like "expandedTo" instead of "expandedSize" > > Source/WebKit2/UIProcess/PageViewportController.cpp:148 > > + if (FloatRect(clampedPos, m_viewportSize.scaledTo(1 / m_effectiveScale)).intersects(coveredRect)) { > > You're making the same calculation over and over... how about creating a function PageViewportController::viewportSizeInContentsCoordinates that would return that calculation? That way you also don't need a function... Could be, it's used 3 times, I'll update the patch. Created attachment 166953 [details]
Patch
Comment on attachment 166953 [details] Patch Clearing flags on attachment: 166953 Committed r130327: <http://trac.webkit.org/changeset/130327> All reviewed patches have been landed. Closing bug. |