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

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

Issue 20103002: Make composited scrolling codepaths co-operate. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix needsCompositedScrolling state Created 7 years, 3 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 if (!m_needsUpdateCompositingRequirementsState) 328 if (!m_needsUpdateCompositingRequirementsState)
329 return; 329 return;
330 330
331 TRACE_EVENT0("blink_rendering,comp-scroll", "RenderLayerCompositor::updateCo mpositingRequirementsState"); 331 TRACE_EVENT0("blink_rendering,comp-scroll", "RenderLayerCompositor::updateCo mpositingRequirementsState");
332 332
333 m_needsUpdateCompositingRequirementsState = false; 333 m_needsUpdateCompositingRequirementsState = false;
334 334
335 if (!rootRenderLayer() || !rootRenderLayer()->acceleratedCompositingForOverf lowScrollEnabled()) 335 if (!rootRenderLayer() || !rootRenderLayer()->acceleratedCompositingForOverf lowScrollEnabled())
336 return; 336 return;
337 337
338 const bool compositorDrivenAcceleratedScrollingEnabled = rootRenderLayer()-> compositorDrivenAcceleratedScrollingEnabled();
339
340 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView->frameVie w()->scrollableAreas();
341 if (!compositorDrivenAcceleratedScrollingEnabled && !scrollableAreas)
342 return;
343
344 for (HashSet<RenderLayer*>::iterator it = m_outOfFlowPositionedLayers.begin( ); it != m_outOfFlowPositionedLayers.end(); ++it) 338 for (HashSet<RenderLayer*>::iterator it = m_outOfFlowPositionedLayers.begin( ); it != m_outOfFlowPositionedLayers.end(); ++it)
345 (*it)->updateHasUnclippedDescendant(); 339 (*it)->updateHasUnclippedDescendant();
346 340
347 if (!compositorDrivenAcceleratedScrollingEnabled) { 341 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView->frameVie w()->scrollableAreas();
348 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas->begin( ); it != scrollableAreas->end(); ++it) 342 if (!scrollableAreas)
349 (*it)->updateNeedsCompositedScrolling(); 343 return;
350 } 344
345 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas->begin(); i t != scrollableAreas->end(); ++it)
346 (*it)->updateNeedsCompositedScrolling();
351 } 347 }
352 348
353 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot) 349 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot)
354 { 350 {
355 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished. 351 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished.
356 if (m_renderView->needsLayout()) 352 if (m_renderView->needsLayout())
357 return; 353 return;
358 354
359 if (m_forceCompositingMode && !m_compositing) 355 if (m_forceCompositingMode && !m_compositing)
360 enableCompositingMode(true); 356 enableCompositingMode(true);
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 return renderer->hasFilter(); 1995 return renderer->hasFilter();
2000 } 1996 }
2001 1997
2002 bool RenderLayerCompositor::requiresCompositingForBlending(RenderObject* rendere r) const 1998 bool RenderLayerCompositor::requiresCompositingForBlending(RenderObject* rendere r) const
2003 { 1999 {
2004 return renderer->hasBlendMode(); 2000 return renderer->hasBlendMode();
2005 } 2001 }
2006 2002
2007 bool RenderLayerCompositor::requiresCompositingForOverflowScrollingParent(const RenderLayer* layer) const 2003 bool RenderLayerCompositor::requiresCompositingForOverflowScrollingParent(const RenderLayer* layer) const
2008 { 2004 {
2009 if (!layer->compositorDrivenAcceleratedScrollingEnabled()) 2005 if (!layer->useCompositorDrivenAcceleratedScrolling())
2010 return false; 2006 return false;
2011 2007
2012 // A layer scrolls with its containing block. So to find the overflow scroll ing layer 2008 // A layer scrolls with its containing block. So to find the overflow scroll ing layer
2013 // that we scroll with respect to, we must ascend the layer tree until we re ach the 2009 // that we scroll with respect to, we must ascend the layer tree until we re ach the
2014 // first overflow scrolling div at or above our containing block. I will ref er to this 2010 // first overflow scrolling div at or above our containing block. I will ref er to this
2015 // layer as our 'scrolling ancestor'. 2011 // layer as our 'scrolling ancestor'.
2016 // 2012 //
2017 // Now, if we reside in a normal flow list, then we will naturally scroll wi th our scrolling 2013 // Now, if we reside in a normal flow list, then we will naturally scroll wi th our scrolling
2018 // ancestor, and we need not be composited. If, on the other hand, we reside in a z-order 2014 // ancestor, and we need not be composited. If, on the other hand, we reside in a z-order
2019 // list, and on our walk upwards to our scrolling ancestor we find no layer that is a stacking 2015 // list, and on our walk upwards to our scrolling ancestor we find no layer that is a stacking
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 } else if (graphicsLayer == m_scrollLayer.get()) { 2760 } else if (graphicsLayer == m_scrollLayer.get()) {
2765 name = "Frame Scrolling Layer"; 2761 name = "Frame Scrolling Layer";
2766 } else { 2762 } else {
2767 ASSERT_NOT_REACHED(); 2763 ASSERT_NOT_REACHED();
2768 } 2764 }
2769 2765
2770 return name; 2766 return name;
2771 } 2767 }
2772 2768
2773 } // namespace WebCore 2769 } // namespace WebCore
OLDNEW
« Source/core/rendering/RenderLayer.cpp ('K') | « Source/core/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698