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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2173363002: Improve code readibility of PaintPropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra "const" (might be a typo) Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 if (registry.eventHandlerTargets(EventHandlerRegistry::TouchStartOrMoveE ventBlocking)->contains(node())) 2634 if (registry.eventHandlerTargets(EventHandlerRegistry::TouchStartOrMoveE ventBlocking)->contains(node()))
2635 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchS tartOrMoveEventBlocking); 2635 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchS tartOrMoveEventBlocking);
2636 } 2636 }
2637 2637
2638 setAncestorLineBoxDirty(false); 2638 setAncestorLineBoxDirty(false);
2639 2639
2640 if (selectionPaintInvalidationMap) 2640 if (selectionPaintInvalidationMap)
2641 selectionPaintInvalidationMap->remove(this); 2641 selectionPaintInvalidationMap->remove(this);
2642 2642
2643 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) 2643 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
2644 clearObjectPaintProperties(); 2644 objectPaintPropertiesMap().remove(this);
2645 2645
2646 clearLayoutRootIfNeeded(); 2646 clearLayoutRootIfNeeded();
2647 2647
2648 if (m_style) { 2648 if (m_style) {
2649 for (const FillLayer* bgLayer = &m_style->backgroundLayers(); bgLayer; b gLayer = bgLayer->next()) { 2649 for (const FillLayer* bgLayer = &m_style->backgroundLayers(); bgLayer; b gLayer = bgLayer->next()) {
2650 if (StyleImage* backgroundImage = bgLayer->image()) 2650 if (StyleImage* backgroundImage = bgLayer->image())
2651 backgroundImage->removeClient(this); 2651 backgroundImage->removeClient(this);
2652 } 2652 }
2653 2653
2654 for (const FillLayer* maskLayer = &m_style->maskLayers(); maskLayer; mas kLayer = maskLayer->next()) { 2654 for (const FillLayer* maskLayer = &m_style->maskLayers(); maskLayer; mas kLayer = maskLayer->next()) {
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
3620 ASSERT(frameView()); 3620 ASSERT(frameView());
3621 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject) 3621 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject)
3622 return; 3622 return;
3623 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object); 3623 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object);
3624 if (isBackgroundAttachmentFixedObject) 3624 if (isBackgroundAttachmentFixedObject)
3625 frameView()->addBackgroundAttachmentFixedObject(this); 3625 frameView()->addBackgroundAttachmentFixedObject(this);
3626 else 3626 else
3627 frameView()->removeBackgroundAttachmentFixedObject(this); 3627 frameView()->removeBackgroundAttachmentFixedObject(this);
3628 } 3628 }
3629 3629
3630 ObjectPaintProperties* LayoutObject::objectPaintProperties() const 3630 const ObjectPaintProperties* LayoutObject::objectPaintProperties() const
3631 { 3631 {
3632 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 3632 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
3633 return objectPaintPropertiesMap().get(this); 3633 return objectPaintPropertiesMap().get(this);
3634 } 3634 }
3635 3635
3636 ObjectPaintProperties& LayoutObject::ensureObjectPaintProperties() 3636 ObjectPaintProperties& LayoutObject::ensureObjectPaintProperties()
3637 { 3637 {
3638 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 3638 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
3639 auto addResult = objectPaintPropertiesMap().add(this, nullptr); 3639 auto addResult = objectPaintPropertiesMap().add(this, nullptr);
3640 if (addResult.isNewEntry) 3640 if (addResult.isNewEntry)
3641 addResult.storedValue->value = ObjectPaintProperties::create(); 3641 addResult.storedValue->value = ObjectPaintProperties::create();
3642 3642
3643 return *addResult.storedValue->value; 3643 return *addResult.storedValue->value;
3644 } 3644 }
3645 3645
3646 void LayoutObject::clearObjectPaintProperties()
3647 {
3648 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
3649 objectPaintPropertiesMap().remove(this);
3650 }
3651
3652 } // namespace blink 3646 } // namespace blink
3653 3647
3654 #ifndef NDEBUG 3648 #ifndef NDEBUG
3655 3649
3656 void showTree(const blink::LayoutObject* object) 3650 void showTree(const blink::LayoutObject* object)
3657 { 3651 {
3658 if (object) 3652 if (object)
3659 object->showTreeForThis(); 3653 object->showTreeForThis();
3660 else 3654 else
3661 WTFLogAlways("%s", "Cannot showTree. Root is (nil)"); 3655 WTFLogAlways("%s", "Cannot showTree. Root is (nil)");
(...skipping 18 matching lines...) Expand all
3680 const blink::LayoutObject* root = object1; 3674 const blink::LayoutObject* root = object1;
3681 while (root->parent()) 3675 while (root->parent())
3682 root = root->parent(); 3676 root = root->parent();
3683 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3677 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3684 } else { 3678 } else {
3685 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3679 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3686 } 3680 }
3687 } 3681 }
3688 3682
3689 #endif 3683 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/api/LayoutItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698