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

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: Set define in core.gyp 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 ASSERT(m_scrollingContentsLayer); 631 ASSERT(m_scrollingContentsLayer);
632 RenderBox* renderBox = toRenderBox(renderer()); 632 RenderBox* renderBox = toRenderBox(renderer());
633 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect()); 633 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect());
634 // FIXME: We should make RenderBox::clientBoxRect consider scrollbar pla cement. 634 // FIXME: We should make RenderBox::clientBoxRect consider scrollbar pla cement.
635 if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 635 if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
636 clientBox.move(renderBox->verticalScrollbarWidth(), 0); 636 clientBox.move(renderBox->verticalScrollbarWidth(), 0);
637 637
638 IntSize adjustedScrollOffset = m_owningLayer->adjustedScrollOffset(); 638 IntSize adjustedScrollOffset = m_owningLayer->adjustedScrollOffset();
639 m_scrollingLayer->setPosition(FloatPoint(clientBox.location() - localCom positingBounds.location())); 639 m_scrollingLayer->setPosition(FloatPoint(clientBox.location() - localCom positingBounds.location()));
640 m_scrollingLayer->setSize(clientBox.size()); 640 m_scrollingLayer->setSize(clientBox.size());
641 m_scrollingContentsLayer->setPosition(FloatPoint(-adjustedScrollOffset.w idth(), -adjustedScrollOffset.height()));
642 641
643 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer() ; 642 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer() ;
644 m_scrollingLayer->setOffsetFromRenderer(-toIntSize(clientBox.location()) ); 643 m_scrollingLayer->setOffsetFromRenderer(-toIntSize(clientBox.location()) );
645 644
646 bool clientBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLaye r->offsetFromRenderer(); 645 bool clientBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLaye r->offsetFromRenderer();
647 646
648 IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHe ight()); 647 IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHe ight());
649 if (scrollSize != m_scrollingContentsLayer->size() || clientBoxOffsetCha nged) 648 if (scrollSize != m_scrollingContentsLayer->size() || clientBoxOffsetCha nged)
650 m_scrollingContentsLayer->setNeedsDisplay(); 649 m_scrollingContentsLayer->setNeedsDisplay();
651 650
652 IntSize scrollingContentsOffset = toIntSize(clientBox.location() - adjus tedScrollOffset); 651 IntSize scrollingContentsOffset = toIntSize(clientBox.location() - adjus tedScrollOffset);
653 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRende rer() || scrollSize != m_scrollingContentsLayer->size()) 652 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRende rer() || scrollSize != m_scrollingContentsLayer->size()) {
654 compositor()->scrollingLayerDidChange(m_owningLayer); 653 bool scrollingCoordinatorHandlesOffset = compositor()->scrollingLaye rDidChange(m_owningLayer);
654
655 #ifndef BLINK_SCROLLING_POSITION_NO_OFFSET
656 // FIXME: Remove when possible.
657 // Only required to stage multi-repo change.
658 scrollingCoordinatorHandlesOffset = false;
659 #endif
660 if (scrollingCoordinatorHandlesOffset)
661 m_scrollingContentsLayer->setPosition(-m_owningLayer->scrollOrig in());
662 else
663 m_scrollingContentsLayer->setPosition(FloatPoint(-adjustedScroll Offset));
664 }
655 665
656 m_scrollingContentsLayer->setSize(scrollSize); 666 m_scrollingContentsLayer->setSize(scrollSize);
657 // FIXME: The paint offset and the scroll offset should really be separa te concepts. 667 // FIXME: The paint offset and the scroll offset should really be separa te concepts.
658 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay); 668 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
659 669
660 if (m_foregroundLayer) { 670 if (m_foregroundLayer) {
661 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) 671 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size())
662 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 672 m_foregroundLayer->setSize(m_scrollingContentsLayer->size());
663 m_foregroundLayer->setNeedsDisplay(); 673 m_foregroundLayer->setNeedsDisplay();
664 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->o ffsetFromRenderer()); 674 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->o ffsetFromRenderer());
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 info.addMember(m_childContainmentLayer, "childContainmentLayer"); 1895 info.addMember(m_childContainmentLayer, "childContainmentLayer");
1886 info.addMember(m_maskLayer, "maskLayer"); 1896 info.addMember(m_maskLayer, "maskLayer");
1887 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; 1897 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ;
1888 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); 1898 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar");
1889 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 1899 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
1890 info.addMember(m_scrollingLayer, "scrollingLayer"); 1900 info.addMember(m_scrollingLayer, "scrollingLayer");
1891 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); 1901 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer");
1892 } 1902 }
1893 1903
1894 } // namespace WebCore 1904 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/core/rendering/RenderLayerCompositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698