| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "sky/engine/core/rendering/LayerPaintingInfo.h" | 48 #include "sky/engine/core/rendering/LayerPaintingInfo.h" |
| 49 #include "sky/engine/core/rendering/RenderBox.h" | 49 #include "sky/engine/core/rendering/RenderBox.h" |
| 50 #include "sky/engine/core/rendering/RenderLayerClipper.h" | 50 #include "sky/engine/core/rendering/RenderLayerClipper.h" |
| 51 #include "sky/engine/core/rendering/RenderLayerStackingNode.h" | 51 #include "sky/engine/core/rendering/RenderLayerStackingNode.h" |
| 52 #include "sky/engine/core/rendering/RenderLayerStackingNodeIterator.h" | 52 #include "sky/engine/core/rendering/RenderLayerStackingNodeIterator.h" |
| 53 #include "sky/engine/public/platform/WebBlendMode.h" | 53 #include "sky/engine/public/platform/WebBlendMode.h" |
| 54 #include "sky/engine/wtf/OwnPtr.h" | 54 #include "sky/engine/wtf/OwnPtr.h" |
| 55 | 55 |
| 56 namespace blink { | 56 namespace blink { |
| 57 | 57 |
| 58 class FilterEffectRenderer; | |
| 59 class FilterOperations; | 58 class FilterOperations; |
| 60 class HitTestRequest; | 59 class HitTestRequest; |
| 61 class HitTestResult; | 60 class HitTestResult; |
| 62 class HitTestingTransformState; | 61 class HitTestingTransformState; |
| 63 class RenderStyle; | 62 class RenderStyle; |
| 64 class TransformationMatrix; | 63 class TransformationMatrix; |
| 65 | 64 |
| 66 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB
orderRadius }; | 65 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForB
orderRadius }; |
| 67 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; | 66 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; |
| 68 | 67 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // Both updates the status, and returns true if descendants of this have 3d. | 135 // Both updates the status, and returns true if descendants of this have 3d. |
| 137 bool update3DTransformedDescendantStatus(); | 136 bool update3DTransformedDescendantStatus(); |
| 138 | 137 |
| 139 // FIXME: reflections should force transform-style to be flat in the style:
https://bugs.webkit.org/show_bug.cgi?id=106959 | 138 // FIXME: reflections should force transform-style to be flat in the style:
https://bugs.webkit.org/show_bug.cgi?id=106959 |
| 140 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D
() == TransformStyle3DPreserve3D; } | 139 bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D
() == TransformStyle3DPreserve3D; } |
| 141 | 140 |
| 142 void* operator new(size_t); | 141 void* operator new(size_t); |
| 143 // Only safe to call from RenderBox::destroyLayer() | 142 // Only safe to call from RenderBox::destroyLayer() |
| 144 void operator delete(void*); | 143 void operator delete(void*); |
| 145 | 144 |
| 146 FilterEffectRenderer* filterRenderer() const | |
| 147 { | |
| 148 return m_filterRenderer.get(); | |
| 149 } | |
| 150 | |
| 151 RenderLayerClipper& clipper() { return m_clipper; } | 145 RenderLayerClipper& clipper() { return m_clipper; } |
| 152 const RenderLayerClipper& clipper() const { return m_clipper; } | 146 const RenderLayerClipper& clipper() const { return m_clipper; } |
| 153 | 147 |
| 154 inline bool isPositionedContainer() const | 148 inline bool isPositionedContainer() const |
| 155 { | 149 { |
| 156 // FIXME: This is not in sync with containingBlock. | 150 // FIXME: This is not in sync with containingBlock. |
| 157 return isRootLayer() || renderer()->isPositioned() || renderer()->hasTra
nsform(); | 151 return isRootLayer() || renderer()->isPositioned() || renderer()->hasTra
nsform(); |
| 158 } | 152 } |
| 159 | 153 |
| 160 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 154 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
| 161 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 155 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
| 162 | 156 |
| 163 private: | 157 private: |
| 164 // Bounding box in the coordinates of this layer. | 158 // Bounding box in the coordinates of this layer. |
| 165 LayoutRect logicalBoundingBox() const; | 159 LayoutRect logicalBoundingBox() const; |
| 166 | 160 |
| 167 void setNextSibling(RenderLayer* next) { m_next = next; } | 161 void setNextSibling(RenderLayer* next) { m_next = next; } |
| 168 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } | 162 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } |
| 169 void setFirstChild(RenderLayer* first) { m_first = first; } | 163 void setFirstChild(RenderLayer* first) { m_first = first; } |
| 170 void setLastChild(RenderLayer* last) { m_last = last; } | 164 void setLastChild(RenderLayer* last) { m_last = last; } |
| 171 | 165 |
| 172 bool shouldBeSelfPaintingLayer() const; | 166 bool shouldBeSelfPaintingLayer() const; |
| 173 | 167 |
| 174 void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
; | |
| 175 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); | 168 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); |
| 176 | 169 |
| 177 void dirty3DTransformedDescendantStatus(); | 170 void dirty3DTransformedDescendantStatus(); |
| 178 | 171 |
| 179 LayerType m_layerType; | 172 LayerType m_layerType; |
| 180 | 173 |
| 181 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting | 174 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting |
| 182 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. | 175 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. |
| 183 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. | 176 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
| 184 unsigned m_isSelfPaintingLayer : 1; | 177 unsigned m_isSelfPaintingLayer : 1; |
| 185 | 178 |
| 186 const unsigned m_isRootLayer : 1; | 179 const unsigned m_isRootLayer : 1; |
| 187 | 180 |
| 188 unsigned m_3DTransformedDescendantStatusDirty : 1; | 181 unsigned m_3DTransformedDescendantStatusDirty : 1; |
| 189 // Set on a stacking context layer that has 3D descendants anywhere | 182 // Set on a stacking context layer that has 3D descendants anywhere |
| 190 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. | 183 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. |
| 191 unsigned m_has3DTransformedDescendant : 1; | 184 unsigned m_has3DTransformedDescendant : 1; |
| 192 | 185 |
| 193 RenderBox* m_renderer; | 186 RenderBox* m_renderer; |
| 194 | 187 |
| 195 RenderLayer* m_parent; | 188 RenderLayer* m_parent; |
| 196 RenderLayer* m_previous; | 189 RenderLayer* m_previous; |
| 197 RenderLayer* m_next; | 190 RenderLayer* m_next; |
| 198 RenderLayer* m_first; | 191 RenderLayer* m_first; |
| 199 RenderLayer* m_last; | 192 RenderLayer* m_last; |
| 200 | 193 |
| 201 OwnPtr<TransformationMatrix> m_transform; | 194 OwnPtr<TransformationMatrix> m_transform; |
| 202 OwnPtr<FilterEffectRenderer> m_filterRenderer; | |
| 203 | 195 |
| 204 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? | 196 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? |
| 205 OwnPtr<RenderLayerStackingNode> m_stackingNode; | 197 OwnPtr<RenderLayerStackingNode> m_stackingNode; |
| 206 }; | 198 }; |
| 207 | 199 |
| 208 } // namespace blink | 200 } // namespace blink |
| 209 | 201 |
| 210 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ | 202 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ |
| OLD | NEW |