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

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, 10 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/FrameView.h" 57 #include "core/frame/FrameView.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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 m_clipper.clearClipRects(); 492 m_clipper.clearClipRects();
492 493
493 if (renderer()->style()->hasViewportConstrainedPosition()) 494 if (renderer()->style()->hasViewportConstrainedPosition())
494 flags |= HasSeenViewportConstrainedAncestor; 495 flags |= HasSeenViewportConstrainedAncestor;
495 496
496 if (renderer()->hasOverflowClip()) 497 if (renderer()->hasOverflowClip())
497 flags |= HasSeenAncestorWithOverflowClip; 498 flags |= HasSeenAncestorWithOverflowClip;
498 499
499 if (flags & HasSeenViewportConstrainedAncestor 500 if (flags & HasSeenViewportConstrainedAncestor
500 || (flags & IsOverflowScroll && flags & HasSeenAncestorWithOverflowClip && !m_canSkipRepaintRectsUpdateOnScroll)) { 501 || (flags & IsOverflowScroll && flags & HasSeenAncestorWithOverflowClip && !m_canSkipRepaintRectsUpdateOnScroll)) {
502 // FIXME: This may not be needed. Once repaint-after-layout isn't
503 // under-painting for layer's we should see if this can be removed.
504 LayoutRectRecorder recorder(*m_renderer);
505
501 // FIXME: Remove incremental compositing updates after fixing the chicke n/egg issues 506 // FIXME: Remove incremental compositing updates after fixing the chicke n/egg issues
502 // https://code.google.com/p/chromium/issues/detail?id=343756 507 // https://code.google.com/p/chromium/issues/detail?id=343756
503 DisableCompositingQueryAsserts disabler; 508 DisableCompositingQueryAsserts disabler;
504 // FIXME: We could track the repaint container as we walk down the tree. 509 // FIXME: We could track the repaint container as we walk down the tree.
505 repainter().computeRepaintRects(renderer()->containerForRepaint(), geome tryMap); 510 repainter().computeRepaintRects(renderer()->containerForRepaint(), geome tryMap);
506 } else { 511 } else {
507 // Check that RenderLayerRepainter's cached rects are correct. 512 // Check that RenderLayerRepainter's cached rects are correct.
508 // FIXME: re-enable these assertions when the issue with table cells is resolved: https://bugs.webkit.org/show_bug.cgi?id=103432 513 // FIXME: re-enable these assertions when the issue with table cells is resolved: https://bugs.webkit.org/show_bug.cgi?id=103432
509 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo rRepaint(renderer()->containerForRepaint())); 514 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo rRepaint(renderer()->containerForRepaint()));
510 // ASSERT(repainter().m_outlineBox == renderer()->outlineBoundsForRepain t(renderer()->containerForRepaint(), geometryMap)); 515 // ASSERT(repainter().m_outlineBox == renderer()->outlineBoundsForRepain t(renderer()->containerForRepaint(), geometryMap));
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 if (preserves3D()) 923 if (preserves3D())
919 return has3DTransform() || m_has3DTransformedDescendant; 924 return has3DTransform() || m_has3DTransformedDescendant;
920 925
921 return has3DTransform(); 926 return has3DTransform();
922 } 927 }
923 928
924 bool RenderLayer::updateLayerPosition() 929 bool RenderLayer::updateLayerPosition()
925 { 930 {
926 LayoutPoint localPoint; 931 LayoutPoint localPoint;
927 LayoutSize inlineBoundingBoxOffset; // We don't put this into the RenderLaye r x/y for inlines, so we need to subtract it out when done. 932 LayoutSize inlineBoundingBoxOffset; // We don't put this into the RenderLaye r x/y for inlines, so we need to subtract it out when done.
933
934 LayoutRectRecorder recorder(*m_renderer);
935
928 if (renderer()->isInline() && renderer()->isRenderInline()) { 936 if (renderer()->isInline() && renderer()->isRenderInline()) {
929 RenderInline* inlineFlow = toRenderInline(renderer()); 937 RenderInline* inlineFlow = toRenderInline(renderer());
930 IntRect lineBox = inlineFlow->linesBoundingBox(); 938 IntRect lineBox = inlineFlow->linesBoundingBox();
931 setSize(lineBox.size()); 939 setSize(lineBox.size());
932 inlineBoundingBoxOffset = toSize(lineBox.location()); 940 inlineBoundingBoxOffset = toSize(lineBox.location());
933 localPoint += inlineBoundingBoxOffset; 941 localPoint += inlineBoundingBoxOffset;
934 } else if (RenderBox* box = renderBox()) { 942 } else if (RenderBox* box = renderBox()) {
935 // FIXME: Is snapping the size really needed here for the RenderBox case ? 943 // FIXME: Is snapping the size really needed here for the RenderBox case ?
936 setSize(pixelSnappedIntSize(box->size(), box->location())); 944 setSize(pixelSnappedIntSize(box->size(), box->location()));
937 localPoint += box->topLeftLocationOffset(); 945 localPoint += box->topLeftLocationOffset();
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 // The reflection layer should not be moved to the parent. 1457 // The reflection layer should not be moved to the parent.
1450 if (m_reflectionInfo) 1458 if (m_reflectionInfo)
1451 removeChild(m_reflectionInfo->reflectionLayer()); 1459 removeChild(m_reflectionInfo->reflectionLayer());
1452 1460
1453 // Now walk our kids and reattach them to our parent. 1461 // Now walk our kids and reattach them to our parent.
1454 RenderLayer* current = m_first; 1462 RenderLayer* current = m_first;
1455 while (current) { 1463 while (current) {
1456 RenderLayer* next = current->nextSibling(); 1464 RenderLayer* next = current->nextSibling();
1457 removeChild(current); 1465 removeChild(current);
1458 m_parent->addChild(current, nextSib); 1466 m_parent->addChild(current, nextSib);
1459 current->repainter().setRepaintStatus(NeedsFullRepaint); 1467
1468 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
1469 current->renderer()->setShouldDoFullRepaintAfterLayout(true);
1470 else
1471 current->repainter().setRepaintStatus(NeedsFullRepaint);
1460 1472
1461 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html 1473 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-part-1.html
1462 DisableCompositingQueryAsserts disabler; 1474 DisableCompositingQueryAsserts disabler;
1463 1475
1464 current->updateLayerPositions(0); // FIXME: use geometry map. 1476 current->updateLayerPositions(0); // FIXME: use geometry map.
1465 current = next; 1477 current = next;
1466 } 1478 }
1467 1479
1468 // Remove us from the parent. 1480 // Remove us from the parent.
1469 m_parent->removeChild(this); 1481 m_parent->removeChild(this);
(...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after
4020 } 4032 }
4021 } 4033 }
4022 4034
4023 void showLayerTree(const WebCore::RenderObject* renderer) 4035 void showLayerTree(const WebCore::RenderObject* renderer)
4024 { 4036 {
4025 if (!renderer) 4037 if (!renderer)
4026 return; 4038 return;
4027 showLayerTree(renderer->enclosingLayer()); 4039 showLayerTree(renderer->enclosingLayer());
4028 } 4040 }
4029 #endif 4041 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698