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 #include "core/paint/PaintPropertyTreeBuilder.h" | 5 #include "core/paint/PaintPropertyTreeBuilder.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 const LayoutObject& object, | 211 const LayoutObject& object, |
212 PaintPropertyTreeBuilderContext& context) { | 212 PaintPropertyTreeBuilderContext& context) { |
213 bool usesPaintOffsetTranslation = false; | 213 bool usesPaintOffsetTranslation = false; |
214 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 214 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
215 object.isLayoutView()) { | 215 object.isLayoutView()) { |
216 // Root layer scrolling always creates a translation node for LayoutView to | 216 // Root layer scrolling always creates a translation node for LayoutView to |
217 // ensure fixed and absolute contexts use the correct transform space. | 217 // ensure fixed and absolute contexts use the correct transform space. |
218 usesPaintOffsetTranslation = true; | 218 usesPaintOffsetTranslation = true; |
219 } else if (object.isBoxModelObject() && | 219 } else if (object.isBoxModelObject() && |
220 context.current.paintOffset != LayoutPoint()) { | 220 context.current.paintOffset != LayoutPoint()) { |
221 // TODO(trchen): Eliminate PaintLayer dependency. | |
222 // TODO(chrishtr): When changing the condition here, make sure to update | |
223 // the condition in LayoutBoxModelObject::styleDidChange() above | |
224 // setNeedsPaintPropertyUpdate(). | |
225 PaintLayer* layer = toLayoutBoxModelObject(object).layer(); | 221 PaintLayer* layer = toLayoutBoxModelObject(object).layer(); |
226 if (layer && | 222 if (layer && layer->paintsWithTransform(GlobalPaintNormalPhase)) |
227 layer->paintsWithTransform(GlobalPaintFlattenCompositingLayers)) | |
228 usesPaintOffsetTranslation = true; | 223 usesPaintOffsetTranslation = true; |
229 } | 224 } |
230 | 225 |
231 // We should use the same subpixel paint offset values for snapping | 226 // We should use the same subpixel paint offset values for snapping |
232 // regardless of whether a transform is present. If there is a transform | 227 // regardless of whether a transform is present. If there is a transform |
233 // we round the paint offset but keep around the residual fractional | 228 // we round the paint offset but keep around the residual fractional |
234 // component for the transformed content to paint with. In spv1 this was | 229 // component for the transformed content to paint with. In spv1 this was |
235 // called "subpixel accumulation". For more information, see | 230 // called "subpixel accumulation". For more information, see |
236 // PaintLayer::subpixelAccumulation() and | 231 // PaintLayer::subpixelAccumulation() and |
237 // PaintLayerPainter::paintFragmentByApplyingTransform. | 232 // PaintLayerPainter::paintFragmentByApplyingTransform. |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 #endif | 947 #endif |
953 | 948 |
954 updateOverflowClip(object, context); | 949 updateOverflowClip(object, context); |
955 updatePerspective(object, context); | 950 updatePerspective(object, context); |
956 updateSvgLocalToBorderBoxTransform(object, context); | 951 updateSvgLocalToBorderBoxTransform(object, context); |
957 updateScrollAndScrollTranslation(object, context); | 952 updateScrollAndScrollTranslation(object, context); |
958 updateOutOfFlowContext(object, context); | 953 updateOutOfFlowContext(object, context); |
959 } | 954 } |
960 | 955 |
961 } // namespace blink | 956 } // namespace blink |
OLD | NEW |