No subject
Fri Mar 7 15:32:22 PST 2014
No change in functionality.
* platform/graphics/LayoutPoint.h:
(WebCore::roundPointToDevicePixels):
(WebCore::floorPointToDevicePixels):
(WebCore::ceilPointToDevicePixels):
(WebCore::roundedForPainting): Deleted.
(WebCore::flooredForPainting): Deleted.
(WebCore::ceiledForPainting): Deleted.
* platform/graphics/LayoutRect.cpp:
(WebCore::enclosingRectForPainting):
* platform/graphics/LayoutRect.h:
(WebCore::directionalPixelSnappedForPainting):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainti=
ng):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicsLayoutPointh">trunk/Sou=
rce/WebCore/platform/graphics/LayoutPoint.h</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicsLayoutRectcpp">trunk/So=
urce/WebCore/platform/graphics/LayoutRect.cpp</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicsLayoutRecth">trunk/Sour=
ce/WebCore/platform/graphics/LayoutRect.h</a></li>
<li><a href=3D"#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk=
/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href=3D"#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/W=
ebCore/rendering/RenderLayer.cpp</a></li>
<li><a href=3D"#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/S=
ource/WebCore/rendering/RenderLayerBacking.cpp</a></li>
</ul>
</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1730=
43 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog 2014-08-28 01:40:=
08 UTC (rev 173043)
+++ trunk/Source/WebCore/ChangeLog 2014-08-28 02:34:35 UTC (rev 173044)
</span><span class=3D"lines">@@ -1,5 +1,35 @@
</span><span class=3D"cx"> 2014-08-27 Zalan Bujtas <zalan at apple.com&=
gt;
</span><span class=3D"cx">=20
</span><ins>+ Subpixel layout: Rename LayoutPoint's device pixel s=
napping functions.
+ https://bugs.webkit.org/show_bug.cgi?id=3D136306
+
+ Reviewed by Simon Fraser.
+
+ From *edForPainting() to *PointToDevicePixels() (* =3D floor/rou=
nd/ceil)
+
+ No change in functionality.
+
+ * platform/graphics/LayoutPoint.h:
+ (WebCore::roundPointToDevicePixels):
+ (WebCore::floorPointToDevicePixels):
+ (WebCore::ceilPointToDevicePixels):
+ (WebCore::roundedForPainting): Deleted.
+ (WebCore::flooredForPainting): Deleted.
+ (WebCore::ceiledForPainting): Deleted.
+ * platform/graphics/LayoutRect.cpp:
+ (WebCore::enclosingRectForPainting):
+ * platform/graphics/LayoutRect.h:
+ (WebCore::directionalPixelSnappedForPainting):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometry=
ForPainting):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayerByApplyingTransform):
+ (WebCore::RenderLayer::calculateClipRects):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGeometry):
+
+2014-08-27 Zalan Bujtas <zalan at apple.com>
+
</ins><span class=3D"cx"> Subpixel layout: Rename LayoutSize's de=
vice pixel snapping functions.
</span><span class=3D"cx"> https://bugs.webkit.org/show_bug.cgi?i=
d=3D136310
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicsLayoutPointh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/LayoutPoint.h (173043 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/LayoutPoi=
nt.h 2014-08-28 01:40:08 UTC (rev 173043)
+++ trunk/Source/WebCore/platform/graphics/LayoutPoint.h 2014-08-28 02:34=
:35 UTC (rev 173044)
</span><span class=3D"lines">@@ -184,17 +184,17 @@
</span><span class=3D"cx"> return IntSize(snapSizeToPixel(s.width(), =
p.x()), snapSizeToPixel(s.height(), p.y()));
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-inline FloatPoint roundedForPainting(const LayoutPoint& =
point, float pixelSnappingFactor, bool directionalRoundingToRight =3D tru=
e, bool directionalRoundingToBottom =3D true)
</del><ins>+inline FloatPoint roundPointToDevicePixels(const LayoutPoint&=
amp; point, float pixelSnappingFactor, bool directionalRoundingToRight =3D=
true, bool directionalRoundingToBottom =3D true)
</ins><span class=3D"cx"> {
</span><span class=3D"cx"> return FloatPoint(roundToDevicePixel(point=
.x(), pixelSnappingFactor, !directionalRoundingToRight), roundToDevicePix=
el(point.y(), pixelSnappingFactor, !directionalRoundingToBottom));
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-inline FloatPoint flooredForPainting(const LayoutPoint& =
point, float pixelSnappingFactor)
</del><ins>+inline FloatPoint floorPointToDevicePixels(const LayoutPoint&=
amp; point, float pixelSnappingFactor)
</ins><span class=3D"cx"> {
</span><span class=3D"cx"> return FloatPoint(floorToDevicePixel(point=
.x(), pixelSnappingFactor), floorToDevicePixel(point.y(), pixelSnappingFa=
ctor));
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-inline FloatPoint ceiledForPainting(const LayoutPoint& p=
oint, float pixelSnappingFactor)
</del><ins>+inline FloatPoint ceilPointToDevicePixels(const LayoutPoint&a=
mp; point, float pixelSnappingFactor)
</ins><span class=3D"cx"> {
</span><span class=3D"cx"> return FloatPoint(ceilToDevicePixel(point.=
x(), pixelSnappingFactor), ceilToDevicePixel(point.y(), pixelSnappingFact=
or));
</span><span class=3D"cx"> }
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicsLayoutRectcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/LayoutRect.cpp (173043 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/LayoutRec=
t.cpp 2014-08-28 01:40:08 UTC (rev 173043)
+++ trunk/Source/WebCore/platform/graphics/LayoutRect.cpp 2014-08-28 02:3=
4:35 UTC (rev 173044)
</span><span class=3D"lines">@@ -146,8 +146,8 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx"> FloatRect enclosingRectForPainting(const Layou=
tRect& rect, float pixelSnappingFactor)
</span><span class=3D"cx"> {
</span><del>- FloatPoint location =3D flooredForPainting(rect.minXMinY=
Corner(), pixelSnappingFactor);
- FloatPoint maxPoint =3D ceiledForPainting(rect.maxXMaxYCorner(), pix=
elSnappingFactor);
</del><ins>+ FloatPoint location =3D floorPointToDevicePixels(rect.min=
XMinYCorner(), pixelSnappingFactor);
+ FloatPoint maxPoint =3D ceilPointToDevicePixels(rect.maxXMaxYCorner(=
), pixelSnappingFactor);
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> return FloatRect(location, maxPoint - loca=
tion);
</span><span class=3D"cx"> }
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicsLayoutRecth"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/LayoutRect.h (173043 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/LayoutRec=
t.h 2014-08-28 01:40:08 UTC (rev 173043)
+++ trunk/Source/WebCore/platform/graphics/LayoutRect.h 2014-08-28 02:34:=
35 UTC (rev 173044)
</span><span class=3D"lines">@@ -241,7 +241,7 @@
</span><span class=3D"cx"> inline FloatRect directionalPixelSnappedForPai=
nting(const LayoutRect& rect, float deviceScaleFactor, bool ltr)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> if (!ltr) {
</span><del>- FloatPoint snappedTopRight =3D roundedForPainting(re=
ct.maxXMinYCorner(), deviceScaleFactor, ltr);
</del><ins>+ FloatPoint snappedTopRight =3D roundPointToDevicePixe=
ls(rect.maxXMinYCorner(), deviceScaleFactor, ltr);
</ins><span class=3D"cx"> float snappedWidth =3D snapSizeToDevice=
Pixel(rect.width(), rect.maxX(), deviceScaleFactor);
</span><span class=3D"cx"> float snappedHeight =3D snapSizeToDevi=
cePixel(rect.height(), rect.y(), deviceScaleFactor);
</span><span class=3D"cx"> return FloatRect(snappedTopRight.x() -=
snappedWidth, snappedTopRight.y(), snappedWidth, snappedHeight);
</span></span></pre></div>
<a id=3D"trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/rendering/Rende=
rBoxModelObject.cpp (173043 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/rendering/RenderBoxModelObj=
ect.cpp 2014-08-28 01:40:08 UTC (rev 173043)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2014-08-28 02=
:34:35 UTC (rev 173044)
</span><span class=3D"lines">@@ -1074,9 +1074,9 @@
</span><span class=3D"cx"> // FIXME: We need a better rounding strate=
gy to round/space out tiles.
</span><span class=3D"cx"> geometry.setTileSize(LayoutSize(pixelSnapp=
edForPainting(LayoutRect(geometry.destRect().location(), geometry.tileSiz=
e()), deviceScaleFactor).size()));
</span><span class=3D"cx"> geometry.setSpaceSize(LayoutSize(pixelSnap=
pedForPainting(LayoutRect(LayoutPoint(), geometry.spaceSize()), deviceSca=
leFactor).size()));
</span><del>- geometry.setDestOrigin(LayoutPoint(roundedForPainting(ge=
ometry.destOrigin(), deviceScaleFactor)));
</del><ins>+ geometry.setDestOrigin(LayoutPoint(roundPointToDevicePixe=
ls(geometry.destOrigin(), deviceScaleFactor)));
</ins><span class=3D"cx"> geometry.setDestRect(LayoutRect(pixelSnappe=
dForPainting(geometry.destRect(), deviceScaleFactor)));
</span><del>- geometry.setPhase(LayoutPoint(roundedForPainting(geometr=
y.phase(), deviceScaleFactor)));
</del><ins>+ geometry.setPhase(LayoutPoint(roundPointToDevicePixels(ge=
ometry.phase(), deviceScaleFactor)));
</ins><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void RenderBoxModelObject::calculateBackground=
ImageGeometry(const RenderLayerModelObject* paintContainer, const FillLay=
er* fillLayer, const LayoutRect& paintRect,
</span></span></pre></div>
<a id=3D"trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/rendering/Rende=
rLayer.cpp (173043 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2=
014-08-28 01:40:08 UTC (rev 173043)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-08-28 02:34:35 UT=
C (rev 173044)
</span><span class=3D"lines">@@ -4212,7 +4212,7 @@
</span><span class=3D"cx"> TransformationMatrix transform(renderableT=
ransform(paintingInfo.paintBehavior));
</span><span class=3D"cx"> // Add the subpixel accumulation to the cu=
rrent layer's offset so that we can always snap the translateRight value =
to where the renderer() is supposed to be painting.
</span><span class=3D"cx"> LayoutSize offsetForThisLayer =3D offsetFr=
omParent + paintingInfo.subpixelAccumulation;
</span><del>- FloatSize devicePixelSnappedOffsetForThisLayer =3D toFlo=
atSize(roundedForPainting(toLayoutPoint(offsetForThisLayer), deviceScaleF=
actor));
</del><ins>+ FloatSize devicePixelSnappedOffsetForThisLayer =3D toFloa=
tSize(roundPointToDevicePixels(toLayoutPoint(offsetForThisLayer), deviceS=
caleFactor));
</ins><span class=3D"cx"> // We handle accumulated subpixels through =
nested layers here. Since the context gets translated to device pixels,
</span><span class=3D"cx"> // all we need to do is add the delta to t=
he accumulated pixels coming from ancestor layers.
</span><span class=3D"cx"> // Translate the graphics context to the s=
napping position to avoid off-device-pixel positing.
</span><span class=3D"lines">@@ -6751,7 +6751,7 @@
</span><span class=3D"cx"> region->setRegionObjectsRegionStyle();
</span><span class=3D"cx">=20
</span><span class=3D"cx"> LayoutSize moveOffset =3D region->flowT=
hreadPortionLocation() - (paintOffset + regionContentBox.location()) + re=
gion->fragmentContainer().scrolledContentOffset();
</span><del>- FloatPoint adjustedPaintOffset =3D roundedForPainting(to=
LayoutPoint(moveOffset), renderer().document().deviceScaleFactor());
</del><ins>+ FloatPoint adjustedPaintOffset =3D roundPointToDevicePixe=
ls(toLayoutPoint(moveOffset), renderer().document().deviceScaleFactor());
</ins><span class=3D"cx"> context->save();
</span><span class=3D"cx"> context->translate(-adjustedPaintOffset=
.x(), -adjustedPaintOffset.y());
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/rendering/Rende=
rLayerBacking.cpp (173043 =3D> 173044)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/rendering/RenderLayerBackin=
g.cpp 2014-08-28 01:40:08 UTC (rev 173043)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-08-28 02:3=
4:35 UTC (rev 173044)
</span><span class=3D"lines">@@ -819,7 +819,7 @@
</span><span class=3D"cx"> // Update properties that depend on la=
yer dimensions.
</span><span class=3D"cx"> FloatPoint3D transformOrigin =3D compu=
teTransformOriginForPainting(toRenderBox(renderer()).borderBoxRect());
</span><span class=3D"cx"> // Get layout bounds in the coords of =
compAncestor to match relativeCompositingBounds.
</span><del>- FloatPoint layerOffset =3D roundedForPainting(offset=
FromParent, deviceScaleFactor);
</del><ins>+ FloatPoint layerOffset =3D roundPointToDevicePixels(o=
ffsetFromParent, deviceScaleFactor);
</ins><span class=3D"cx"> // Compute the anchor point, which is i=
n the center of the renderer box unless transform-origin is set.
</span><span class=3D"cx"> FloatPoint3D anchor(enclosingRelativeC=
ompositingBounds.width() ? ((layerOffset.x() - enclosingRelativeCompositi=
ngBounds.x()) + transformOrigin.x())
</span><span class=3D"cx"> / enclosingRelativeCompositingBoun=
ds.width() : 0.5, enclosingRelativeCompositingBounds.height() ? ((layerOf=
fset.y() - enclosingRelativeCompositingBounds.y())
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list