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

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

Issue 160903002: Move RenderLayer repainting to repaint-after-layout framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
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) 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "core/frame/LocalFrame.h" 57 #include "core/frame/LocalFrame.h"
58 #include "core/frame/Settings.h" 58 #include "core/frame/Settings.h"
59 #include "core/html/HTMLFrameElement.h" 59 #include "core/html/HTMLFrameElement.h"
60 #include "core/page/Page.h" 60 #include "core/page/Page.h"
61 #include "core/page/scrolling/ScrollingCoordinator.h" 61 #include "core/page/scrolling/ScrollingCoordinator.h"
62 #include "core/rendering/ColumnInfo.h" 62 #include "core/rendering/ColumnInfo.h"
63 #include "core/rendering/FilterEffectRenderer.h" 63 #include "core/rendering/FilterEffectRenderer.h"
64 #include "core/rendering/HitTestRequest.h" 64 #include "core/rendering/HitTestRequest.h"
65 #include "core/rendering/HitTestResult.h" 65 #include "core/rendering/HitTestResult.h"
66 #include "core/rendering/HitTestingTransformState.h" 66 #include "core/rendering/HitTestingTransformState.h"
67 #include "core/rendering/LayoutRectRecorder.h"
67 #include "core/rendering/RenderFlowThread.h" 68 #include "core/rendering/RenderFlowThread.h"
68 #include "core/rendering/RenderGeometryMap.h" 69 #include "core/rendering/RenderGeometryMap.h"
69 #include "core/rendering/RenderInline.h" 70 #include "core/rendering/RenderInline.h"
70 #include "core/rendering/RenderReplica.h" 71 #include "core/rendering/RenderReplica.h"
71 #include "core/rendering/RenderScrollbar.h" 72 #include "core/rendering/RenderScrollbar.h"
72 #include "core/rendering/RenderScrollbarPart.h" 73 #include "core/rendering/RenderScrollbarPart.h"
73 #include "core/rendering/RenderTreeAsText.h" 74 #include "core/rendering/RenderTreeAsText.h"
74 #include "core/rendering/RenderView.h" 75 #include "core/rendering/RenderView.h"
75 #include "core/rendering/compositing/CompositedLayerMapping.h" 76 #include "core/rendering/compositing/CompositedLayerMapping.h"
76 #include "core/rendering/compositing/RenderLayerCompositor.h" 77 #include "core/rendering/compositing/RenderLayerCompositor.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 m_clipper.clearClipRects(); 490 m_clipper.clearClipRects();
490 491
491 if (renderer()->style()->hasViewportConstrainedPosition()) 492 if (renderer()->style()->hasViewportConstrainedPosition())
492 flags |= HasSeenViewportConstrainedAncestor; 493 flags |= HasSeenViewportConstrainedAncestor;
493 494
494 if (renderer()->hasOverflowClip()) 495 if (renderer()->hasOverflowClip())
495 flags |= HasSeenAncestorWithOverflowClip; 496 flags |= HasSeenAncestorWithOverflowClip;
496 497
497 if (flags & HasSeenViewportConstrainedAncestor 498 if (flags & HasSeenViewportConstrainedAncestor
498 || (flags & IsOverflowScroll && flags & HasSeenAncestorWithOverflowClip && !m_canSkipRepaintRectsUpdateOnScroll)) { 499 || (flags & IsOverflowScroll && flags & HasSeenAncestorWithOverflowClip && !m_canSkipRepaintRectsUpdateOnScroll)) {
500 // FIXME: This may not be needed. Once repaint-after-layout isn't
501 // under-painting for layer's we should see if this can be removed.
502 LayoutRectRecorder recorder(*m_renderer);
503
499 // FIXME: Remove incremental compositing updates after fixing the chicke n/egg issues 504 // FIXME: Remove incremental compositing updates after fixing the chicke n/egg issues
500 // https://code.google.com/p/chromium/issues/detail?id=343756 505 // https://code.google.com/p/chromium/issues/detail?id=343756
501 DisableCompositingQueryAsserts disabler; 506 DisableCompositingQueryAsserts disabler;
502 // FIXME: We could track the repaint container as we walk down the tree. 507 // FIXME: We could track the repaint container as we walk down the tree.
503 repainter().computeRepaintRects(renderer()->containerForRepaint(), geome tryMap); 508 repainter().computeRepaintRects(renderer()->containerForRepaint(), geome tryMap);
504 } else { 509 } else {
505 // Check that RenderLayerRepainter's cached rects are correct. 510 // Check that RenderLayerRepainter's cached rects are correct.
506 // FIXME: re-enable these assertions when the issue with table cells is resolved: https://bugs.webkit.org/show_bug.cgi?id=103432 511 // FIXME: re-enable these assertions when the issue with table cells is resolved: https://bugs.webkit.org/show_bug.cgi?id=103432
507 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo rRepaint(renderer()->containerForRepaint())); 512 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo rRepaint(renderer()->containerForRepaint()));
508 // ASSERT(repainter().m_outlineBox == renderer()->outlineBoundsForRepain t(renderer()->containerForRepaint(), geometryMap)); 513 // ASSERT(repainter().m_outlineBox == renderer()->outlineBoundsForRepain t(renderer()->containerForRepaint(), geometryMap));
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 if (preserves3D()) 921 if (preserves3D())
917 return has3DTransform() || m_has3DTransformedDescendant; 922 return has3DTransform() || m_has3DTransformedDescendant;
918 923
919 return has3DTransform(); 924 return has3DTransform();
920 } 925 }
921 926
922 bool RenderLayer::updateLayerPosition() 927 bool RenderLayer::updateLayerPosition()
923 { 928 {
924 LayoutPoint localPoint; 929 LayoutPoint localPoint;
925 LayoutSize inlineBoundingBoxOffset; // We don't put this into the RenderLaye r x/y for inlines, so we need to subtract it out when done. 930 LayoutSize inlineBoundingBoxOffset; // We don't put this into the RenderLaye r x/y for inlines, so we need to subtract it out when done.
931
932 LayoutRectRecorder recorder(*m_renderer);
Julien - ping for review 2014/03/04 18:22:10 This shouldn't be needed and *will* cause over-inv
dsinclair 2014/03/04 19:21:52 That should be fine as it checks if newBounds == o
933
926 if (renderer()->isInline() && renderer()->isRenderInline()) { 934 if (renderer()->isInline() && renderer()->isRenderInline()) {
927 RenderInline* inlineFlow = toRenderInline(renderer()); 935 RenderInline* inlineFlow = toRenderInline(renderer());
928 IntRect lineBox = inlineFlow->linesBoundingBox(); 936 IntRect lineBox = inlineFlow->linesBoundingBox();
929 setSize(lineBox.size()); 937 setSize(lineBox.size());
930 inlineBoundingBoxOffset = toSize(lineBox.location()); 938 inlineBoundingBoxOffset = toSize(lineBox.location());
931 localPoint += inlineBoundingBoxOffset; 939 localPoint += inlineBoundingBoxOffset;
932 } else if (RenderBox* box = renderBox()) { 940 } else if (RenderBox* box = renderBox()) {
933 // FIXME: Is snapping the size really needed here for the RenderBox case ? 941 // FIXME: Is snapping the size really needed here for the RenderBox case ?
934 setSize(pixelSnappedIntSize(box->size(), box->location())); 942 setSize(pixelSnappedIntSize(box->size(), box->location()));
935 localPoint += box->topLeftLocationOffset(); 943 localPoint += box->topLeftLocationOffset();
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 // The reflection layer should not be moved to the parent. 1467 // The reflection layer should not be moved to the parent.
1460 if (m_reflectionInfo) 1468 if (m_reflectionInfo)
1461 removeChild(m_reflectionInfo->reflectionLayer()); 1469 removeChild(m_reflectionInfo->reflectionLayer());
1462 1470
1463 // Now walk our kids and reattach them to our parent. 1471 // Now walk our kids and reattach them to our parent.
1464 RenderLayer* current = m_first; 1472 RenderLayer* current = m_first;
1465 while (current) { 1473 while (current) {
1466 RenderLayer* next = current->nextSibling(); 1474 RenderLayer* next = current->nextSibling();
1467 removeChild(current); 1475 removeChild(current);
1468 m_parent->addChild(current, nextSib); 1476 m_parent->addChild(current, nextSib);
1469 current->repainter().setRepaintStatus(NeedsFullRepaint); 1477
1478 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
1479 current->renderer()->setShouldDoFullRepaintAfterLayout(true);
1480 else
1481 current->repainter().setRepaintStatus(NeedsFullRepaint);
1470 1482
1471 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html 1483 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html
1472 DisableCompositingQueryAsserts disabler; 1484 DisableCompositingQueryAsserts disabler;
1473 1485
1474 current->updateLayerPositions(0); // FIXME: use geometry map. 1486 current->updateLayerPositions(0); // FIXME: use geometry map.
1475 current = next; 1487 current = next;
1476 } 1488 }
1477 1489
1478 // Remove us from the parent. 1490 // Remove us from the parent.
1479 m_parent->removeChild(this); 1491 m_parent->removeChild(this);
(...skipping 2551 matching lines...) Expand 10 before | Expand all | Expand 10 after
4031 } 4043 }
4032 } 4044 }
4033 4045
4034 void showLayerTree(const WebCore::RenderObject* renderer) 4046 void showLayerTree(const WebCore::RenderObject* renderer)
4035 { 4047 {
4036 if (!renderer) 4048 if (!renderer)
4037 return; 4049 return;
4038 showLayerTree(renderer->enclosingLayer()); 4050 showLayerTree(renderer->enclosingLayer());
4039 } 4051 }
4040 #endif 4052 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698