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

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: This is up to date... Created 6 years, 4 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
« no previous file with comments | « Source/core/rendering/PaintInvalidationState.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/PaintInvalidationState.cpp
diff --git a/Source/core/rendering/PaintInvalidationState.cpp b/Source/core/rendering/PaintInvalidationState.cpp
index d838a1b71b6272d10a3ec6888f8c7f86c5a8811e..12753da0aa22a6da7771cd721d2f3fc49216b18f 100644
--- a/Source/core/rendering/PaintInvalidationState.cpp
+++ b/Source/core/rendering/PaintInvalidationState.cpp
@@ -41,55 +41,14 @@ 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_forceCheckForPaintInvalidation(next.m_forceCheckForPaintInvalidation)
- , m_paintInvalidationContainer(paintInvalidationContainer)
- , m_renderer(renderer)
-{
- // FIXME: SVG could probably benefit from a stack-based optimization like html does. crbug.com/391054
- ASSERT(!m_cachedOffsetsEnabled);
-}
-
-PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& next, RenderInline& renderer, const RenderLayerModelObject& paintInvalidationContainer)
- : m_clipped(false)
- , m_cachedOffsetsEnabled(true)
- , m_forceCheckForPaintInvalidation(next.m_forceCheckForPaintInvalidation)
- , m_paintInvalidationContainer(paintInvalidationContainer)
- , m_renderer(renderer)
-{
- bool establishesPaintInvalidationContainer = &m_renderer == &m_paintInvalidationContainer;
- if (establishesPaintInvalidationContainer) {
- // When we hit a new paint invalidation container, we don't need to
- // continue forcing a check for paint invalidation because movement
- // from our parents will just move the whole invalidation container.
- m_forceCheckForPaintInvalidation = false;
- } else {
- if (!renderer.supportsPaintInvalidationStateCachedOffsets() || !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_forceCheckForPaintInvalidation(next.m_forceCheckForPaintInvalidation)
, m_paintInvalidationContainer(paintInvalidationContainer)
, m_renderer(renderer)
{
+ // FIXME: SVG could probably benefit from a stack-based optimization like html does. crbug.com/391054
bool establishesPaintInvalidationContainer = &m_renderer == &m_paintInvalidationContainer;
bool fixed = m_renderer.isOutOfFlowPositioned() && m_renderer.style()->position() == FixedPosition;
@@ -102,7 +61,7 @@ PaintInvalidationState::PaintInvalidationState(const PaintInvalidationState& nex
if (!renderer.supportsPaintInvalidationStateCachedOffsets() || !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);
@@ -114,7 +73,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));
}
}
« no previous file with comments | « Source/core/rendering/PaintInvalidationState.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698