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

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

Issue 202683005: optimizing layout performance when only transform3d matrix changed by Base URL: http://src.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
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 , m_showRepaintCounter(false) 204 , m_showRepaintCounter(false)
205 , m_needsToRecomputeCompositingRequirements(false) 205 , m_needsToRecomputeCompositingRequirements(false)
206 , m_needsToUpdateLayerTreeGeometry(false) 206 , m_needsToUpdateLayerTreeGeometry(false)
207 , m_pendingUpdateType(GraphicsLayerUpdater::DoNotForceUpdate) 207 , m_pendingUpdateType(GraphicsLayerUpdater::DoNotForceUpdate)
208 , m_compositing(false) 208 , m_compositing(false)
209 , m_compositingLayersNeedRebuild(false) 209 , m_compositingLayersNeedRebuild(false)
210 , m_forceCompositingMode(false) 210 , m_forceCompositingMode(false)
211 , m_needsUpdateCompositingRequirementsState(false) 211 , m_needsUpdateCompositingRequirementsState(false)
212 , m_isTrackingRepaints(false) 212 , m_isTrackingRepaints(false)
213 , m_rootLayerAttachment(RootLayerUnattached) 213 , m_rootLayerAttachment(RootLayerUnattached)
214 , m_layersChanged(true)
214 { 215 {
215 } 216 }
216 217
217 RenderLayerCompositor::~RenderLayerCompositor() 218 RenderLayerCompositor::~RenderLayerCompositor()
218 { 219 {
219 ASSERT(m_rootLayerAttachment == RootLayerUnattached); 220 ASSERT(m_rootLayerAttachment == RootLayerUnattached);
220 } 221 }
221 222
222 void RenderLayerCompositor::enableCompositingMode(bool enable /* = true */) 223 void RenderLayerCompositor::enableCompositingMode(bool enable /* = true */)
223 { 224 {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 377 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
377 break; 378 break;
378 case CompositingUpdateOnCompositedScroll: 379 case CompositingUpdateOnCompositedScroll:
379 m_needsToUpdateLayerTreeGeometry = true; 380 m_needsToUpdateLayerTreeGeometry = true;
380 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here. 381 // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
381 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate; 382 m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
382 break; 383 break;
383 case CompositingUpdateAfterCanvasContextChange: 384 case CompositingUpdateAfterCanvasContextChange:
384 m_needsToUpdateLayerTreeGeometry = true; 385 m_needsToUpdateLayerTreeGeometry = true;
385 break; 386 break;
387 case CompositingMinUpdateAfterStyleChange:
388 if (m_layersChanged)
Ian Vollick 2014/03/18 11:59:16 I think this is a layering violation. If I'm under
yaojie.yan 2014/03/20 07:43:19 Yes, but my REAL purpose is to add some heuristic
389 m_needsToRecomputeCompositingRequirements = true;
390 else
391 m_needsToUpdateLayerTreeGeometry = true;
392 break;
393
386 } 394 }
387 395
388 m_renderView.frameView()->scheduleAnimation(); 396 m_renderView.frameView()->scheduleAnimation();
389 } 397 }
390 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
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 474
467 { 475 {
468 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateHasVis ibleNonLayerContentLoop"); 476 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateHasVis ibleNonLayerContentLoop");
469 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas(); 477 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas();
470 if (scrollableAreas) { 478 if (scrollableAreas) {
471 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas ->begin(); it != scrollableAreas->end(); ++it) 479 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas ->begin(); it != scrollableAreas->end(); ++it)
472 (*it)->updateHasVisibleNonLayerContent(); 480 (*it)->updateHasVisibleNonLayerContent();
473 } 481 }
474 } 482 }
475 483
484 m_layersChanged = layersChanged;
Ian Vollick 2014/03/18 11:59:16 This value should not persist from update to updat
476 if (layersChanged) 485 if (layersChanged)
477 needHierarchyAndGeometryUpdate = true; 486 needHierarchyAndGeometryUpdate = true;
478 } 487 }
479 488
480 if (needHierarchyAndGeometryUpdate) { 489 if (needHierarchyAndGeometryUpdate) {
481 // Update the hierarchy of the compositing layers. 490 // Update the hierarchy of the compositing layers.
482 GraphicsLayerVector childList; 491 GraphicsLayerVector childList;
483 { 492 {
484 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::rebuildTree") ; 493 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::rebuildTree") ;
485 GraphicsLayerUpdater(m_renderView).rebuildTree(*updateRoot, updateTy pe, childList, 0); 494 GraphicsLayerUpdater(m_renderView).rebuildTree(*updateRoot, updateTy pe, childList, 0);
486 } 495 }
487 496
488 // Host the document layer in the RenderView's root layer. 497 // Host the document layer in the RenderView's root layer.
489 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isMainFra me()) { 498 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isMainFra me()) {
490 RenderVideo* video = findFullscreenVideoRenderer(m_renderView.docume nt()); 499 RenderVideo* video = findFullscreenVideoRenderer(m_renderView.docume nt());
491 if (video && video->hasCompositedLayerMapping()) { 500 if (video && video->hasCompositedLayerMapping()) {
492 childList.clear(); 501 childList.clear();
493 childList.append(video->compositedLayerMapping()->mainGraphicsLa yer()); 502 childList.append(video->compositedLayerMapping()->mainGraphicsLa yer());
494 } 503 }
495 } 504 }
496 505
497 if (childList.isEmpty()) 506 if (childList.isEmpty())
498 destroyRootLayer(); 507 destroyRootLayer();
499 else 508 else if (m_rootContentLayer)
500 m_rootContentLayer->setChildren(childList); 509 m_rootContentLayer->setChildren(childList);
501 } else if (needGeometryUpdate) { 510 } else if (needGeometryUpdate) {
502 // We just need to do a geometry update. This is only used for position: fixed scrolling; 511 // We just need to do a geometry update. This is only used for position: fixed scrolling;
503 // most of the time, geometry is updated via RenderLayer::styleChanged() . 512 // most of the time, geometry is updated via RenderLayer::styleChanged() .
504 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive") ; 513 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive") ;
505 GraphicsLayerUpdater(m_renderView).updateRecursive(*updateRoot, updateTy pe); 514 GraphicsLayerUpdater(m_renderView).updateRecursive(*updateRoot, updateTy pe);
506 } 515 }
507 516
508 ASSERT(updateRoot || !m_compositingLayersNeedRebuild); 517 ASSERT(updateRoot || !m_compositingLayersNeedRebuild);
509 518
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2243 } else if (graphicsLayer == m_scrollLayer.get()) { 2252 } else if (graphicsLayer == m_scrollLayer.get()) {
2244 name = "LocalFrame Scrolling Layer"; 2253 name = "LocalFrame Scrolling Layer";
2245 } else { 2254 } else {
2246 ASSERT_NOT_REACHED(); 2255 ASSERT_NOT_REACHED();
2247 } 2256 }
2248 2257
2249 return name; 2258 return name;
2250 } 2259 }
2251 2260
2252 } // namespace WebCore 2261 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698