Title: [87196] trunk/Source/WebCore
- Revision
- 87196
- Author
- [email protected]
- Date
- 2011-05-24 13:23:56 -0700 (Tue, 24 May 2011)
Log Message
2011-05-24 Simon Fraser <[email protected]>
Reviewed by Chris Marrin.
Add ability to set compositing layer bounds origin
https://bugs.webkit.org/show_bug.cgi?id=61381
On Core Animation layers, the origin of the bounds
rectangle affects where layer content is rendered, as well
as the offset of sublayers. Currently we always set the
bounds offset to a zero point, but may need to make use
of the bounds offset in future, so expose it via GraphicsLayer.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::boundsOrigin):
(WebCore::GraphicsLayer::setBoundsOrigin):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setSize):
(WebCore::GraphicsLayerCA::setBoundsOrigin):
(WebCore::GraphicsLayerCA::setAllowTiledLayer):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateBounds):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
* platform/graphics/ca/GraphicsLayerCA.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (87195 => 87196)
--- trunk/Source/WebCore/ChangeLog 2011-05-24 20:18:55 UTC (rev 87195)
+++ trunk/Source/WebCore/ChangeLog 2011-05-24 20:23:56 UTC (rev 87196)
@@ -1,3 +1,29 @@
+2011-05-24 Simon Fraser <[email protected]>
+
+ Reviewed by Chris Marrin.
+
+ Add ability to set compositing layer bounds origin
+ https://bugs.webkit.org/show_bug.cgi?id=61381
+
+ On Core Animation layers, the origin of the bounds
+ rectangle affects where layer content is rendered, as well
+ as the offset of sublayers. Currently we always set the
+ bounds offset to a zero point, but may need to make use
+ of the bounds offset in future, so expose it via GraphicsLayer.
+
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::boundsOrigin):
+ (WebCore::GraphicsLayer::setBoundsOrigin):
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::setSize):
+ (WebCore::GraphicsLayerCA::setBoundsOrigin):
+ (WebCore::GraphicsLayerCA::setAllowTiledLayer):
+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+ (WebCore::GraphicsLayerCA::updateBounds):
+ (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+ (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+ * platform/graphics/ca/GraphicsLayerCA.h:
+
2011-05-24 Leandro Pereira <[email protected]>
[EFL] Build fix.
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (87195 => 87196)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2011-05-24 20:18:55 UTC (rev 87195)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2011-05-24 20:23:56 UTC (rev 87196)
@@ -233,10 +233,14 @@
const FloatPoint3D& anchorPoint() const { return m_anchorPoint; }
virtual void setAnchorPoint(const FloatPoint3D& p) { m_anchorPoint = p; }
- // The bounds of the layer
+ // The size of the layer.
const FloatSize& size() const { return m_size; }
virtual void setSize(const FloatSize& size) { m_size = size; }
+ // The boundOrigin affects the offset at which content is rendered, and sublayers are positioned.
+ const FloatPoint& boundsOrigin() const { return m_boundsOrigin; }
+ virtual void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; }
+
const TransformationMatrix& transform() const { return m_transform; }
virtual void setTransform(const TransformationMatrix& t) { m_transform = t; }
@@ -382,6 +386,8 @@
FloatPoint m_position;
FloatPoint3D m_anchorPoint;
FloatSize m_size;
+ FloatPoint m_boundsOrigin;
+
TransformationMatrix m_transform;
TransformationMatrix m_childrenTransform;
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (87195 => 87196)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2011-05-24 20:18:55 UTC (rev 87195)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2011-05-24 20:23:56 UTC (rev 87196)
@@ -399,9 +399,18 @@
return;
GraphicsLayer::setSize(size);
- noteLayerPropertyChanged(SizeChanged);
+ noteLayerPropertyChanged(BoundsChanged);
}
+void GraphicsLayerCA::setBoundsOrigin(const FloatPoint& origin)
+{
+ if (origin == m_boundsOrigin)
+ return;
+
+ GraphicsLayer::setBoundsOrigin(origin);
+ noteLayerPropertyChanged(BoundsChanged);
+}
+
void GraphicsLayerCA::setTransform(const TransformationMatrix& t)
{
if (t == m_transform)
@@ -496,8 +505,8 @@
m_allowTiledLayer = allowTiledLayer;
- // Handling this as a SizeChanged will cause use to switch in or out of tiled layer as needed
- noteLayerPropertyChanged(SizeChanged);
+ // Handling this as a BoundsChanged will cause use to switch in or out of tiled layer as needed
+ noteLayerPropertyChanged(BoundsChanged);
}
void GraphicsLayerCA::setBackgroundColor(const Color& color)
@@ -832,8 +841,8 @@
if (m_uncommittedChanges & AnchorPointChanged)
updateAnchorPoint();
- if (m_uncommittedChanges & SizeChanged)
- updateLayerSize();
+ if (m_uncommittedChanges & BoundsChanged)
+ updateBounds();
if (m_uncommittedChanges & TransformChanged)
updateTransform();
@@ -971,9 +980,9 @@
}
}
-void GraphicsLayerCA::updateLayerSize()
+void GraphicsLayerCA::updateBounds()
{
- FloatRect rect(0, 0, m_size.width(), m_size.height());
+ FloatRect rect(m_boundsOrigin, m_size);
if (m_structuralLayer) {
m_structuralLayer->setBounds(rect);
@@ -1134,7 +1143,7 @@
// Update the properties of m_layer now that we no longer have a structural layer.
updateLayerPosition();
- updateLayerSize();
+ updateBounds();
updateAnchorPoint();
updateTransform();
updateChildrenTransform();
@@ -1172,7 +1181,7 @@
// Update the properties of the structural layer.
updateLayerPosition();
- updateLayerSize();
+ updateBounds();
updateAnchorPoint();
updateTransform();
updateChildrenTransform();
@@ -2058,7 +2067,7 @@
updateContentsTransform();
updateLayerPosition();
- updateLayerSize();
+ updateBounds();
updateAnchorPoint();
updateTransform();
updateChildrenTransform();
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (87195 => 87196)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2011-05-24 20:18:55 UTC (rev 87195)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2011-05-24 20:23:56 UTC (rev 87196)
@@ -74,6 +74,7 @@
virtual void setPosition(const FloatPoint&);
virtual void setAnchorPoint(const FloatPoint3D&);
virtual void setSize(const FloatSize&);
+ virtual void setBoundsOrigin(const FloatPoint&);
virtual void setTransform(const TransformationMatrix&);
@@ -263,7 +264,7 @@
void updateLayerNames();
void updateSublayerList();
void updateLayerPosition();
- void updateLayerSize();
+ void updateBounds();
void updateAnchorPoint();
void updateTransform();
void updateChildrenTransform();
@@ -308,7 +309,7 @@
ChildrenChanged = 1 << 2, // also used for content layer, and preserves-3d, and size if tiling changes?
PositionChanged = 1 << 3,
AnchorPointChanged = 1 << 4,
- SizeChanged = 1 << 5,
+ BoundsChanged = 1 << 5,
TransformChanged = 1 << 6,
ChildrenTransformChanged = 1 << 7,
Preserves3DChanged = 1 << 8,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes