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

Unified Diff: Source/core/rendering/svg/RenderSVGModelObject.cpp

Issue 260963012: Override repaintTreeAfterLayout for RenderSVGModelObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/svg/RenderSVGModelObject.cpp
diff --git a/Source/core/rendering/svg/RenderSVGModelObject.cpp b/Source/core/rendering/svg/RenderSVGModelObject.cpp
index 15679791569f254950edbde84f9cc9cffea4ae77..f00a9879822959139e44a5ab1a9c9fcfa929053c 100644
--- a/Source/core/rendering/svg/RenderSVGModelObject.cpp
+++ b/Source/core/rendering/svg/RenderSVGModelObject.cpp
@@ -33,6 +33,8 @@
#include "core/rendering/svg/RenderSVGModelObject.h"
#include "SVGNames.h"
+#include "core/rendering/RenderLayer.h"
+#include "core/rendering/RenderView.h"
#include "core/rendering/svg/RenderSVGRoot.h"
#include "core/rendering/svg/SVGResourcesCache.h"
#include "core/svg/SVGGraphicsElement.h"
@@ -123,4 +125,51 @@ void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads)
quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())));
}
+void RenderSVGModelObject::repaintTreeAfterLayout()
+{
+ // Note: This is a reduced version of RenderBox::repaintTreeAfterLayout().
+
+ ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled());
+ ASSERT(!needsLayout());
+
+ const LayoutRect oldRepaintRect = previousRepaintRect();
+ const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepaintContainer();
+ RenderLayerModelObject* repaintContainer = containerForRepaint();
+ setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer));
+ setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaintContainer));
+
+ // If we are set to do a full repaint that means the RenderView will be
+ // invalidated. We can then skip issuing of invalidations for the child
+ // renderers as they'll be covered by the RenderView.
+ if (view()->doingFullRepaint()) {
+ RenderObject::repaintTreeAfterLayout();
dsinclair 2014/05/02 15:19:19 Does this need a LayoutStateDisabler?
fs 2014/05/02 15:36:09 Maybe... Can't be used in it's current form though
dsinclair 2014/05/02 15:40:26 I don't think it has to take a RenderBox. It just
fs 2014/05/02 15:53:52 Yeah, I wasn't sure if that would be frowned upon
+ return;
+ }
+
+ if (onlyNeededPositionedMovementLayout() && compositingState() != PaintsIntoOwnBacking) {
+ setShouldDoFullRepaintAfterLayout(true);
+ }
+
+ const LayoutRect& newRepaintRect = previousRepaintRect();
+ const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRepaintContainer();
+ bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(),
+ shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaintContainer, &newRepaintRect, &newPositionFromRepaintContainer);
+
+ if (!didFullRepaint)
+ repaintOverflowIfNeeded();
+
+ // Repaint any scrollbars if there is a scrollable area for this renderer.
+ if (enclosingLayer()) {
+ if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea()) {
+ if (area->hasVerticalBarDamage())
+ repaintRectangle(area->verticalBarDamage());
+ if (area->hasHorizontalBarDamage())
+ repaintRectangle(area->horizontalBarDamage());
+ area->resetScrollbarDamage();
+ }
+ }
+
+ RenderObject::repaintTreeAfterLayout();
dsinclair 2014/05/02 15:19:19 Ditto, layout state disabler?
+}
+
} // namespace WebCore
« LayoutTests/TestExpectations ('K') | « Source/core/rendering/svg/RenderSVGModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698