| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PaintPropertyTreeBuilder_h | 5 #ifndef PaintPropertyTreeBuilder_h |
| 6 #define PaintPropertyTreeBuilder_h | 6 #define PaintPropertyTreeBuilder_h |
| 7 | 7 |
| 8 #include "platform/geometry/LayoutPoint.h" | 8 #include "platform/geometry/LayoutPoint.h" |
| 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
| 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
| 11 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" | 11 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" |
| 12 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 12 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
| 13 #include "platform/wtf/RefPtr.h" | 13 #include "platform/wtf/RefPtr.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class FrameView; | 17 class FrameView; |
| 18 class LayoutBoxModelObject; | 18 class LayoutBoxModelObject; |
| 19 class LayoutObject; | 19 class LayoutObject; |
| 20 class PaintLayer; |
| 20 | 21 |
| 21 // The context for PaintPropertyTreeBuilder. | 22 // The context for PaintPropertyTreeBuilder. |
| 22 // It's responsible for bookkeeping tree state in other order, for example, the | 23 // It's responsible for bookkeeping tree state in other order, for example, the |
| 23 // most recent position container seen. | 24 // most recent position container seen. |
| 24 struct PaintPropertyTreeBuilderContext { | 25 struct PaintPropertyTreeBuilderContext { |
| 25 USING_FAST_MALLOC(PaintPropertyTreeBuilderContext); | 26 USING_FAST_MALLOC(PaintPropertyTreeBuilderContext); |
| 26 | 27 |
| 27 public: | 28 public: |
| 28 // Initializes all property tree nodes to the roots. | 29 // Initializes all property tree nodes to the roots. |
| 29 PaintPropertyTreeBuilderContext(); | 30 PaintPropertyTreeBuilderContext(); |
| 30 | 31 |
| 31 // State that propagates on the containing block chain (and so is adjusted | 32 // State that propagates on the containing block chain (and so is adjusted |
| 32 // when an absolute or fixed position object is encountered). | 33 // when an absolute or fixed position object is encountered). |
| 33 struct ContainingBlockContext { | 34 struct ContainingBlockContext { |
| 34 // The combination of a transform and paint offset describes a linear space. | 35 // The combination of a transform and paint offset describes a linear space. |
| 35 // When a layout object recur to its children, the main context is expected | 36 // When a layout object recur to its children, the main context is expected |
| 36 // to refer the object's border box, then the callee will derive its own | 37 // to refer the object's border box, then the callee will derive its own |
| 37 // border box by translating the space with its own layout location. | 38 // border box by translating the space with its own layout location. |
| 38 const TransformPaintPropertyNode* transform = nullptr; | 39 const TransformPaintPropertyNode* transform = nullptr; |
| 40 // The PaintLayer that owns |transform|. |
| 41 const PaintLayer* transform_paint_layer = nullptr; |
| 39 LayoutPoint paint_offset; | 42 LayoutPoint paint_offset; |
| 40 // Whether newly created children should flatten their inherited transform | 43 // Whether newly created children should flatten their inherited transform |
| 41 // (equivalently, draw into the plane of their parent). Should generally | 44 // (equivalently, draw into the plane of their parent). Should generally |
| 42 // be updated whenever |transform| is; flattening only needs to happen | 45 // be updated whenever |transform| is; flattening only needs to happen |
| 43 // to immediate children. | 46 // to immediate children. |
| 44 bool should_flatten_inherited_transform = false; | 47 bool should_flatten_inherited_transform = false; |
| 45 // Rendering context for 3D sorting. See | 48 // Rendering context for 3D sorting. See |
| 46 // TransformPaintPropertyNode::renderingContextId. | 49 // TransformPaintPropertyNode::renderingContextId. |
| 47 unsigned rendering_context_id = 0; | 50 unsigned rendering_context_id = 0; |
| 48 // The clip node describes the accumulated raster clip for the current | 51 // The clip node describes the accumulated raster clip for the current |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 const LayoutObject&, | 162 const LayoutObject&, |
| 160 PaintPropertyTreeBuilderContext&); | 163 PaintPropertyTreeBuilderContext&); |
| 161 ALWAYS_INLINE static void UpdateOutOfFlowContext( | 164 ALWAYS_INLINE static void UpdateOutOfFlowContext( |
| 162 const LayoutObject&, | 165 const LayoutObject&, |
| 163 PaintPropertyTreeBuilderContext&); | 166 PaintPropertyTreeBuilderContext&); |
| 164 }; | 167 }; |
| 165 | 168 |
| 166 } // namespace blink | 169 } // namespace blink |
| 167 | 170 |
| 168 #endif // PaintPropertyTreeBuilder_h | 171 #endif // PaintPropertyTreeBuilder_h |
| OLD | NEW |