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

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 475553002: Squashed fixed position layers shouldn't flicker while scrolling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 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
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 if (!scrollingCoordinator) 967 if (!scrollingCoordinator)
968 return; 968 return;
969 969
970 scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer); 970 scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer);
971 971
972 // Page scale is applied as a transform on the root render view layer. Becau se the scroll 972 // Page scale is applied as a transform on the root render view layer. Becau se the scroll
973 // layer is further up in the hierarchy, we need to avoid marking the root r ender view 973 // layer is further up in the hierarchy, we need to avoid marking the root r ender view
974 // layer as a container. 974 // layer as a container.
975 bool isContainer = m_owningLayer.hasTransform() && !m_owningLayer.isRootLaye r(); 975 bool isContainer = m_owningLayer.hasTransform() && !m_owningLayer.isRootLaye r();
976 // FIXME: we should make certain that childForSuperLayers will never be the m_squashingContainmentLayer here 976 // FIXME: we should make certain that childForSuperLayers will never be the m_squashingContainmentLayer here
977 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(localRootFor OwningLayer(), isContainer); 977 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer);
978 } 978 }
979 979
980 void CompositedLayerMapping::updateInternalHierarchy() 980 void CompositedLayerMapping::updateInternalHierarchy()
981 { 981 {
982 // m_foregroundLayer has to be inserted in the correct order with child laye rs, 982 // m_foregroundLayer has to be inserted in the correct order with child laye rs,
983 // so it's not inserted here. 983 // so it's not inserted here.
984 if (m_ancestorClippingLayer) 984 if (m_ancestorClippingLayer)
985 m_ancestorClippingLayer->removeAllChildren(); 985 m_ancestorClippingLayer->removeAllChildren();
986 986
987 m_graphicsLayer->removeFromParent(); 987 m_graphicsLayer->removeFromParent();
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 1850
1851 if (m_childContainmentLayer) 1851 if (m_childContainmentLayer)
1852 return m_childContainmentLayer.get(); 1852 return m_childContainmentLayer.get();
1853 1853
1854 if (m_childTransformLayer) 1854 if (m_childTransformLayer)
1855 return m_childTransformLayer.get(); 1855 return m_childTransformLayer.get();
1856 1856
1857 return m_graphicsLayer.get(); 1857 return m_graphicsLayer.get();
1858 } 1858 }
1859 1859
1860 GraphicsLayer* CompositedLayerMapping::localRootForOwningLayer() const
1861 {
1862 if (m_ancestorClippingLayer)
1863 return m_ancestorClippingLayer.get();
1864
1865 return m_graphicsLayer.get();
1866 }
1867
1868 GraphicsLayer* CompositedLayerMapping::childForSuperlayers() const 1860 GraphicsLayer* CompositedLayerMapping::childForSuperlayers() const
1869 { 1861 {
1870 if (m_squashingContainmentLayer) 1862 if (m_squashingContainmentLayer)
1871 return m_squashingContainmentLayer.get(); 1863 return m_squashingContainmentLayer.get();
1872 1864
1873 return localRootForOwningLayer(); 1865 if (m_ancestorClippingLayer)
1866 return m_ancestorClippingLayer.get();
1867
1868 return m_graphicsLayer.get();
1874 } 1869 }
1875 1870
1876 GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const 1871 GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const
1877 { 1872 {
1878 if (GraphicsLayer* clipLayer = clippingLayer()) 1873 if (GraphicsLayer* clipLayer = clippingLayer())
1879 return clipLayer; 1874 return clipLayer;
1880 if (m_scrollingLayer) 1875 if (m_scrollingLayer)
1881 return m_scrollingLayer.get(); 1876 return m_scrollingLayer.get();
1882 return m_childTransformLayer.get(); 1877 return m_childTransformLayer.get();
1883 } 1878 }
(...skipping 24 matching lines...) Expand all
1908 || m_owningLayer.transform() 1903 || m_owningLayer.transform()
1909 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME: Revisit this if the paintsIntoCompositedAncestor state is removed. 1904 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME: Revisit this if the paintsIntoCompositedAncestor state is removed.
1910 || renderer->isTransparent() 1905 || renderer->isTransparent()
1911 || renderer->hasMask() 1906 || renderer->hasMask()
1912 || renderer->hasReflection() 1907 || renderer->hasReflection()
1913 || renderer->hasFilter(); 1908 || renderer->hasFilter();
1914 1909
1915 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) 1910 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor)
1916 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer); 1911 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer);
1917 1912
1918
1919 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa ckingStoreForIntrinsicReasons; 1913 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa ckingStoreForIntrinsicReasons;
1920 } 1914 }
1921 1915
1922 void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode) 1916 void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode)
1923 { 1917 {
1924 if (m_ancestorClippingLayer) { 1918 if (m_ancestorClippingLayer) {
1925 m_ancestorClippingLayer->setBlendMode(blendMode); 1919 m_ancestorClippingLayer->setBlendMode(blendMode);
1926 m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal); 1920 m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal);
1927 } else { 1921 } else {
1928 m_graphicsLayer->setBlendMode(blendMode); 1922 m_graphicsLayer->setBlendMode(blendMode);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2280 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2287 name = "Scrolling Block Selection Layer"; 2281 name = "Scrolling Block Selection Layer";
2288 } else { 2282 } else {
2289 ASSERT_NOT_REACHED(); 2283 ASSERT_NOT_REACHED();
2290 } 2284 }
2291 2285
2292 return name; 2286 return name;
2293 } 2287 }
2294 2288
2295 } // namespace blink 2289 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698