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

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

Issue 1060973003: compositor-worker: Force elements to grow a layer when a CompositorProxy is created. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tot-merge Created 5 years, 8 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 | Annotate | Revision Log
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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 double scaledTop = view->scrollPositionDouble().y(); 944 double scaledTop = view->scrollPositionDouble().y();
945 if (scrollToOptions.hasLeft()) 945 if (scrollToOptions.hasLeft())
946 scaledLeft = scrollToOptions.left() * frame->pageZoomFactor(); 946 scaledLeft = scrollToOptions.left() * frame->pageZoomFactor();
947 if (scrollToOptions.hasTop()) 947 if (scrollToOptions.hasTop())
948 scaledTop = scrollToOptions.top() * frame->pageZoomFactor(); 948 scaledTop = scrollToOptions.top() * frame->pageZoomFactor();
949 view->setScrollPosition(DoublePoint(scaledLeft, scaledTop), scrollBehavior); 949 view->setScrollPosition(DoublePoint(scaledLeft, scaledTop), scrollBehavior);
950 } 950 }
951 951
952 void Element::incrementProxyCount() 952 void Element::incrementProxyCount()
953 { 953 {
954 ensureElementRareData().incrementProxyCount(); 954 if (ensureElementRareData().incrementProxyCount() == 1)
955 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy));
955 } 956 }
956 957
957 void Element::decrementProxyCount() 958 void Element::decrementProxyCount()
958 { 959 {
959 ensureElementRareData().decrementProxyCount(); 960 if (ensureElementRareData().decrementProxyCount() == 0)
961 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy));
960 } 962 }
961 963
962 IntRect Element::boundsInViewportSpace() 964 IntRect Element::boundsInViewportSpace()
963 { 965 {
964 document().updateLayoutIgnorePendingStylesheets(); 966 document().updateLayoutIgnorePendingStylesheets();
965 967
966 FrameView* view = document().view(); 968 FrameView* view = document().view();
967 if (!view) 969 if (!view)
968 return IntRect(); 970 return IntRect();
969 971
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 if (ElementAnimations* elementAnimations = this->elementAnimations()) { 1646 if (ElementAnimations* elementAnimations = this->elementAnimations()) {
1645 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this); 1647 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this);
1646 elementAnimations->updateAnimationFlags(*style); 1648 elementAnimations->updateAnimationFlags(*style);
1647 } 1649 }
1648 1650
1649 if (style->hasTransform()) { 1651 if (style->hasTransform()) {
1650 if (const StylePropertySet* inlineStyle = this->inlineStyle()) 1652 if (const StylePropertySet* inlineStyle = this->inlineStyle())
1651 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform)); 1653 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform));
1652 } 1654 }
1653 1655
1656 if (hasRareData() && elementRareData()->proxyCount() > 0)
1657 style->setHasCompositorProxy(true);
1658
1654 document().didRecalculateStyleForElement(); 1659 document().didRecalculateStyleForElement();
1655 return style.release(); 1660 return style.release();
1656 } 1661 }
1657 1662
1658 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject() 1663 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject()
1659 { 1664 {
1660 ASSERT(document().inStyleRecalc()); 1665 ASSERT(document().inStyleRecalc());
1661 return document().ensureStyleResolver().styleForElement(this); 1666 return document().ensureStyleResolver().styleForElement(this);
1662 } 1667 }
1663 1668
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
3506 { 3511 {
3507 #if ENABLE(OILPAN) 3512 #if ENABLE(OILPAN)
3508 if (hasRareData()) 3513 if (hasRareData())
3509 visitor->trace(elementRareData()); 3514 visitor->trace(elementRareData());
3510 visitor->trace(m_elementData); 3515 visitor->trace(m_elementData);
3511 #endif 3516 #endif
3512 ContainerNode::trace(visitor); 3517 ContainerNode::trace(visitor);
3513 } 3518 }
3514 3519
3515 } // namespace blink 3520 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html ('k') | Source/core/dom/StyleChangeReason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698