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

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

Issue 206283003: Avoid tree walks when computing RenderLayer::scrollParent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 9 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 381 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
382 break; 382 break;
383 case CompositingUpdateAfterCanvasContextChange: 383 case CompositingUpdateAfterCanvasContextChange:
384 m_needsToUpdateLayerTreeGeometry = true; 384 m_needsToUpdateLayerTreeGeometry = true;
385 break; 385 break;
386 } 386 }
387 387
388 m_renderView.frameView()->scheduleAnimation(); 388 m_renderView.frameView()->scheduleAnimation();
389 } 389 }
390 390
391 static void clearAncestorDependentPropertyCacheRecursive(RenderLayer* layer)
392 {
393 layer->clearAncestorDependentPropertyCache();
394 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), AllChildren );
395 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling())
396 clearAncestorDependentPropertyCacheRecursive(child);
397 }
398
391 void RenderLayerCompositor::updateCompositingLayers() 399 void RenderLayerCompositor::updateCompositingLayers()
392 { 400 {
393 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateCompositingLay ers"); 401 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateCompositingLay ers");
394 402
395 // FIXME: We should carefully clean up the awkward early-exit semantics, bal ancing 403 // FIXME: We should carefully clean up the awkward early-exit semantics, bal ancing
396 // between skipping unnecessary compositing updates and not incorrectly skip ping 404 // between skipping unnecessary compositing updates and not incorrectly skip ping
397 // necessary updates. 405 // necessary updates.
398 406
399 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished. 407 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished.
400 // FIXME: Can we assert that we never return here? 408 // FIXME: Can we assert that we never return here?
401 if (m_renderView.needsLayout()) 409 if (m_renderView.needsLayout())
402 return; 410 return;
403 411
404 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate); 412 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate);
405 413
406 updateCompositingLayersInternal(); 414 updateCompositingLayersInternal();
407 415
416 // Clear data only valid during compositing updates.
417 clearAncestorDependentPropertyCacheRecursive(rootRenderLayer());
418
408 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); 419 lifecycle().advanceTo(DocumentLifecycle::CompositingClean);
409 420
410 DocumentAnimations::startPendingAnimations(m_renderView.document()); 421 DocumentAnimations::startPendingAnimations(m_renderView.document());
411 ASSERT(m_renderView.document().lifecycle().state() == DocumentLifecycle::Com positingClean); 422 ASSERT(m_renderView.document().lifecycle().state() == DocumentLifecycle::Com positingClean);
412 } 423 }
413 424
414 void RenderLayerCompositor::updateCompositingLayersInternal() 425 void RenderLayerCompositor::updateCompositingLayersInternal()
415 { 426 {
416 if (isMainFrame() && m_renderView.frameView()) 427 if (isMainFrame() && m_renderView.frameView())
417 finishCompositingUpdateForFrameTree(&m_renderView.frameView()->frame()); 428 finishCompositingUpdateForFrameTree(&m_renderView.frameView()->frame());
(...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 } else if (graphicsLayer == m_scrollLayer.get()) { 2251 } else if (graphicsLayer == m_scrollLayer.get()) {
2241 name = "LocalFrame Scrolling Layer"; 2252 name = "LocalFrame Scrolling Layer";
2242 } else { 2253 } else {
2243 ASSERT_NOT_REACHED(); 2254 ASSERT_NOT_REACHED();
2244 } 2255 }
2245 2256
2246 return name; 2257 return name;
2247 } 2258 }
2248 2259
2249 } // namespace WebCore 2260 } // 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