Bug 106209 - Use explicit constructor to convert from Int/FloatSize to Int/FloatPoint
Summary: Use explicit constructor to convert from Int/FloatSize to Int/FloatPoint
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Steve Block
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-06 21:37 PST by Steve Block
Modified: 2013-01-07 22:09 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.35 KB, patch)
2013-01-06 21:38 PST, Steve Block
no flags Details | Formatted Diff | Diff
Patch (4.36 KB, patch)
2013-01-07 19:30 PST, Steve Block
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Block 2013-01-06 21:37:19 PST
Use explicit constructor to convert from Int/FloatSize to Int/FloatPoint
Comment 1 Steve Block 2013-01-06 21:38:39 PST
Created attachment 181477 [details]
Patch
Comment 2 Steve Block 2013-01-06 21:41:30 PST
This is easier to read than using operator+ with a zero Int/FloatPoint.
Comment 3 Kentaro Hara 2013-01-07 00:54:51 PST
Comment on attachment 181477 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181477&action=review

> Source/WebCore/rendering/RenderLayerBacking.cpp:623
> +        m_ancestorClippingLayer->setPosition(IntPoint(parentClipRect.location() - graphicsLayerParentLocation));

Nit: How about using FloatPoint() instead of IntPoint(), since GraphicLayers::setPosition() expects a FloatPoint?

> Source/WebCore/rendering/RenderLayerBacking.cpp:633
> +    m_graphicsLayer->setPosition(IntPoint(relativeCompositingBounds.location() - graphicsLayerParentLocation));

Ditto.

> Source/WebCore/rendering/RenderLayerBacking.cpp:651
> +        clipLayer->setPosition(IntPoint(clippingBox.location() - localCompositingBounds.location()));

Ditto.

> Source/WebCore/rendering/RenderLayerBacking.cpp:736
> +        m_scrollingLayer->setPosition(IntPoint(paddingBox.location() - localCompositingBounds.location()));

Ditto.
Comment 4 Steve Block 2013-01-07 19:30:22 PST
Created attachment 181623 [details]
Patch
Comment 5 Steve Block 2013-01-07 19:35:02 PST
I thought that it was good to make clear that the arguments to setPosition() were integer types, rather than floating types, but I don't feel strongly. Done.
Comment 6 WebKit Review Bot 2013-01-07 22:09:16 PST
Comment on attachment 181623 [details]
Patch

Clearing flags on attachment: 181623

Committed r139032: <http://trac.webkit.org/changeset/139032>
Comment 7 WebKit Review Bot 2013-01-07 22:09:20 PST
All reviewed patches have been landed.  Closing bug.