| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 if (object.paintProperties() && object.paintProperties()->transform()) { | 300 if (object.paintProperties() && object.paintProperties()->transform()) { |
| 301 context.current.transform = object.paintProperties()->transform(); | 301 context.current.transform = object.paintProperties()->transform(); |
| 302 context.current.shouldFlattenInheritedTransform = false; | 302 context.current.shouldFlattenInheritedTransform = false; |
| 303 context.current.renderingContextID = 0; | 303 context.current.renderingContextID = 0; |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 static CompositingReasons compositingReasonsForTransform( | 307 static CompositingReasons compositingReasonsForTransform( |
| 308 const LayoutObject& object) { | 308 const LayoutObject& object) { |
| 309 |
| 309 CompositingReasons compositingReasons = CompositingReasonNone; | 310 CompositingReasons compositingReasons = CompositingReasonNone; |
| 310 if (CompositingReasonFinder::requiresCompositingForTransform(object)) | 311 if (CompositingReasonFinder::requiresCompositingForTransform(object)) |
| 311 compositingReasons |= CompositingReason3DTransform; | 312 compositingReasons |= CompositingReason3DTransform; |
| 312 | 313 |
| 313 if (CompositingReasonFinder::requiresCompositingForTransformAnimation( | 314 if (CompositingReasonFinder::requiresCompositingForTransformAnimation( |
| 314 object.styleRef())) | 315 object.styleRef())) |
| 315 compositingReasons |= CompositingReasonActiveAnimation; | 316 compositingReasons |= CompositingReasonActiveAnimation; |
| 316 | 317 |
| 317 if (object.styleRef().hasWillChangeCompositingHint() && | 318 if (object.styleRef().hasWillChangeCompositingHint() && |
| 318 !object.styleRef().subtreeWillChangeContents()) | 319 !object.styleRef().subtreeWillChangeContents()) |
| 319 compositingReasons |= CompositingReasonWillChangeCompositingHint; | 320 compositingReasons |= CompositingReasonWillChangeCompositingHint; |
| 320 | 321 |
| 322 if (object.isBoxModelObject()) { |
| 323 const LayoutBoxModelObject* box = toLayoutBoxModelObject(&object); |
| 324 if (box->hasLayer()) { |
| 325 // TODO(chrishtr): move this to the descendant-dependent flags recursion |
| 326 // PaintLayer::updateDescendantDependentFlags. |
| 327 box->layer()->update3DTransformedDescendantStatus(); |
| 328 |
| 329 if (box->layer()->has3DTransformedDescendant()) |
| 330 compositingReasons |= CompositingReason3DTransform; |
| 331 } |
| 332 } |
| 333 |
| 321 return compositingReasons; | 334 return compositingReasons; |
| 322 } | 335 } |
| 323 | 336 |
| 324 static FloatPoint3D transformOrigin(const LayoutBox& box) { | 337 static FloatPoint3D transformOrigin(const LayoutBox& box) { |
| 325 const ComputedStyle& style = box.styleRef(); | 338 const ComputedStyle& style = box.styleRef(); |
| 326 // Transform origin has no effect without a transform or motion path. | 339 // Transform origin has no effect without a transform or motion path. |
| 327 if (!style.hasTransform()) | 340 if (!style.hasTransform()) |
| 328 return FloatPoint3D(); | 341 return FloatPoint3D(); |
| 329 FloatSize borderBoxSize(box.size()); | 342 FloatSize borderBoxSize(box.size()); |
| 330 return FloatPoint3D( | 343 return FloatPoint3D( |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 updateOverflowClip(object, context); | 984 updateOverflowClip(object, context); |
| 972 updatePerspective(object, context); | 985 updatePerspective(object, context); |
| 973 updateSvgLocalToBorderBoxTransform(object, context); | 986 updateSvgLocalToBorderBoxTransform(object, context); |
| 974 updateScrollAndScrollTranslation(object, context); | 987 updateScrollAndScrollTranslation(object, context); |
| 975 updateOutOfFlowContext(object, context); | 988 updateOutOfFlowContext(object, context); |
| 976 | 989 |
| 977 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 990 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 978 } | 991 } |
| 979 | 992 |
| 980 } // namespace blink | 993 } // namespace blink |
| OLD | NEW |