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

Side by Side Diff: Source/core/rendering/RenderLayerBacking.cpp

Issue 18187004: Don't update graphics layer positions during coordinated scrolling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ifdefs, expectations, rtl fixes Created 7 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 | 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 ASSERT(m_scrollingContentsLayer); 672 ASSERT(m_scrollingContentsLayer);
673 RenderBox* renderBox = toRenderBox(renderer()); 673 RenderBox* renderBox = toRenderBox(renderer());
674 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect()); 674 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect());
675 // FIXME: We should make RenderBox::clientBoxRect consider scrollbar pla cement. 675 // FIXME: We should make RenderBox::clientBoxRect consider scrollbar pla cement.
676 if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 676 if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
677 clientBox.move(renderBox->verticalScrollbarWidth(), 0); 677 clientBox.move(renderBox->verticalScrollbarWidth(), 0);
678 678
679 IntSize adjustedScrollOffset = m_owningLayer->adjustedScrollOffset(); 679 IntSize adjustedScrollOffset = m_owningLayer->adjustedScrollOffset();
680 m_scrollingLayer->setPosition(FloatPoint(clientBox.location() - localCom positingBounds.location())); 680 m_scrollingLayer->setPosition(FloatPoint(clientBox.location() - localCom positingBounds.location()));
681 m_scrollingLayer->setSize(clientBox.size()); 681 m_scrollingLayer->setSize(clientBox.size());
682 m_scrollingContentsLayer->setPosition(FloatPoint(-adjustedScrollOffset.w idth(), -adjustedScrollOffset.height()));
683 682
684 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer() ; 683 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer() ;
685 m_scrollingLayer->setOffsetFromRenderer(-toIntSize(clientBox.location()) ); 684 m_scrollingLayer->setOffsetFromRenderer(-toIntSize(clientBox.location()) );
686 685
687 bool clientBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLaye r->offsetFromRenderer(); 686 bool clientBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLaye r->offsetFromRenderer();
688 687
689 IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHe ight()); 688 IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHe ight());
690 if (scrollSize != m_scrollingContentsLayer->size() || clientBoxOffsetCha nged) 689 if (scrollSize != m_scrollingContentsLayer->size() || clientBoxOffsetCha nged)
691 m_scrollingContentsLayer->setNeedsDisplay(); 690 m_scrollingContentsLayer->setNeedsDisplay();
692 691
693 IntSize scrollingContentsOffset = toIntSize(clientBox.location() - adjus tedScrollOffset); 692 IntSize scrollingContentsOffset = toIntSize(clientBox.location() - adjus tedScrollOffset);
694 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRende rer() || scrollSize != m_scrollingContentsLayer->size()) 693 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRende rer() || scrollSize != m_scrollingContentsLayer->size()) {
695 compositor()->scrollingLayerDidChange(m_owningLayer); 694 bool scrollingCoordinatorHandlesOffset = compositor()->scrollingLaye rDidChange(m_owningLayer);
695
696 #ifndef BLINK_SCROLLING_POSITION_NO_OFFSET
jamesr 2013/07/09 23:39:38 i think you want to add something to core.gyp to s
enne (OOO) 2013/07/09 23:43:47 I added a define here: https://codereview.chromium
697 // FIXME: Remove when possible.
698 // Only required to stage multi-repo change.
699 scrollingCoordinatorHandlesOffset = false;
700 #endif
701 if (scrollingCoordinatorHandlesOffset)
702 m_scrollingContentsLayer->setPosition(-m_owningLayer->scrollOrig in());
703 else
704 m_scrollingContentsLayer->setPosition(FloatPoint(-adjustedScroll Offset));
705 }
696 706
697 m_scrollingContentsLayer->setSize(scrollSize); 707 m_scrollingContentsLayer->setSize(scrollSize);
698 // FIXME: The paint offset and the scroll offset should really be separa te concepts. 708 // FIXME: The paint offset and the scroll offset should really be separa te concepts.
699 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay); 709 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
700 710
701 if (m_foregroundLayer) { 711 if (m_foregroundLayer) {
702 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) 712 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size())
703 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 713 m_foregroundLayer->setSize(m_scrollingContentsLayer->size());
704 m_foregroundLayer->setNeedsDisplay(); 714 m_foregroundLayer->setNeedsDisplay();
705 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->o ffsetFromRenderer()); 715 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->o ffsetFromRenderer());
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 info.addMember(m_childContainmentLayer, "childContainmentLayer"); 1936 info.addMember(m_childContainmentLayer, "childContainmentLayer");
1927 info.addMember(m_maskLayer, "maskLayer"); 1937 info.addMember(m_maskLayer, "maskLayer");
1928 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; 1938 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ;
1929 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); 1939 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar");
1930 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 1940 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
1931 info.addMember(m_scrollingLayer, "scrollingLayer"); 1941 info.addMember(m_scrollingLayer, "scrollingLayer");
1932 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); 1942 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer");
1933 } 1943 }
1934 1944
1935 } // namespace WebCore 1945 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698