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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 8d06f7d70ea1a4e16d521bc205cd63f24498990d..c67c2335f09000b6be23675463205464592e8edd 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -567,6 +567,7 @@ public:
// FIXME: Until all SVG layoutObjects can be subclasses of LayoutSVGModelObject we have
// to add SVG layoutObject methods to LayoutObject with an ASSERT_NOT_REACHED() default implementation.
bool isSVG() const { return isOfType(LayoutObjectSVG); }
+ bool isSVGModelObject() const { return isOfType(LayoutObjectSVGModelObject); }
bool isSVGRoot() const { return isOfType(LayoutObjectSVGRoot); }
bool isSVGContainer() const { return isOfType(LayoutObjectSVGContainer); }
bool isSVGTransformableContainer() const { return isOfType(LayoutObjectSVGTransformableContainer); }
@@ -1272,23 +1273,23 @@ public:
// The previous position of the top-left corner of the object in its previous paint backing.
const LayoutPoint& previousPositionFromPaintInvalidationBacking() const
{
- ASSERT(!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
return m_previousPositionFromPaintInvalidationBacking;
}
void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& positionFromPaintInvalidationBacking)
{
- ASSERT(!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking;
}
bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const
{
- ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
- return m_previousPositionFromPaintInvalidationBacking != uninitializedPaintOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset;
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+ return m_previousPositionFromPaintInvalidationBacking != newPaintOffset;
}
void setPreviousPaintOffset(const LayoutPoint& paintOffset)
{
- ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
m_previousPositionFromPaintInvalidationBacking = paintOffset;
}
@@ -1335,7 +1336,7 @@ public:
// Painters can use const methods only, except for these explicitly declared methods.
class MutableForPainting {
public:
- void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutObject.setPreviousPaintOffset(paintOffset); }
+ void invalidatePaintIfNeeded(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) { m_layoutObject.invalidatePaintIfNeededForSlimmingPaintV2(paintInfo, paintOffset); }
private:
friend class LayoutObject;
@@ -1401,6 +1402,7 @@ protected:
LayoutObjectWidget,
LayoutObjectSVG, /* Keep by itself? */
+ LayoutObjectSVGModelObject,
LayoutObjectSVGRoot,
LayoutObjectSVGContainer,
LayoutObjectSVGTransformableContainer,
@@ -1507,6 +1509,7 @@ protected:
// It doesn't recurse into other object, as this is handled
// by invalidatePaintOfSubtreesIfNeeded.
virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationState&, const LayoutBoxModelObject& paintInvalidationContainer);
+ void invalidatePaintIfNeededForSlimmingPaintV2(const PaintInfo&, const LayoutPoint& paintOffset);
// When this object is invalidated for paint, this method is called to invalidate any DisplayItemClients
// owned by this object, including the object itself, LayoutText/LayoutInline line boxes, etc.,
@@ -1603,8 +1606,6 @@ private:
// The passed rect is mutated into the coordinate space of the paint invalidation container.
const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRect&) const;
- static LayoutPoint uninitializedPaintOffset() { return LayoutPoint(LayoutUnit::max(), LayoutUnit::max()); }
-
RefPtr<ComputedStyle> m_style;
// Oilpan: This untraced pointer to the owning Node is considered safe.
@@ -1890,8 +1891,8 @@ private:
// This stores the position in the paint invalidation backing's coordinate.
// It is used to detect layoutObject shifts that forces a full invalidation.
// This point does *not* account for composited scrolling. See adjustInvalidationRectForCompositedScrolling().
- // For slimmingPaintOffsetCaching, this stores the previous paint offset.
- // TODO(wangxianzhu): Rename this to m_previousPaintOffset when we enable slimmingPaintOffsetCaching.
+ // For slimmingPaintV2, this stores the previous paint offset.
+ // TODO(wangxianzhu): Rename this to m_previousPaintOffset when we enable slimmingPaintV2.
LayoutPoint m_previousPositionFromPaintInvalidationBacking;
};
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698