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

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

Issue 332543002: Rename Repaint to Paint Invalidation Part 4 (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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 { 255 {
256 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou t"); 256 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou t");
257 257
258 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues 258 // FIXME: Remove incremental compositing updates after fixing the chicken/eg g issues
259 // https://code.google.com/p/chromium/issues/detail?id=343756 259 // https://code.google.com/p/chromium/issues/detail?id=343756
260 DisableCompositingQueryAsserts disabler; 260 DisableCompositingQueryAsserts disabler;
261 261
262 RenderGeometryMap geometryMap(UseTransforms); 262 RenderGeometryMap geometryMap(UseTransforms);
263 if (this != rootLayer) 263 if (this != rootLayer)
264 geometryMap.pushMappingsToAncestor(parent(), 0); 264 geometryMap.pushMappingsToAncestor(parent(), 0);
265 updateLayerPositionRecursive(&geometryMap, rootLayer->renderer()->containerF orRepaint(), flags); 265 updateLayerPositionRecursive(&geometryMap, rootLayer->renderer()->containerF orPaintInvalidation(), flags);
266 } 266 }
267 267
268 void RenderLayer::updateLayerPositionRecursive(RenderGeometryMap* geometryMap, c onst RenderLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFla gs flags) 268 void RenderLayer::updateLayerPositionRecursive(RenderGeometryMap* geometryMap, c onst RenderLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFla gs flags)
269 { 269 {
270 // For performance reasons we only check if the RenderObject has moved if we 270 // For performance reasons we only check if the RenderObject has moved if we
271 // have a geometryMap. If not, blank out the paint invalidation container so we 271 // have a geometryMap. If not, blank out the paint invalidation container so we
272 // can skip doing any further work to update it. 272 // can skip doing any further work to update it.
273 if (!geometryMap) 273 if (!geometryMap)
274 paintInvalidationContainer = 0; 274 paintInvalidationContainer = 0;
275 275
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 if (renderer()->hasOverflowClip()) 471 if (renderer()->hasOverflowClip())
472 flags |= HasSeenAncestorWithOverflowClip; 472 flags |= HasSeenAncestorWithOverflowClip;
473 473
474 if ((flags & IsOverflowScroll) && (flags & HasSeenAncestorWithOverflowClip) && !m_canSkipRepaintRectsUpdateOnScroll) { 474 if ((flags & IsOverflowScroll) && (flags & HasSeenAncestorWithOverflowClip) && !m_canSkipRepaintRectsUpdateOnScroll) {
475 // FIXME: We could track the repaint container as we walk down the tree. 475 // FIXME: We could track the repaint container as we walk down the tree.
476 repainter().computeRepaintRects(); 476 repainter().computeRepaintRects();
477 } else { 477 } else {
478 // Check that RenderLayerRepainter's cached rects are correct. 478 // Check that RenderLayerRepainter's cached rects are correct.
479 // FIXME: re-enable these assertions when the issue with table cells is resolved: https://bugs.webkit.org/show_bug.cgi?id=103432 479 // FIXME: re-enable these assertions when the issue with table cells is resolved: https://bugs.webkit.org/show_bug.cgi?id=103432
480 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo rRepaint(renderer()->containerForRepaint())); 480 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo rPaintInvalidation(renderer()->containerForPaintInvalidation()));
481 } 481 }
482 482
483 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) 483 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
484 child->updateLayerPositionsAfterScroll(flags); 484 child->updateLayerPositionsAfterScroll(flags);
485 485
486 // We don't update our reflection as scrolling is a translation which does n ot change the size() 486 // We don't update our reflection as scrolling is a translation which does n ot change the size()
487 // of an object, thus RenderReplica will still repaint itself properly as th e layer position was 487 // of an object, thus RenderReplica will still repaint itself properly as th e layer position was
488 // updated above. 488 // updated above.
489 } 489 }
490 490
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 return; 672 return;
673 } 673 }
674 if (curr->stackingNode() == ancestorStackingContextNode) 674 if (curr->stackingNode() == ancestorStackingContextNode)
675 return; 675 return;
676 } 676 }
677 } 677 }
678 678
679 void RenderLayer::mapRectToRepaintBacking(const RenderObject* renderObject, cons t RenderLayerModelObject* repaintContainer, LayoutRect& rect) 679 void RenderLayer::mapRectToRepaintBacking(const RenderObject* renderObject, cons t RenderLayerModelObject* repaintContainer, LayoutRect& rect)
680 { 680 {
681 if (!repaintContainer->groupedMapping()) { 681 if (!repaintContainer->groupedMapping()) {
682 renderObject->mapRectToRepaintBacking(repaintContainer, rect); 682 renderObject->mapRectToPaintInvalidationBacking(repaintContainer, rect);
683 return; 683 return;
684 } 684 }
685 685
686 ASSERT(repaintContainer->layer()->enclosingTransformedAncestor()); 686 ASSERT(repaintContainer->layer()->enclosingTransformedAncestor());
687 ASSERT(repaintContainer->layer()->enclosingTransformedAncestor()->renderer() ); 687 ASSERT(repaintContainer->layer()->enclosingTransformedAncestor()->renderer() );
688 688
689 // FIXME: this defensive code should not have to exist. None of these pointe rs should ever be 0. See crbug.com/370410. 689 // FIXME: this defensive code should not have to exist. None of these pointe rs should ever be 0. See crbug.com/370410.
690 RenderLayerModelObject* transformedAncestor = 0; 690 RenderLayerModelObject* transformedAncestor = 0;
691 if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedA ncestor()) 691 if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedA ncestor())
692 transformedAncestor = ancestor->renderer(); 692 transformedAncestor = ancestor->renderer();
693 if (!transformedAncestor) 693 if (!transformedAncestor)
694 return; 694 return;
695 695
696 // If the transformedAncestor is actually the RenderView, we might get 696 // If the transformedAncestor is actually the RenderView, we might get
697 // confused and think that we can use LayoutState. Ideally, we'd made 697 // confused and think that we can use LayoutState. Ideally, we'd made
698 // LayoutState work for all composited layers as well, but until then 698 // LayoutState work for all composited layers as well, but until then
699 // we need to disable LayoutState for squashed layers. 699 // we need to disable LayoutState for squashed layers.
700 LayoutStateDisabler layoutStateDisabler(*transformedAncestor); 700 LayoutStateDisabler layoutStateDisabler(*transformedAncestor);
701 701
702 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) 702 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed)
703 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is 703 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is
704 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. 704 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc.
705 // FIXME: remove this special-case code that works around the repainting cod e structure. 705 // FIXME: remove this special-case code that works around the repainting cod e structure.
706 renderObject->mapRectToRepaintBacking(transformedAncestor, rect); 706 renderObject->mapRectToPaintInvalidationBacking(transformedAncestor, rect);
707 rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransfor medAncestor()); 707 rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransfor medAncestor());
708 708
709 return; 709 return;
710 } 710 }
711 711
712 LayoutRect RenderLayer::computeRepaintRect(const RenderObject* renderObject, con st RenderLayer* repaintContainer) 712 LayoutRect RenderLayer::computeRepaintRect(const RenderObject* renderObject, con st RenderLayer* repaintContainer)
713 { 713 {
714 if (!repaintContainer->groupedMapping()) 714 if (!repaintContainer->groupedMapping())
715 return renderObject->computeRepaintRect(repaintContainer->renderer()); 715 return renderObject->computePaintInvalidationRect(repaintContainer->rend erer());
716 LayoutRect rect = renderObject->clippedOverflowRectForRepaint(repaintContain er->renderer()); 716 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(repa intContainer->renderer());
717 mapRectToRepaintBacking(repaintContainer->renderer(), repaintContainer->rend erer(), rect); 717 mapRectToRepaintBacking(repaintContainer->renderer(), repaintContainer->rend erer(), rect);
718 return rect; 718 return rect;
719 } 719 }
720 720
721 void RenderLayer::setHasVisibleContent() 721 void RenderLayer::setHasVisibleContent()
722 { 722 {
723 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { 723 if (m_hasVisibleContent && !m_visibleContentStatusDirty) {
724 ASSERT(!parent() || parent()->hasVisibleDescendant()); 724 ASSERT(!parent() || parent()->hasVisibleDescendant());
725 return; 725 return;
726 } 726 }
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3864 } 3864 }
3865 } 3865 }
3866 3866
3867 void showLayerTree(const WebCore::RenderObject* renderer) 3867 void showLayerTree(const WebCore::RenderObject* renderer)
3868 { 3868 {
3869 if (!renderer) 3869 if (!renderer)
3870 return; 3870 return;
3871 showLayerTree(renderer->enclosingLayer()); 3871 showLayerTree(renderer->enclosingLayer());
3872 } 3872 }
3873 #endif 3873 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderInline.cpp ('k') | Source/core/rendering/RenderLayerModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698