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

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

Issue 311813005: Issue repaints for RenderLayers that get new composited backings after (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo sitingPropertyUpdater::DoNotForceUpdate; 360 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo sitingPropertyUpdater::DoNotForceUpdate;
361 361
362 // FIXME: Teach non-style compositing updates how to do partial tree walks. 362 // FIXME: Teach non-style compositing updates how to do partial tree walks.
363 if (updateType >= CompositingUpdateAfterLayout) { 363 if (updateType >= CompositingUpdateAfterLayout) {
364 graphicsLayerUpdateType = GraphicsLayerUpdater::ForceUpdate; 364 graphicsLayerUpdateType = GraphicsLayerUpdater::ForceUpdate;
365 compositingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate; 365 compositingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate;
366 } 366 }
367 367
368 RenderLayer* updateRoot = rootRenderLayer(); 368 RenderLayer* updateRoot = rootRenderLayer();
369 369
370 Vector<RenderLayer*> layersNeedingRepaint;
371
370 if (updateType >= CompositingUpdateAfterCompositingInputChange) { 372 if (updateType >= CompositingUpdateAfterCompositingInputChange) {
371 bool layersChanged = false; 373 bool layersChanged = false;
372
373 { 374 {
374 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA ncestorDependentProperties"); 375 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA ncestorDependentProperties");
375 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper ties(updateRoot, compositingPropertyUpdateType); 376 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper ties(updateRoot, compositingPropertyUpdateType);
376 #if ASSERT_ENABLED 377 #if ASSERT_ENABLED
377 CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantProp ertiesBitsCleared(updateRoot); 378 CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantProp ertiesBitsCleared(updateRoot);
378 #endif 379 #endif
379 } 380 }
380 381
381 CompositingRequirementsUpdater(m_renderView, m_compositingReasonFinder). update(updateRoot); 382 CompositingRequirementsUpdater(m_renderView, m_compositingReasonFinder). update(updateRoot);
382 383
383 { 384 {
384 TRACE_EVENT0("blink_rendering", "CompositingLayerAssigner::assign"); 385 TRACE_EVENT0("blink_rendering", "CompositingLayerAssigner::assign");
385 CompositingLayerAssigner(this).assign(updateRoot, layersChanged); 386 CompositingLayerAssigner(this).assign(updateRoot, layersChanged, lay ersNeedingRepaint);
386 } 387 }
387 388
388 { 389 {
389 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateAfterC ompositingChange"); 390 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateAfterC ompositingChange");
390 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas(); 391 const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView.f rameView()->scrollableAreas();
391 if (scrollableAreas) { 392 if (scrollableAreas) {
392 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas ->begin(); it != scrollableAreas->end(); ++it) 393 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas ->begin(); it != scrollableAreas->end(); ++it)
393 (*it)->updateAfterCompositingChange(); 394 (*it)->updateAfterCompositingChange();
394 } 395 }
395 } 396 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 m_needsUpdateFixedBackground = false; 435 m_needsUpdateFixedBackground = false;
435 } 436 }
436 437
437 ASSERT(updateRoot || !compositingLayersNeedRebuild()); 438 ASSERT(updateRoot || !compositingLayersNeedRebuild());
438 439
439 // The scrolling coordinator may realize that it needs updating while compos iting was being updated in this function. 440 // The scrolling coordinator may realize that it needs updating while compos iting was being updated in this function.
440 needsToUpdateScrollingCoordinator |= scrollingCoordinator() && scrollingCoor dinator()->needsToUpdateAfterCompositingChange(); 441 needsToUpdateScrollingCoordinator |= scrollingCoordinator() && scrollingCoor dinator()->needsToUpdateAfterCompositingChange();
441 if (needsToUpdateScrollingCoordinator && m_renderView.frame()->isMainFrame() && scrollingCoordinator() && inCompositingMode()) 442 if (needsToUpdateScrollingCoordinator && m_renderView.frame()->isMainFrame() && scrollingCoordinator() && inCompositingMode())
442 scrollingCoordinator()->updateAfterCompositingChange(); 443 scrollingCoordinator()->updateAfterCompositingChange();
443 444
445 for (unsigned i = 0; i < layersNeedingRepaint.size(); i++) {
446 RenderLayer* layer = layersNeedingRepaint[i];
447 layer->repainter().computeRepaintRectsIncludingDescendants();
448
449 repaintOnCompositingChange(layer);
450 }
451
444 // Inform the inspector that the layer tree has changed. 452 // Inform the inspector that the layer tree has changed.
445 if (m_renderView.frame()->isMainFrame()) 453 if (m_renderView.frame()->isMainFrame())
446 InspectorInstrumentation::layerTreeDidChange(m_renderView.frame()); 454 InspectorInstrumentation::layerTreeDidChange(m_renderView.frame());
447 } 455 }
448 456
449 bool RenderLayerCompositor::allocateOrClearCompositedLayerMapping(RenderLayer* l ayer, const CompositingStateTransitionType compositedLayerUpdate) 457 bool RenderLayerCompositor::allocateOrClearCompositedLayerMapping(RenderLayer* l ayer, const CompositingStateTransitionType compositedLayerUpdate)
450 { 458 {
451 bool compositedLayerMappingChanged = false; 459 bool compositedLayerMappingChanged = false;
452 bool nonCompositedReasonChanged = updateLayerIfViewportConstrained(layer); 460 bool nonCompositedReasonChanged = updateLayerIfViewportConstrained(layer);
453 461
(...skipping 22 matching lines...) Expand all
476 // If we need to repaint, do so before allocating the compositedLayerMap ping 484 // If we need to repaint, do so before allocating the compositedLayerMap ping
477 repaintOnCompositingChange(layer); 485 repaintOnCompositingChange(layer);
478 layer->ensureCompositedLayerMapping(); 486 layer->ensureCompositedLayerMapping();
479 compositedLayerMappingChanged = true; 487 compositedLayerMappingChanged = true;
480 488
481 // At this time, the ScrollingCooridnator only supports the top-level fr ame. 489 // At this time, the ScrollingCooridnator only supports the top-level fr ame.
482 if (layer->isRootLayer() && m_renderView.frame()->isMainFrame()) { 490 if (layer->isRootLayer() && m_renderView.frame()->isMainFrame()) {
483 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoor dinator()) 491 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoor dinator())
484 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.f rameView()); 492 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.f rameView());
485 } 493 }
486
487 // FIXME: it seems premature to compute this before all compositing stat e has been updated?
488 // This layer and all of its descendants have cached repaints rects that are relative to
489 // the repaint container, so change when compositing changes; we need to update them here.
490 if (layer->parent())
491 layer->repainter().computeRepaintRectsIncludingDescendants();
492
493 break; 494 break;
494 case RemoveOwnCompositedLayerMapping: 495 case RemoveOwnCompositedLayerMapping:
495 // PutInSquashingLayer means you might have to remove the composited layer m apping first. 496 // PutInSquashingLayer means you might have to remove the composited layer m apping first.
496 case PutInSquashingLayer: 497 case PutInSquashingLayer:
497 if (layer->hasCompositedLayerMapping()) { 498 if (layer->hasCompositedLayerMapping()) {
498 // If we're removing the compositedLayerMapping from a reflection, c lear the source GraphicsLayer's pointer to 499 // If we're removing the compositedLayerMapping from a reflection, c lear the source GraphicsLayer's pointer to
499 // its replica GraphicsLayer. In practice this should never happen b ecause reflectee and reflection 500 // its replica GraphicsLayer. In practice this should never happen b ecause reflectee and reflection
500 // are both either composited, or not composited. 501 // are both either composited, or not composited.
501 if (layer->isReflection()) { 502 if (layer->isReflection()) {
502 RenderLayer* sourceLayer = toRenderLayerModelObject(layer->rende rer()->parent())->layer(); 503 RenderLayer* sourceLayer = toRenderLayerModelObject(layer->rende rer()->parent())->layer();
503 if (sourceLayer->hasCompositedLayerMapping()) { 504 if (sourceLayer->hasCompositedLayerMapping()) {
504 ASSERT(sourceLayer->compositedLayerMapping()->mainGraphicsLa yer()->replicaLayer() == layer->compositedLayerMapping()->mainGraphicsLayer()); 505 ASSERT(sourceLayer->compositedLayerMapping()->mainGraphicsLa yer()->replicaLayer() == layer->compositedLayerMapping()->mainGraphicsLayer());
505 sourceLayer->compositedLayerMapping()->mainGraphicsLayer()-> setReplicatedByLayer(0); 506 sourceLayer->compositedLayerMapping()->mainGraphicsLayer()-> setReplicatedByLayer(0);
506 } 507 }
507 } 508 }
508 509
509 layer->clearCompositedLayerMapping(); 510 layer->clearCompositedLayerMapping();
510 compositedLayerMappingChanged = true; 511 compositedLayerMappingChanged = true;
511
512 // This layer and all of its descendants have cached repaints rects that are relative to
513 // the repaint container, so change when compositing changes; we nee d to update them here.
514 layer->repainter().computeRepaintRectsIncludingDescendants();
515
516 // If we need to repaint, do so now that we've removed the composite dLayerMapping
517 repaintOnCompositingChange(layer);
518 } 512 }
519 513
520 break; 514 break;
521 case RemoveFromSquashingLayer: 515 case RemoveFromSquashingLayer:
522 case NoCompositingStateChange: 516 case NoCompositingStateChange:
523 // Do nothing. 517 // Do nothing.
524 break; 518 break;
525 } 519 }
526 520
527 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateRequiresOwnBackingStoreForIntrinsicReasons()) 521 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateRequiresOwnBackingStoreForIntrinsicReasons())
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 } else if (graphicsLayer == m_scrollLayer.get()) { 1377 } else if (graphicsLayer == m_scrollLayer.get()) {
1384 name = "LocalFrame Scrolling Layer"; 1378 name = "LocalFrame Scrolling Layer";
1385 } else { 1379 } else {
1386 ASSERT_NOT_REACHED(); 1380 ASSERT_NOT_REACHED();
1387 } 1381 }
1388 1382
1389 return name; 1383 return name;
1390 } 1384 }
1391 1385
1392 } // namespace WebCore 1386 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698