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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rebase error. Created 5 years 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) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 967
968 double scaledLeft = viewport->scrollPositionDouble().x(); 968 double scaledLeft = viewport->scrollPositionDouble().x();
969 double scaledTop = viewport->scrollPositionDouble().y(); 969 double scaledTop = viewport->scrollPositionDouble().y();
970 if (scrollToOptions.hasLeft()) 970 if (scrollToOptions.hasLeft())
971 scaledLeft = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.le ft()) * frame->pageZoomFactor(); 971 scaledLeft = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.le ft()) * frame->pageZoomFactor();
972 if (scrollToOptions.hasTop()) 972 if (scrollToOptions.hasTop())
973 scaledTop = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.top ()) * frame->pageZoomFactor(); 973 scaledTop = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.top ()) * frame->pageZoomFactor();
974 viewport->setScrollPosition(DoublePoint(scaledLeft, scaledTop), Programmatic Scroll, scrollBehavior); 974 viewport->setScrollPosition(DoublePoint(scaledLeft, scaledTop), Programmatic Scroll, scrollBehavior);
975 } 975 }
976 976
977 void Element::incrementProxyCount() 977 bool Element::hasCompositorProxy() const
978 { 978 {
979 if (ensureElementRareData().incrementProxyCount() == 1) 979 return hasRareData() && elementRareData()->proxiedPropertyCounts();
980 }
981
982 void Element::incrementCompositorProxiedProperties(uint32_t mutableProperties)
983 {
984 ElementRareData& rareData = ensureElementRareData();
985 if (!rareData.proxiedPropertyCounts())
986 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy));
987 rareData.incrementCompositorProxiedProperties(mutableProperties);
988 }
989
990 void Element::decrementCompositorProxiedProperties(uint32_t mutableProperties)
991 {
992 ElementRareData& rareData = *elementRareData();
993 rareData.decrementCompositorProxiedProperties(mutableProperties);
994 if (!rareData.proxiedPropertyCounts())
980 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy)); 995 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy));
981 } 996 }
982 997
983 void Element::decrementProxyCount() 998 uint32_t Element::compositorMutableProperties() const
984 { 999 {
985 if (ensureElementRareData().decrementProxyCount() == 0) 1000 if (!hasRareData())
986 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy)); 1001 return WebCompositorMutablePropertyNone;
1002 if (CompositorProxiedPropertySet* set = elementRareData()->proxiedPropertyCo unts())
1003 return set->proxiedProperties();
1004 return WebCompositorMutablePropertyNone;
987 } 1005 }
988 1006
989 bool Element::hasNonEmptyLayoutSize() const 1007 bool Element::hasNonEmptyLayoutSize() const
990 { 1008 {
991 document().updateLayoutIgnorePendingStylesheets(); 1009 document().updateLayoutIgnorePendingStylesheets();
992 1010
993 if (LayoutBoxModelObject* box = layoutBoxModelObject()) 1011 if (LayoutBoxModelObject* box = layoutBoxModelObject())
994 return box->hasNonEmptyLayoutSize(); 1012 return box->hasNonEmptyLayoutSize();
995 return false; 1013 return false;
996 } 1014 }
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 if (ElementAnimations* elementAnimations = this->elementAnimations()) { 1698 if (ElementAnimations* elementAnimations = this->elementAnimations()) {
1681 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this); 1699 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this);
1682 elementAnimations->updateAnimationFlags(*style); 1700 elementAnimations->updateAnimationFlags(*style);
1683 } 1701 }
1684 1702
1685 if (style->hasTransform()) { 1703 if (style->hasTransform()) {
1686 if (const StylePropertySet* inlineStyle = this->inlineStyle()) 1704 if (const StylePropertySet* inlineStyle = this->inlineStyle())
1687 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform)); 1705 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform));
1688 } 1706 }
1689 1707
1690 if (hasRareData() && elementRareData()->proxyCount() > 0)
1691 style->setHasCompositorProxy(true);
1692
1693 document().didRecalculateStyleForElement(); 1708 document().didRecalculateStyleForElement();
1694 return style.release(); 1709 return style.release();
1695 } 1710 }
1696 1711
1697 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject() 1712 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject()
1698 { 1713 {
1699 ASSERT(document().inStyleRecalc()); 1714 ASSERT(document().inStyleRecalc());
1700 return document().ensureStyleResolver().styleForElement(this); 1715 return document().ensureStyleResolver().styleForElement(this);
1701 } 1716 }
1702 1717
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after
3616 { 3631 {
3617 #if ENABLE(OILPAN) 3632 #if ENABLE(OILPAN)
3618 if (hasRareData()) 3633 if (hasRareData())
3619 visitor->trace(elementRareData()); 3634 visitor->trace(elementRareData());
3620 visitor->trace(m_elementData); 3635 visitor->trace(m_elementData);
3621 #endif 3636 #endif
3622 ContainerNode::trace(visitor); 3637 ContainerNode::trace(visitor);
3623 } 3638 }
3624 3639
3625 } // namespace blink 3640 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698