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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const LayoutObject& object, | 212 const LayoutObject& object, |
213 PaintPropertyTreeBuilderContext& context) { | 213 PaintPropertyTreeBuilderContext& context) { |
214 bool usesPaintOffsetTranslation = false; | 214 bool usesPaintOffsetTranslation = false; |
215 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 215 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
216 object.isLayoutView()) { | 216 object.isLayoutView()) { |
217 // Root layer scrolling always creates a translation node for LayoutView to | 217 // Root layer scrolling always creates a translation node for LayoutView to |
218 // ensure fixed and absolute contexts use the correct transform space. | 218 // ensure fixed and absolute contexts use the correct transform space. |
219 usesPaintOffsetTranslation = true; | 219 usesPaintOffsetTranslation = true; |
220 } else if (object.isBoxModelObject() && | 220 } else if (object.isBoxModelObject() && |
221 context.current.paintOffset != LayoutPoint()) { | 221 context.current.paintOffset != LayoutPoint()) { |
222 // TODO(trchen): Eliminate PaintLayer dependency. | |
223 // TODO(chrishtr): When changing the condition here, make sure to update | |
224 // the condition in LayoutBoxModelObject::styleDidChange() above | |
225 // setNeedsPaintPropertyUpdate(). | |
226 PaintLayer* layer = toLayoutBoxModelObject(object).layer(); | 222 PaintLayer* layer = toLayoutBoxModelObject(object).layer(); |
227 if (layer && | 223 if (layer && layer->paintsWithTransform(GlobalPaintNormalPhase)) |
228 layer->paintsWithTransform(GlobalPaintFlattenCompositingLayers)) | |
229 usesPaintOffsetTranslation = true; | 224 usesPaintOffsetTranslation = true; |
230 } | 225 } |
231 | 226 |
232 // We should use the same subpixel paint offset values for snapping | 227 // We should use the same subpixel paint offset values for snapping |
233 // regardless of whether a transform is present. If there is a transform | 228 // regardless of whether a transform is present. If there is a transform |
234 // we round the paint offset but keep around the residual fractional | 229 // we round the paint offset but keep around the residual fractional |
235 // component for the transformed content to paint with. In spv1 this was | 230 // component for the transformed content to paint with. In spv1 this was |
236 // called "subpixel accumulation". For more information, see | 231 // called "subpixel accumulation". For more information, see |
237 // PaintLayer::subpixelAccumulation() and | 232 // PaintLayer::subpixelAccumulation() and |
238 // PaintLayerPainter::paintFragmentByApplyingTransform. | 233 // PaintLayerPainter::paintFragmentByApplyingTransform. |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 updateOverflowClip(object, context); | 983 updateOverflowClip(object, context); |
989 updatePerspective(object, context); | 984 updatePerspective(object, context); |
990 updateSvgLocalToBorderBoxTransform(object, context); | 985 updateSvgLocalToBorderBoxTransform(object, context); |
991 updateScrollAndScrollTranslation(object, context); | 986 updateScrollAndScrollTranslation(object, context); |
992 updateOutOfFlowContext(object, context); | 987 updateOutOfFlowContext(object, context); |
993 | 988 |
994 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 989 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
995 } | 990 } |
996 | 991 |
997 } // namespace blink | 992 } // namespace blink |
OLD | NEW |