Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2604973002: Move computation of 3D descendants to the descendant-dependent flags walk. (Closed)
Patch Set: none Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 if (object.paintProperties() && object.paintProperties()->transform()) { 301 if (object.paintProperties() && object.paintProperties()->transform()) {
302 context.current.transform = object.paintProperties()->transform(); 302 context.current.transform = object.paintProperties()->transform();
303 context.current.shouldFlattenInheritedTransform = false; 303 context.current.shouldFlattenInheritedTransform = false;
304 context.current.renderingContextID = 0; 304 context.current.renderingContextID = 0;
305 } 305 }
306 } 306 }
307 307
308 static CompositingReasons compositingReasonsForTransform( 308 static CompositingReasons compositingReasonsForTransform(
309 const LayoutObject& object) { 309 const LayoutObject& object) {
310 const ComputedStyle& style = object.styleRef();
310 CompositingReasons compositingReasons = CompositingReasonNone; 311 CompositingReasons compositingReasons = CompositingReasonNone;
311 if (CompositingReasonFinder::requiresCompositingForTransform(object)) 312 if (CompositingReasonFinder::requiresCompositingForTransform(object))
312 compositingReasons |= CompositingReason3DTransform; 313 compositingReasons |= CompositingReason3DTransform;
313 314
314 if (CompositingReasonFinder::requiresCompositingForTransformAnimation( 315 if (CompositingReasonFinder::requiresCompositingForTransformAnimation(style))
315 object.styleRef()))
316 compositingReasons |= CompositingReasonActiveAnimation; 316 compositingReasons |= CompositingReasonActiveAnimation;
317 317
318 if (object.styleRef().hasWillChangeCompositingHint() && 318 if (style.hasWillChangeCompositingHint() &&
319 !object.styleRef().subtreeWillChangeContents()) 319 !style.subtreeWillChangeContents())
320 compositingReasons |= CompositingReasonWillChangeCompositingHint; 320 compositingReasons |= CompositingReasonWillChangeCompositingHint;
321 321
322 if (object.isBoxModelObject()) { 322 if (object.isBoxModelObject() &&
Xianzhu 2016/12/28 18:08:11 Not related to the change, but just a question: we
323 (style.hasPerspective() ||
324 style.usedTransformStyle3D() == TransformStyle3DPreserve3D)) {
323 const LayoutBoxModelObject* box = toLayoutBoxModelObject(&object); 325 const LayoutBoxModelObject* box = toLayoutBoxModelObject(&object);
324 if (box->hasLayer()) { 326 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()) 327 if (box->layer()->has3DTransformedDescendant())
330 compositingReasons |= CompositingReason3DTransform; 328 compositingReasons |= CompositingReason3DTransform;
331 } 329 }
332 } 330 }
333 331
334 return compositingReasons; 332 return compositingReasons;
335 } 333 }
336 334
337 static FloatPoint3D transformOrigin(const LayoutBox& box) { 335 static FloatPoint3D transformOrigin(const LayoutBox& box) {
338 const ComputedStyle& style = box.styleRef(); 336 const ComputedStyle& style = box.styleRef();
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 updateOverflowClip(object, context); 986 updateOverflowClip(object, context);
989 updatePerspective(object, context); 987 updatePerspective(object, context);
990 updateSvgLocalToBorderBoxTransform(object, context); 988 updateSvgLocalToBorderBoxTransform(object, context);
991 updateScrollAndScrollTranslation(object, context); 989 updateScrollAndScrollTranslation(object, context);
992 updateOutOfFlowContext(object, context); 990 updateOutOfFlowContext(object, context);
993 991
994 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); 992 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate();
995 } 993 }
996 994
997 } // namespace blink 995 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698