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

Unified Diff: Source/core/rendering/PaintInvalidationState.cpp

Issue 434453002: Promote inlines to first-class invalidation citizens (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test and expectations Created 6 years, 5 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/PaintInvalidationState.cpp
diff --git a/Source/core/rendering/PaintInvalidationState.cpp b/Source/core/rendering/PaintInvalidationState.cpp
index 65ad3d5be60264465f36bffbd354e1f6daf576b2..0bb709bfd30d0712dce7e9560c050fb4f149a819 100644
--- a/Source/core/rendering/PaintInvalidationState.cpp
+++ b/Source/core/rendering/PaintInvalidationState.cpp
@@ -40,42 +40,7 @@ PaintInvalidationState::PaintInvalidationState(RenderObject& renderer)
}
}
-PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& next, RenderSVGModelObject& renderer, const RenderLayerModelObject& paintInvalidationContainer)
- : m_clipped(next.m_clipped)
- , m_cachedOffsetsEnabled(next.m_cachedOffsetsEnabled)
- , m_paintInvalidationContainer(paintInvalidationContainer)
- , m_renderer(renderer)
-{
- // FIXME: SVG could probably benefit from a stack-based optimization like html does. crbug.com/391054
Julien - ping for review 2014/08/04 19:36:39 We removed this comment, does that mean that the b
leviw_travelin_and_unemployed 2014/08/05 22:34:44 No. I put it back.
- ASSERT(!m_cachedOffsetsEnabled);
-}
-
-PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& next, RenderInline& renderer, const RenderLayerModelObject& paintInvalidationContainer)
- : m_clipped(false)
- , m_cachedOffsetsEnabled(true)
- , m_paintInvalidationContainer(paintInvalidationContainer)
- , m_renderer(renderer)
-{
- bool establishesPaintInvalidationContainer = &m_renderer == &m_paintInvalidationContainer;
- if (!establishesPaintInvalidationContainer) {
- if (!renderer.supportsLayoutStateCachedOffsets() || !next.m_cachedOffsetsEnabled) {
- m_cachedOffsetsEnabled = false;
- } else if (m_cachedOffsetsEnabled) {
- m_paintOffset = next.m_paintOffset;
- // Handle relative positioned inline.
- if (renderer.style()->hasInFlowPosition() && renderer.layer())
- m_paintOffset += renderer.layer()->offsetForInFlowPosition();
-
- // RenderInline can't be out-of-flow positioned.
- }
-
- // The following can't apply to RenderInline so we just propagate them.
- m_clipped = next.m_clipped;
- m_clipRect = next.m_clipRect;
- }
-}
-
-PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& next, RenderBox& renderer, const RenderLayerModelObject& paintInvalidationContainer)
+PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& next, RenderLayerModelObject& renderer, const RenderLayerModelObject& paintInvalidationContainer)
: m_clipped(false)
, m_cachedOffsetsEnabled(true)
, m_paintInvalidationContainer(paintInvalidationContainer)
@@ -88,7 +53,7 @@ PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& nex
if (!renderer.supportsLayoutStateCachedOffsets() || !next.m_cachedOffsetsEnabled) {
m_cachedOffsetsEnabled = false;
} else {
- LayoutSize offset = m_renderer.isTableRow() ? LayoutSize() : renderer.locationOffset();
+ LayoutSize offset = m_renderer.isBox() && !m_renderer.isTableRow() ? toRenderBox(renderer).locationOffset() : LayoutSize();
if (fixed) {
// FIXME: This doesn't work correctly with transforms.
FloatPoint fixedOffset = m_renderer.view()->localToAbsolute(FloatPoint(), IsFixed);
@@ -100,7 +65,7 @@ PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& nex
if (m_renderer.isOutOfFlowPositioned() && !fixed) {
if (RenderObject* container = m_renderer.container()) {
if (container->style()->hasInFlowPosition() && container->isRenderInline())
- m_paintOffset += toRenderInline(container)->offsetForInFlowPositionedInline(renderer);
+ m_paintOffset += toRenderInline(container)->offsetForInFlowPositionedInline(toRenderBox(renderer));
dsinclair 2014/08/05 15:09:47 renderer is a RenderLayerModelObject, does this ne
leviw_travelin_and_unemployed 2014/08/05 22:34:44 We're guaranteed that this is the case, but toRend
}
}

Powered by Google App Engine
This is Rietveld 408576698