Commit bcbbd0f3 authored by eae@chromium.org's avatar eae@chromium.org

Switch RenderLayer to to new layout types

https://bugs.webkit.org/show_bug.cgi?id=66507

Reviewed by Eric Seidel.

Convert RenderLayer to new layout abstraction.

No new tests as no new functionality.

* rendering/LayoutTypes.h:
(WebCore::flooredLayoutSize):
* rendering/RenderLayer.cpp:
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderLayerCompositor.h:


git-svn-id: svn://svn.chromium.org/blink/trunk@93429 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ed0a7ba2
2011-08-19 Emil A Eklund <eae@chromium.org>
Switch RenderLayer to to new layout types
https://bugs.webkit.org/show_bug.cgi?id=66507
Reviewed by Eric Seidel.
Convert RenderLayer to new layout abstraction.
No new tests as no new functionality.
* rendering/LayoutTypes.h:
(WebCore::flooredLayoutSize):
* rendering/RenderLayer.cpp:
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderLayerCompositor.h:
2011-08-19 Mihnea Ovidenie <mihnea@adobe.com> 2011-08-19 Mihnea Ovidenie <mihnea@adobe.com>
[CSSRegions]Content displayed in regions should not be scrollable [CSSRegions]Content displayed in regions should not be scrollable
...@@ -71,6 +71,11 @@ inline LayoutPoint flooredLayoutPoint(const FloatSize& s) ...@@ -71,6 +71,11 @@ inline LayoutPoint flooredLayoutPoint(const FloatSize& s)
return flooredIntPoint(s); return flooredIntPoint(s);
} }
inline LayoutSize flooredLayoutSize(const FloatPoint& p)
{
return LayoutSize(static_cast<int>(p.x()), static_cast<int>(p.y()));
}
inline LayoutUnit roundedLayoutUnit(float value) inline LayoutUnit roundedLayoutUnit(float value)
{ {
return lroundf(value); return lroundf(value);
......
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
void setContentsNeedDisplay(); void setContentsNeedDisplay();
// r is in the coordinate space of the layer's render object // r is in the coordinate space of the layer's render object
void setContentsNeedDisplayInRect(const IntRect& r); void setContentsNeedDisplayInRect(const LayoutRect&);
// Notification from the renderer that its content changed. // Notification from the renderer that its content changed.
void contentChanged(RenderLayer::ContentChangeType); void contentChanged(RenderLayer::ContentChangeType);
...@@ -116,8 +116,8 @@ public: ...@@ -116,8 +116,8 @@ public:
void suspendAnimations(double time = 0); void suspendAnimations(double time = 0);
void resumeAnimations(); void resumeAnimations();
IntRect compositedBounds() const; LayoutRect compositedBounds() const;
void setCompositedBounds(const IntRect&); void setCompositedBounds(const LayoutRect&);
void updateCompositedBounds(); void updateCompositedBounds();
void updateAfterWidgetResize(); void updateAfterWidgetResize();
...@@ -126,7 +126,7 @@ public: ...@@ -126,7 +126,7 @@ public:
virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime); virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime);
virtual void notifySyncRequired(const GraphicsLayer*); virtual void notifySyncRequired(const GraphicsLayer*);
virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clip); virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const LayoutRect& clip);
virtual float deviceScaleFactor() const; virtual float deviceScaleFactor() const;
virtual float pageScaleFactor() const; virtual float pageScaleFactor() const;
...@@ -135,7 +135,7 @@ public: ...@@ -135,7 +135,7 @@ public:
virtual bool showDebugBorders() const; virtual bool showDebugBorders() const;
virtual bool showRepaintCounter() const; virtual bool showRepaintCounter() const;
IntRect contentsBox() const; LayoutRect contentsBox() const;
// For informative purposes only. // For informative purposes only.
CompositingLayerType compositingLayerType() const; CompositingLayerType compositingLayerType() const;
...@@ -164,11 +164,11 @@ private: ...@@ -164,11 +164,11 @@ private:
GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const;
IntSize contentOffsetInCompostingLayer() const; LayoutSize contentOffsetInCompostingLayer() const;
// Result is transform origin in pixels. // Result is transform origin in pixels.
FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; FloatPoint3D computeTransformOrigin(const LayoutRect& borderBox) const;
// Result is perspective origin in pixels. // Result is perspective origin in pixels.
FloatPoint computePerspectiveOrigin(const IntRect& borderBox) const; FloatPoint computePerspectiveOrigin(const LayoutRect& borderBox) const;
void updateLayerOpacity(const RenderStyle*); void updateLayerOpacity(const RenderStyle*);
void updateLayerTransform(const RenderStyle*); void updateLayerTransform(const RenderStyle*);
...@@ -190,7 +190,7 @@ private: ...@@ -190,7 +190,7 @@ private:
bool hasNonCompositingDescendants() const; bool hasNonCompositingDescendants() const;
void paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase, RenderObject* paintingRoot); void paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase, RenderObject* paintingRoot);
static int graphicsLayerToCSSProperty(AnimatedPropertyID); static int graphicsLayerToCSSProperty(AnimatedPropertyID);
static AnimatedPropertyID cssToGraphicsLayerProperty(int); static AnimatedPropertyID cssToGraphicsLayerProperty(int);
...@@ -211,7 +211,7 @@ private: ...@@ -211,7 +211,7 @@ private:
OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
OwnPtr<GraphicsLayer> m_layerForScrollCorner; OwnPtr<GraphicsLayer> m_layerForScrollCorner;
IntRect m_compositedBounds; LayoutRect m_compositedBounds;
bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work
}; };
......
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
bool needsContentsCompositingLayer(const RenderLayer*) const; bool needsContentsCompositingLayer(const RenderLayer*) const;
// Return the bounding box required for compositing layer and its childern, relative to ancestorLayer. // Return the bounding box required for compositing layer and its childern, relative to ancestorLayer.
// If layerBoundingBox is not 0, on return it contains the bounding box of this layer only. // If layerBoundingBox is not 0, on return it contains the bounding box of this layer only.
IntRect calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer); LayoutRect calculateCompositedBounds(const RenderLayer*, const RenderLayer* ancestorLayer);
// Repaint the appropriate layers when the given RenderLayer starts or stops being composited. // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
void repaintOnCompositingChange(RenderLayer*); void repaintOnCompositingChange(RenderLayer*);
...@@ -132,7 +132,7 @@ public: ...@@ -132,7 +132,7 @@ public:
RenderLayer* enclosingNonStackingClippingLayer(const RenderLayer* layer) const; RenderLayer* enclosingNonStackingClippingLayer(const RenderLayer* layer) const;
// Repaint parts of all composited layers that intersect the given absolute rectangle. // Repaint parts of all composited layers that intersect the given absolute rectangle.
void repaintCompositedLayersAbsoluteRect(const IntRect&); void repaintCompositedLayersAbsoluteRect(const LayoutRect&);
RenderLayer* rootRenderLayer() const; RenderLayer* rootRenderLayer() const;
GraphicsLayer* rootGraphicsLayer() const; GraphicsLayer* rootGraphicsLayer() const;
...@@ -175,9 +175,9 @@ public: ...@@ -175,9 +175,9 @@ public:
static bool parentFrameContentLayers(RenderPart*); static bool parentFrameContentLayers(RenderPart*);
// Update the geometry of the layers used for clipping and scrolling in frames. // Update the geometry of the layers used for clipping and scrolling in frames.
void frameViewDidChangeLocation(const IntPoint& contentsOffset); void frameViewDidChangeLocation(const LayoutPoint& contentsOffset);
void frameViewDidChangeSize(); void frameViewDidChangeSize();
void frameViewDidScroll(const IntPoint& = IntPoint()); void frameViewDidScroll(const LayoutPoint& = LayoutPoint());
String layerTreeAsText(bool showDebugInfo = false); String layerTreeAsText(bool showDebugInfo = false);
...@@ -202,7 +202,7 @@ private: ...@@ -202,7 +202,7 @@ private:
// GraphicsLayerClient Implementation // GraphicsLayerClient Implementation
virtual void notifyAnimationStarted(const GraphicsLayer*, double) { } virtual void notifyAnimationStarted(const GraphicsLayer*, double) { }
virtual void notifySyncRequired(const GraphicsLayer*) { scheduleLayerFlush(); } virtual void notifySyncRequired(const GraphicsLayer*) { scheduleLayerFlush(); }
virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&); virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const LayoutRect&);
// These calls return false always. They are saying that the layers associated with this client // These calls return false always. They are saying that the layers associated with this client
// (the clipLayer and scrollLayer) should never show debugging info. // (the clipLayer and scrollLayer) should never show debugging info.
...@@ -222,12 +222,12 @@ private: ...@@ -222,12 +222,12 @@ private:
void clearBackingForLayerIncludingDescendants(RenderLayer*); void clearBackingForLayerIncludingDescendants(RenderLayer*);
// Repaint the given rect (which is layer's coords), and regions of child layers that intersect that rect. // Repaint the given rect (which is layer's coords), and regions of child layers that intersect that rect.
void recursiveRepaintLayerRect(RenderLayer* layer, const IntRect& rect); void recursiveRepaintLayerRect(RenderLayer*, const LayoutRect&);
typedef HashMap<RenderLayer*, IntRect> OverlapMap; typedef HashMap<RenderLayer*, LayoutRect> OverlapMap;
void addToOverlapMap(OverlapMap&, RenderLayer*, IntRect& layerBounds, bool& boundsComputed); void addToOverlapMap(OverlapMap&, RenderLayer*, LayoutRect& layerBounds, bool& boundsComputed);
void addToOverlapMapRecursive(OverlapMap&, RenderLayer*); void addToOverlapMapRecursive(OverlapMap&, RenderLayer*);
static bool overlapsCompositedLayers(OverlapMap&, const IntRect& layerBounds); static bool overlapsCompositedLayers(OverlapMap&, const LayoutRect& layerBounds);
void updateCompositingLayersTimerFired(Timer<RenderLayerCompositor>*); void updateCompositingLayersTimerFired(Timer<RenderLayerCompositor>*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment