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

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: 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
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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 1851
1852 if (m_childContainmentLayer) 1852 if (m_childContainmentLayer)
1853 return m_childContainmentLayer.get(); 1853 return m_childContainmentLayer.get();
1854 1854
1855 if (m_childTransformLayer) 1855 if (m_childTransformLayer)
1856 return m_childTransformLayer.get(); 1856 return m_childTransformLayer.get();
1857 1857
1858 return m_graphicsLayer.get(); 1858 return m_graphicsLayer.get();
1859 } 1859 }
1860 1860
1861 GraphicsLayer* CompositedLayerMapping::localRootForOwningLayer() const
1862 {
1863 if (m_ancestorClippingLayer)
1864 return m_ancestorClippingLayer.get();
1865
1866 return m_graphicsLayer.get();
1867 }
1868
1869 GraphicsLayer* CompositedLayerMapping::childForSuperlayers() const 1861 GraphicsLayer* CompositedLayerMapping::childForSuperlayers() const
1870 { 1862 {
1871 if (m_squashingContainmentLayer) 1863 if (m_squashingContainmentLayer)
1872 return m_squashingContainmentLayer.get(); 1864 return m_squashingContainmentLayer.get();
1873 1865
1874 return localRootForOwningLayer(); 1866 if (m_ancestorClippingLayer)
1867 return m_ancestorClippingLayer.get();
1868
1869 return m_graphicsLayer.get();
1875 } 1870 }
1876 1871
1877 GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const 1872 GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const
1878 { 1873 {
1879 if (GraphicsLayer* clipLayer = clippingLayer()) 1874 if (GraphicsLayer* clipLayer = clippingLayer())
1880 return clipLayer; 1875 return clipLayer;
1881 if (m_scrollingLayer) 1876 if (m_scrollingLayer)
1882 return m_scrollingLayer.get(); 1877 return m_scrollingLayer.get();
1883 return m_childTransformLayer.get(); 1878 return m_childTransformLayer.get();
1884 } 1879 }
(...skipping 24 matching lines...) Expand all
1909 || m_owningLayer.transform() 1904 || m_owningLayer.transform()
1910 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME: Revisit this if the paintsIntoCompositedAncestor state is removed. 1905 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME: Revisit this if the paintsIntoCompositedAncestor state is removed.
1911 || renderer->isTransparent() 1906 || renderer->isTransparent()
1912 || renderer->hasMask() 1907 || renderer->hasMask()
1913 || renderer->hasReflection() 1908 || renderer->hasReflection()
1914 || renderer->hasFilter(); 1909 || renderer->hasFilter();
1915 1910
1916 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) 1911 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor)
1917 compositor()->repaintOnCompositingChange(&m_owningLayer); 1912 compositor()->repaintOnCompositingChange(&m_owningLayer);
1918 1913
1919
1920 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa ckingStoreForIntrinsicReasons; 1914 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa ckingStoreForIntrinsicReasons;
1921 } 1915 }
1922 1916
1923 void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode) 1917 void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode)
1924 { 1918 {
1925 if (m_ancestorClippingLayer) { 1919 if (m_ancestorClippingLayer) {
1926 m_ancestorClippingLayer->setBlendMode(blendMode); 1920 m_ancestorClippingLayer->setBlendMode(blendMode);
1927 m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal); 1921 m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal);
1928 } else { 1922 } else {
1929 m_graphicsLayer->setBlendMode(blendMode); 1923 m_graphicsLayer->setBlendMode(blendMode);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2287 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2281 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2288 name = "Scrolling Block Selection Layer"; 2282 name = "Scrolling Block Selection Layer";
2289 } else { 2283 } else {
2290 ASSERT_NOT_REACHED(); 2284 ASSERT_NOT_REACHED();
2291 } 2285 }
2292 2286
2293 return name; 2287 return name;
2294 } 2288 }
2295 2289
2296 } // namespace blink 2290 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698