| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void updateLayerPositionsAfterLayout(); | 117 void updateLayerPositionsAfterLayout(); |
| 118 | 118 |
| 119 void updateTransformationMatrix(); | 119 void updateTransformationMatrix(); |
| 120 RenderLayer* renderingContextRoot(); | 120 RenderLayer* renderingContextRoot(); |
| 121 | 121 |
| 122 RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); } | 122 RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); } |
| 123 const RenderLayerStackingNode* stackingNode() const { return m_stackingNode.
get(); } | 123 const RenderLayerStackingNode* stackingNode() const { return m_stackingNode.
get(); } |
| 124 | 124 |
| 125 bool hasBoxDecorationsOrBackground() const; | 125 bool hasBoxDecorationsOrBackground() const; |
| 126 bool hasVisibleBoxDecorations() const; | 126 bool hasVisibleBoxDecorations() const; |
| 127 // Returns true if this layer has visible content (ignoring any child layers
). | |
| 128 bool isVisuallyNonEmpty() const; | |
| 129 // True if this layer container renderers that paint. | 127 // True if this layer container renderers that paint. |
| 130 bool hasNonEmptyChildRenderers() const; | 128 bool hasNonEmptyChildRenderers() const; |
| 131 | 129 |
| 132 // Gets the nearest enclosing positioned ancestor layer (also includes | 130 // Gets the nearest enclosing positioned ancestor layer (also includes |
| 133 // the <html> layer and the root layer). | 131 // the <html> layer and the root layer). |
| 134 RenderLayer* enclosingPositionedAncestor() const; | 132 RenderLayer* enclosingPositionedAncestor() const; |
| 135 | 133 |
| 136 RenderLayer* enclosingOverflowClipLayer(IncludeSelfOrNot = IncludeSelf) cons
t; | 134 RenderLayer* enclosingOverflowClipLayer(IncludeSelfOrNot = IncludeSelf) cons
t; |
| 137 | 135 |
| 138 const RenderLayer* compositingContainer() const; | 136 const RenderLayer* compositingContainer() const; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 172 |
| 175 // FIXME: reflections should force transform-style to be flat in the style:
https://bugs.webkit.org/show_bug.cgi?id=106959 | 173 // FIXME: reflections should force transform-style to be flat in the style:
https://bugs.webkit.org/show_bug.cgi?id=106959 |
| 176 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D
() == TransformStyle3DPreserve3D; } | 174 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D
() == TransformStyle3DPreserve3D; } |
| 177 | 175 |
| 178 bool hasFilter() const { return renderer()->hasFilter(); } | 176 bool hasFilter() const { return renderer()->hasFilter(); } |
| 179 | 177 |
| 180 void* operator new(size_t); | 178 void* operator new(size_t); |
| 181 // Only safe to call from RenderBox::destroyLayer() | 179 // Only safe to call from RenderBox::destroyLayer() |
| 182 void operator delete(void*); | 180 void operator delete(void*); |
| 183 | 181 |
| 184 FilterOperations computeFilterOperations(const RenderStyle*); | |
| 185 bool paintsWithFilters() const; | |
| 186 bool requiresFullLayerImageForFilters() const; | |
| 187 FilterEffectRenderer* filterRenderer() const | 182 FilterEffectRenderer* filterRenderer() const |
| 188 { | 183 { |
| 189 RenderLayerFilterInfo* filterInfo = this->filterInfo(); | 184 RenderLayerFilterInfo* filterInfo = this->filterInfo(); |
| 190 return filterInfo ? filterInfo->renderer() : 0; | 185 return filterInfo ? filterInfo->renderer() : 0; |
| 191 } | 186 } |
| 192 | 187 |
| 193 RenderLayerFilterInfo* filterInfo() const { return hasFilterInfo() ? RenderL
ayerFilterInfo::filterInfoForRenderLayer(this) : 0; } | 188 RenderLayerFilterInfo* filterInfo() const { return hasFilterInfo() ? RenderL
ayerFilterInfo::filterInfoForRenderLayer(this) : 0; } |
| 194 RenderLayerFilterInfo* ensureFilterInfo() { return RenderLayerFilterInfo::cr
eateFilterInfoForRenderLayerIfNeeded(this); } | 189 RenderLayerFilterInfo* ensureFilterInfo() { return RenderLayerFilterInfo::cr
eateFilterInfoForRenderLayerIfNeeded(this); } |
| 195 void removeFilterInfoIfNeeded() | 190 void removeFilterInfoIfNeeded() |
| 196 { | 191 { |
| 197 if (hasFilterInfo()) | 192 if (hasFilterInfo()) |
| 198 RenderLayerFilterInfo::removeFilterInfoForRenderLayer(this); | 193 RenderLayerFilterInfo::removeFilterInfoForRenderLayer(this); |
| 199 } | 194 } |
| 200 | 195 |
| 201 bool hasFilterInfo() const { return m_hasFilterInfo; } | 196 bool hasFilterInfo() const { return m_hasFilterInfo; } |
| 202 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo;
} | 197 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo;
} |
| 203 | 198 |
| 204 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
; | 199 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
; |
| 205 | 200 |
| 206 RenderLayerClipper& clipper() { return m_clipper; } | 201 RenderLayerClipper& clipper() { return m_clipper; } |
| 207 const RenderLayerClipper& clipper() const { return m_clipper; } | 202 const RenderLayerClipper& clipper() const { return m_clipper; } |
| 208 | 203 |
| 209 inline bool isPositionedContainer() const | 204 inline bool isPositionedContainer() const |
| 210 { | 205 { |
| 211 // FIXME: This is not in sync with containingBlock. | 206 // FIXME: This is not in sync with containingBlock. |
| 212 RenderBox* layerRenderer = renderer(); | 207 RenderBox* layerRenderer = renderer(); |
| 213 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); | 208 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); |
| 214 } | 209 } |
| 215 | 210 |
| 216 void updateOrRemoveFilterEffectRenderer(); | |
| 217 | |
| 218 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 211 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
| 219 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 212 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
| 220 | 213 |
| 221 private: | 214 private: |
| 222 // Bounding box in the coordinates of this layer. | 215 // Bounding box in the coordinates of this layer. |
| 223 LayoutRect logicalBoundingBox() const; | 216 LayoutRect logicalBoundingBox() const; |
| 224 | 217 |
| 225 void setNextSibling(RenderLayer* next) { m_next = next; } | 218 void setNextSibling(RenderLayer* next) { m_next = next; } |
| 226 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } | 219 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } |
| 227 void setFirstChild(RenderLayer* first) { m_first = first; } | 220 void setFirstChild(RenderLayer* first) { m_first = first; } |
| 228 void setLastChild(RenderLayer* last) { m_last = last; } | 221 void setLastChild(RenderLayer* last) { m_last = last; } |
| 229 | 222 |
| 230 LayoutPoint renderBoxLocation() const { return renderer()->location(); } | 223 LayoutPoint renderBoxLocation() const { return renderer()->location(); } |
| 231 | 224 |
| 232 bool shouldBeSelfPaintingLayer() const; | 225 bool shouldBeSelfPaintingLayer() const; |
| 233 | 226 |
| 234 // FIXME: We should only create the stacking node if needed. | 227 // FIXME: We should only create the stacking node if needed. |
| 235 bool requiresStackingNode() const { return true; } | 228 bool requiresStackingNode() const { return true; } |
| 236 void updateStackingNode(); | 229 void updateStackingNode(); |
| 237 | 230 |
| 238 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); | 231 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); |
| 239 | 232 |
| 240 void dirty3DTransformedDescendantStatus(); | 233 void dirty3DTransformedDescendantStatus(); |
| 241 | 234 |
| 242 void updateOrRemoveFilterClients(); | |
| 243 | |
| 244 LayerType m_layerType; | 235 LayerType m_layerType; |
| 245 | 236 |
| 246 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting | 237 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting |
| 247 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. | 238 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. |
| 248 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. | 239 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
| 249 unsigned m_isSelfPaintingLayer : 1; | 240 unsigned m_isSelfPaintingLayer : 1; |
| 250 | 241 |
| 251 const unsigned m_isRootLayer : 1; | 242 const unsigned m_isRootLayer : 1; |
| 252 | 243 |
| 253 unsigned m_3DTransformedDescendantStatusDirty : 1; | 244 unsigned m_3DTransformedDescendantStatusDirty : 1; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 269 | 260 |
| 270 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? | 261 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? |
| 271 OwnPtr<RenderLayerStackingNode> m_stackingNode; | 262 OwnPtr<RenderLayerStackingNode> m_stackingNode; |
| 272 | 263 |
| 273 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c
omposited layer's composited bounds compared to absolute coordinates. | 264 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a c
omposited layer's composited bounds compared to absolute coordinates. |
| 274 }; | 265 }; |
| 275 | 266 |
| 276 } // namespace blink | 267 } // namespace blink |
| 277 | 268 |
| 278 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ | 269 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ |
| OLD | NEW |