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

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

Issue 13859006: Rework composited scrolling updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@early-out2
Patch Set: . Created 7 years, 8 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
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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 void RenderLayerCompositor::updateCompositingLayersTimerFired(Timer<RenderLayerC ompositor>*) 316 void RenderLayerCompositor::updateCompositingLayersTimerFired(Timer<RenderLayerC ompositor>*)
317 { 317 {
318 updateCompositingLayers(CompositingUpdateAfterLayout); 318 updateCompositingLayers(CompositingUpdateAfterLayout);
319 } 319 }
320 320
321 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const 321 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
322 { 322 {
323 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0); 323 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
324 } 324 }
325 325
326 void RenderLayerCompositor::updateDescendantsAreContiguousInStackingOrderRecursi ve(RenderLayer* layer)
327 {
328 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling())
329 updateDescendantsAreContiguousInStackingOrderRecursive(child);
330
331 if (layer->isStackingContext() && layer->m_descendantsAreContiguousInStackin gOrderDirty)
332 layer->updateDescendantsAreContiguousInStackingOrder();
333 }
334
335 void RenderLayerCompositor::updateNeedsCompositedScrolling(RenderLayer* layer)
336 {
337 layer->updateNeedsCompositedScrolling();
338 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling())
339 updateNeedsCompositedScrolling(child);
340 }
341
326 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot) 342 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot)
327 { 343 {
328 m_updateCompositingLayersTimer.stop(); 344 m_updateCompositingLayersTimer.stop();
329 345
330 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished. 346 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished.
331 if (m_renderView->needsLayout()) 347 if (m_renderView->needsLayout())
332 return; 348 return;
333 349
334 if (m_forceCompositingMode && !m_compositing) 350 if (m_forceCompositingMode && !m_compositing)
335 enableCompositingMode(true); 351 enableCompositingMode(true);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 392
377 #if !LOG_DISABLED 393 #if !LOG_DISABLED
378 double startTime = 0; 394 double startTime = 0;
379 if (compositingLogEnabled()) { 395 if (compositingLogEnabled()) {
380 ++m_rootLayerUpdateCount; 396 ++m_rootLayerUpdateCount;
381 startTime = currentTime(); 397 startTime = currentTime();
382 } 398 }
383 #endif 399 #endif
384 400
385 if (checkForHierarchyUpdate) { 401 if (checkForHierarchyUpdate) {
402 // FIXME(vollick): can we skip this altogether in some cases?
403 updateRoot->updateDescendantDependentFlags();
404 updateDescendantsAreContiguousInStackingOrderRecursive(updateRoot);
405 updateNeedsCompositedScrolling(updateRoot);
406
386 // Go through the layers in presentation order, so that we can compute w hich RenderLayers need compositing layers. 407 // Go through the layers in presentation order, so that we can compute w hich RenderLayers need compositing layers.
387 // FIXME: we could maybe do this and the hierarchy udpate in one pass, b ut the parenting logic would be more complex. 408 // FIXME: we could maybe do this and the hierarchy udpate in one pass, b ut the parenting logic would be more complex.
388 CompositingState compState(updateRoot, m_compositingConsultsOverlap); 409 CompositingState compState(updateRoot, m_compositingConsultsOverlap);
389 bool layersChanged = false; 410 bool layersChanged = false;
390 bool saw3DTransform = false; 411 bool saw3DTransform = false;
391 { 412 {
392 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo sitingRequirements"); 413 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::computeCompo sitingRequirements");
393 if (m_compositingConsultsOverlap) { 414 if (m_compositingConsultsOverlap) {
394 OverlapMap overlapTestRequestMap; 415 OverlapMap overlapTestRequestMap;
395 computeCompositingRequirements(0, updateRoot, &overlapTestReques tMap, compState, layersChanged, saw3DTransform); 416 computeCompositingRequirements(0, updateRoot, &overlapTestReques tMap, compState, layersChanged, saw3DTransform);
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after
2811 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2832 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2812 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2833 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2813 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2834 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2814 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2835 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2815 info.addMember(m_layerForHeader, "layerForHeader"); 2836 info.addMember(m_layerForHeader, "layerForHeader");
2816 info.addMember(m_layerForFooter, "layerForFooter"); 2837 info.addMember(m_layerForFooter, "layerForFooter");
2817 #endif 2838 #endif
2818 } 2839 }
2819 2840
2820 } // namespace WebCore 2841 } // namespace WebCore
OLDNEW
« Source/WebCore/rendering/RenderLayer.cpp ('K') | « Source/WebCore/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698